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.
This commit is contained in:
Thomas Haller 2017-05-24 13:47:58 +02:00
parent 3355a2823b
commit 44df6d7938

View file

@ -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 ();
}