# HG changeset patch # User Pádraig Brady # Date 1386159100 0 # Node ID 77b12978b89bef29ea481b7020dd58bf3898b75a # Parent efe50ad06bac075f37db328e118a0bbb245b0287 regex: suppress core dumps from detection code * m4/regex.m4 (gl_REGEX): Catch the SIGABRT and convert to SIGTERM to suppress core dumps that may well occur on glibc systems. These core dumps might not be cleaned up automatically, or could trigger some system core dump handling logic. diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2013-12-04 Pádraig Brady + + regex: suppress core dumps from detection code + * m4/regex.m4 (gl_REGEX): Catch the SIGABRT and convert to SIGTERM + to suppress core dumps that may well occur on glibc systems. + These core dumps might not be cleaned up automatically, or could + trigger some system core dump handling logic. + 2013-12-03 Pádraig Brady md5, sha1, sha256, sha512: support mandating use of openssl diff --git a/m4/regex.m4 b/m4/regex.m4 --- a/m4/regex.m4 +++ b/m4/regex.m4 @@ -38,13 +38,20 @@ #include #include #include - #if HAVE_DECL_ALARM + + #if defined M_CHECK_ACTION || HAVE_DECL_ALARM + # include # include - # include #endif + #if HAVE_MALLOC_H # include #endif + + #ifdef M_CHECK_ACTION + /* Exit with distinguishable exit code. */ + static void sigabrt_no_core (int sig) { raise (SIGTERM); } + #endif ]], [[int result = 0; static struct re_pattern_buffer regex; @@ -61,7 +68,8 @@ alarm (2); #endif #ifdef M_CHECK_ACTION - mallopt(M_CHECK_ACTION, 2); + signal (SIGABRT, sigabrt_no_core); + mallopt (M_CHECK_ACTION, 2); #endif if (setlocale (LC_ALL, "en_US.UTF-8"))