]> Savannah Git Hosting - gnulib.git/commitdiff
regex: suppress core dumps from detection code
authorPádraig Brady <P@draigBrady.com>
Wed, 4 Dec 2013 12:11:40 +0000 (12:11 +0000)
committerPádraig Brady <P@draigBrady.com>
Wed, 4 Dec 2013 12:13:58 +0000 (12:13 +0000)
* 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.

ChangeLog
m4/regex.m4

index 50a16efdcc3f933649c1a0f665d6059686cb6f55..3a7feac4f12734c090d804119f0948094fb8b184 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2013-12-04  Pádraig Brady <P@draigBrady.com>
+
+       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 <P@draigBrady.com>
 
        md5, sha1, sha256, sha512: support mandating use of openssl
index 0089c08e999711ac6c726bd9e94e6f6590c5ce90..795d72044912eeb41391a90f4c8f07c4d9b8b3e4 100644 (file)
@@ -38,13 +38,20 @@ AC_DEFUN([gl_REGEX],
             #include <locale.h>
             #include <limits.h>
             #include <string.h>
-            #if HAVE_DECL_ALARM
-            # include <unistd.h>
+
+            #if defined M_CHECK_ACTION || HAVE_DECL_ALARM
             # include <signal.h>
+            # include <unistd.h>
             #endif
+
             #if HAVE_MALLOC_H
             # include <malloc.h>
             #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 @@ AC_DEFUN([gl_REGEX],
             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"))