From 44df6d793818c62719a7efe65808beb3461a8436 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 24 May 2017 13:47:58 +0200 Subject: [PATCH] core: don't enable setrlimit(RLIMIT_CORE) when running with address sanitizer With address sanitizer, the call to setrlimit() fails by default, because the core dump would be huge. That could be overwritten via ASAN_OPTIONS=disable_core=0 But just don't try to enable core-dumps with asan. --- src/main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main.c b/src/main.c index d334cbbc86..c20928db11 100644 --- a/src/main.c +++ b/src/main.c @@ -110,6 +110,7 @@ _init_nm_debug (NMConfig *config) flags = nm_utils_parse_debug_string (env, keys, G_N_ELEMENTS (keys)); flags |= nm_utils_parse_debug_string (debug, keys, G_N_ELEMENTS (keys)); +#if ! defined (__SANITIZE_ADDRESS__) if (NM_FLAGS_HAS (flags, D_RLIMIT_CORE)) { /* only enable this, if explicitly requested, because it might * expose sensitive data. */ @@ -120,6 +121,8 @@ _init_nm_debug (NMConfig *config) }; setrlimit (RLIMIT_CORE, &limit); } +#endif + if (NM_FLAGS_HAS (flags, D_FATAL_WARNINGS)) _set_g_fatal_warnings (); }