On 19/07/11 16:34, Eric Blake wrote:
> On 07/19/2011 03:55 AM, Pádraig Brady wrote:
>> On 07/07/11 17:57, Eric Blake wrote:
>>> Use of "W;" in an option string may be rare, but we might as well
>>> avoid crashing on it.
>>>
>>> * m4/getopt.m4 (gl_GETOPT_CHECK_HEADRS): Detect the problem.
>>
>> I noticed core files which are due to this I think.
>> Should it be protected with m4/nocrash.m4 ?
> 
> Does nocrash.m4 prevent core files on Linux, or is it just for
> preventing modal popup boxes on other OS?

It prevents cores on Linux at least.
Note my Fedora system is configured to include pids in the core files,
and the generic ./configure cleanup code does not remove those.

> But if it improves the
> situation, then I'm okay with a patch - would you care to submit one?

Attached.

cheers,
Pádraig.
>From 9da91f2716be762ec0d69b0ccc9770faf458cd1c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <p...@draigbrady.com>
Date: Tue, 19 Jul 2011 17:22:49 +0100
Subject: [PATCH] getopt-gnu: suppress core dumps from detection code
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* m4/getopt.m4 (gl_GETOPT_CHECK_HEADERS): Use the nocrash module
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.
* modules/getopt-gnu: Depend on nocrash.

Signed-off-by: Pádraig Brady <p...@draigbrady.com>
---
 ChangeLog          |    7 +++++++
 m4/getopt.m4       |    3 +++
 modules/getopt-gnu |    1 +
 3 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index a521e9b..e72af4c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2011-07-19  Pádraig Brady  <p...@draigbrady.com>
+
+	getopt-gnu: suppress core dumps from detection code
+	* m4/getopt.m4 (gl_GETOPT_CHECK_HEADERS): Use the nocrash module
+	to suppress core dumps that may well occur on glibc systems.
+	* modules/getopt-gnu: Depend on nocrash.
+
 2011-07-16  Paul Eggert  <egg...@cs.ucla.edu>
 
 	pthread_sigmask: ensure usleep is declared
diff --git a/m4/getopt.m4 b/m4/getopt.m4
index 7e49ddd..c7de83d 100644
--- a/m4/getopt.m4
+++ b/m4/getopt.m4
@@ -231,7 +231,10 @@ dnl is ambiguous with environment values that contain newlines.
         [AC_LANG_PROGRAM([[#include <getopt.h>
                            #include <stddef.h>
                            #include <string.h>
+           ]GL_NOCRASH[
            ]], [[
+             nocrash_init();
+
              int result = 0;
              /* This code succeeds on glibc 2.8, OpenBSD 4.0, Cygwin, mingw,
                 and fails on MacOS X 10.5, AIX 5.2, HP-UX 11, IRIX 6.5,
diff --git a/modules/getopt-gnu b/modules/getopt-gnu
index 3e5876a..6ad3643 100644
--- a/modules/getopt-gnu
+++ b/modules/getopt-gnu
@@ -5,6 +5,7 @@ process command line arguments.
 Files:
 
 Depends-on:
+nocrash
 getopt-posix
 
 configure.ac:
-- 
1.7.5.2

Reply via email to