bug-autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: segmentation fault on 'unset MAIL' for bash 2.01.1(1)-release


From: Brian Gough
Subject: Re: segmentation fault on 'unset MAIL' for bash 2.01.1(1)-release
Date: Thu, 31 Jul 2003 14:02:36 +0100

Paul Eggert writes:
 > Brian Gough <address@hidden> writes:
 > 
 > > The comment in the autoconf source is "work around bugs in pre-3.0
 > > UWIN ksh".  If this is the only reason I'd suggest removing the unset
 > > command, since it seems to benefit a proprietary OS at the expense of
 > > GNU.
 > 
 > Better would be to support both systems.
 > 
 > Does this patch to Autoconf fix things for you?  If not, can you
 > suggest a simple test that would let us know whether the shell has the
 > bug?

Thanks, I've tried the patch and it moves the segfault to the
subshell, so the configure script continues running, but there is an
error message when it catches SIGSEGV, which looks bad.

  bjg|debian> ~/tmp/gsl-1.3.20030729/configure 
  /home/bjg/tmp/gsl-1.3.20030729/configure: line 29:   841 Segmentation fault   
   ( MAIL=60; unset MAIL )>/dev/null 2>&1
  checking for a BSD-compatible install... /usr/bin/install -c
  checking whether build environment is sane... yes

Below is a patch which tests each unset VAR command inside `...` (this
doesn't propagate signals, in bash anyway, so the error message is
hidden).  If the variable is already null or unset it leaves it alone.

The one potential issue with this approach is that it will potentially
leave behind a stray core file with the versions of bash which have
the bug.

best regards,

-- 
Brian Gough

Network Theory Ltd            
15 Royal Park                 
Bristol BS8 3AL               
United Kingdom                

Tel: +44 (0)117 3179309 
Fax: +44 (0)117 9048108              
Web: http://www.network-theory.co.uk/


Index: lib/m4sugar/m4sh.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/m4sugar/m4sh.m4,v
retrieving revision 1.98
diff -u -r1.98 m4sh.m4
--- lib/m4sugar/m4sh.m4 22 May 2003 21:39:45 -0000      1.98
+++ lib/m4sugar/m4sh.m4 31 Jul 2003 12:49:02 -0000
@@ -156,10 +156,21 @@
 _AS_UNSET_PREPARE
 
 # Work around bugs in pre-3.0 UWIN ksh.
-$as_unset ENV MAIL MAILPATH
+$as_unset ENV
 PS1='$ '
 PS2='> '
 PS4='+ '
+
+# Avoid triggering possible segfault for 'unset MAIL MAILPATH' in
+# bash-2.01.
+for as_var in MAIL MAILPATH
+do
+  if eval "test \"\${$as_var+set}\" = set"; then
+    if test "x`($as_unset $as_var && echo yes) 2>&1`" = "xyes"; then
+       $as_unset $as_var
+    fi
+  fi
+done
 
 # NLS nuisances.
 for as_var in \




reply via email to

[Prev in Thread] Current Thread [Next in Thread]