Subject: sh crashes in configure of emulators/uae on amd64?
To: None <current-users@netbsd.org>
From: Rhialto <rhialto@falu.nl>
List: current-users
Date: 01/31/2006 22:54:34
Are there more people who see sh crash while configuring emulators/uae?
I saw it in a chroot from pkg_comp.

It crashes like this:

configure: checking how to get filesystem space usage...
checking statvfs function (SVR4)... yes
checking for ftruncate... (cached) yes
checking for statfs that truncates block counts... no
configure: checking for AFS...
[1]   Segmentation fault (core dumped) /usr/bin/env AWK...
*** Error code 139

Stop.
make: stopped in /usr/pkgsrc/emulators/uae

Syslog logs this:

Jan 31 22:36:53 radl /netbsd: pid 15778 (sh), uid 0: exited on signal 11 (core dumped)

The configure script looks like this in the neighbourhood:

{ echo "$as_me:$LINENO: checking for AFS..." >&5
echo "$as_me: checking for AFS..." >&6;}
test -d /afs && cat >>confdefs.h <<\_ACEOF
#define AFS 1
_ACEOF
echo "after _ACEOF";

fi
echo "after fi";

if [ $target = "p.os" ]; then
    HAVE_POS=yes
else
...

(I added the two echo statements)
The "fi" appears unbalanced but the if may be somewhere much earlier.
I added the echo statements to find out where exactly the crash was, and
of course that made enough difference to avoid the crash. Then it prints

checking for ftruncate... (cached) yes
checking for statfs that truncates block counts... no
configure: checking for AFS...
after _ACEOF
after fi
[: p.os: unexpected operator
checking for pOS... no
checking for pthread library... yes
checking for DirectX... no

I don't see any AWK references near the problematic code...

gdb shows this (limited info since sh is a regular release build);

$ gdb /scratch/chroot/pkg_comp/default/bin/sh  sh.core
GNU gdb 5.3nb1
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64--netbsd"...(no debugging symbols found)...
Core was generated by `sh'.
Program terminated with signal 11, Segmentation fault.

warning: current_sos: Can't read pathname for load map: Input/output error

Reading symbols from /lib/libedit.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib/libedit.so.2
Reading symbols from /lib/libtermcap.so.0...(no debugging symbols found)...
done.
Loaded symbols for /lib/libtermcap.so.0
Reading symbols from /lib/libc.so.12...(no debugging symbols found)...done.
Loaded symbols for /lib/libc.so.12
#0  0x0000000000403e5c in exvwarning ()
(gdb) bt
#0  0x0000000000403e5c in exvwarning ()
#1  0x0000000000403f5a in exverror ()
#2  0x0000000000404003 in error ()
#3  0x00000000004146ec in syntax ()
#4  0x00000000004146a3 in testcmd ()
#5  0x000000000040551e in evalcommand ()
#6  0x00000000004046ef in evaltree ()
#7  0x0000000000404792 in evaltree ()
#8  0x000000000040de97 in cmdloop ()
#9  0x000000000040e144 in dotcmd ()
#10 0x000000000040551e in evalcommand ()
#11 0x00000000004046ef in evaltree ()
#12 0x00000000004046e6 in evaltree ()
#13 0x00000000004046a6 in evaltree ()
#14 0x00000000004046e6 in evaltree ()
#15 0x000000000040de97 in cmdloop ()
#16 0x000000000040dc12 in main ()
#17 0x0000000000402aa8 in ___start ()
(gdb) 

Does anyone else see this?

-Olaf.
-- 
___ Olaf 'Rhialto' Seibert      -- You author it, and I'll reader it.
\X/ rhialto/at/xs4all.nl        -- Cetero censeo "authored" delendum esse.