Subject: Building 4.0BETA on 4.0BETA: strange segfaults when doing ./build.sh
To: None <port-i386@netbsd.org>
From: =?ISO-8859-1?Q?Lasse_Hiller=F8e_Petersen?= <lhp@toft-hp.dk>
List: port-i386
Date: 09/10/2006 19:30:28
In my pursuit of a system that will use the Realtek 8168B NIC (aka
RTL8111B) on my motherboard, I have just installed a netbsd-4 snapshot 
from 20060902, and used it to compile netbsd-4 as it checked out today.
(in the meantime I have borrowed a 3COM NIC, so I can work at it 
remotely, and get stuff on it.)

Actually I have tried it a couple of times, and it seems that it is 
build.sh release that blows up at various points.

One of the first times, yesterday, I got this:
...
 /obj/tooldir.NetBSD-4.0_BETA-i386/bin/nbstat -qf '%d,%i %N' | sort  | 
while read devino tzfile; do  destfile=/home/lhp/netbsd-src/ne
tbsd-4/src/obj/destdir.i386/usr/share/zoneinfo/${tzfile#./};  if [ 
"$devino" = "$lastdevino" ]; then  if  ldevino=`/home/lhp/netbsd-
src/netbsd-4/src/obj/tooldir.NetBSD-4.0_BETA-i386/bin/nbstat -qf '%d %i' 
$lastfile` &&  tdevino=`/home/lhp/netbsd-src/netbsd-4/src/o
bj/tooldir.NetBSD-4.0_BETA-i386/bin/nbstat -qf '%d %i' $destfile` &&  [ 
"$ldevino" = "$tdevino" ]; then  continue;  fi;  echo '#  '
"install " $destfile;  echo 
STRIP=/home/lhp/netbsd-src/netbsd-4/src/obj/tooldir.NetBSD-4.0_BETA-i386/bin/i386--netbsdelf-strip 
/home
/lhp/netbsd-src/netbsd-4/src/obj/tooldir.NetBSD-4.0_BETA-i386/bin/nbinstall 
-U -M /home/lhp/netbsd-src/netbsd-4/src/obj/destdir.i386
/METALOG -D /home/lhp/netbsd-src/netbsd-4/src/obj/destdir.i386 -h sha1 
-N /home/lhp/netbsd-src/netbsd-4/src/etc -l h -r $lastfile $d
estfile;  
STRIP=/home/lhp/netbsd-src/netbsd-4/src/obj/tooldir.NetBSD-4.0_BETA-i386/bin/i386--netbsdelf-strip 
/home/lhp/netbsd-src/ne
tbsd-4/src/obj/tooldir.NetBSD-4.0_BETA-i386/bin/nbinstall -U -M 
/home/lhp/netbsd-src/netbsd-4/src/obj/destdir.i386/METALOG -D /home/
lhp/netbsd-src/netbsd-4/src/obj/destdir.i386 -h sha1 -N 
/home/lhp/netbsd-src/netbsd-4/src/etc -l h -r $lastfile $destfile;  else  la
stdevino=$devino;  lastfile=$destfile;  cmp -s $tzfile $destfile 
 >/dev/null 2>&1 && continue; echo '#  ' "install " $destfile;  echo
 STRIP=/home/lhp/netbsd-src/netbsd-4/src/obj/tooldir.NetBSD-4.0_BETA-i386/bin/i386--netbsdelf-strip 
/home/lhp/netbsd-src/netbsd-4/sr
c/obj/tooldir.NetBSD-4.0_BETA-i386/bin/nbinstall -U -M 
/home/lhp/netbsd-src/netbsd-4/src/obj/destdir.i386/METALOG -D 
/home/lhp/netbs
d-src/netbsd-4/src/obj/destdir.i386 -h sha1 -N 
/home/lhp/netbsd-src/netbsd-4/src/etc -c -p -r -o root -g wheel  -m 444 
$tzfile $dest
file;  
STRIP=/home/lhp/netbsd-src/netbsd-4/src/obj/tooldir.NetBSD-4.0_BETA-i386/bin/i386--netbsdelf-strip 
/home/lhp/netbsd-src/netbs
d-4/src/obj/tooldir.NetBSD-4.0_BETA-i386/bin/nbinstall -U -M 
/home/lhp/netbsd-src/netbsd-4/src/obj/destdir.i386/METALOG -D /home/lhp
/netbsd-src/netbsd-4/src/obj/destdir.i386 -h sha1 -N 
/home/lhp/netbsd-src/netbsd-4/src/etc -c -p -r -o root -g wheel  -m 444 
$tzfile
 $destfile;  fi;  done
[1]   Done                    find . -type f -... |
      Done                    xargs /home/lhp/... |
      Broken pipe             sort |
      Segmentation fault (core dumped) while read devin...

*** Failed target:  afterinstall
...

I found a sh.core in src/share/zoneinfo/obj/builddir, in case that is 
useful. I don't know what to do with it myself though, so I would need 
directions.

I then did a complete fresh checkout and update, into /usr/src and 
/usr/xsrc and built that.
build.sh -U tools worked OK. Same did ./build.sh -U -u -x build. But 
./build.sh -U -u -x release gave this error:
...
#   install  /usr/src/obj/destdir.i386/usr/share/man/cat4/dmphy.0
STRIP=/usr/src/obj/tooldir.NetBSD-4.0_BETA-i386/bin/i386--netbsdelf-strip 
/usr/src/obj/tooldir.NetBSD-4.0_BETA-i386/bin/nbinstall -
U -M /usr/src/obj/destdir.i386/METALOG -D /usr/src/obj/destdir.i386 -h 
sha1 -N /usr/src/etc -c -p -r -o root -g wheel -m 444  dmphy
.cat4 /usr/src/obj/destdir.i386/usr/share/man/cat4/dmphy.0
[1]   Segmentation fault (core dumped) (echo "#  " "ins...

*** Failed target:  /usr/src/obj/destdir.i386/usr/share/man/cat4/dpt.0
*** Failed command: cmp -s dpt.cat4 
/usr/src/obj/destdir.i386/usr/share/man/cat4/dpt.0 > /dev/null 2>&1 || 
(echo '# ' "install " /u
sr/src/obj/destdir.i386/usr/share/man/cat4/dpt.0; echo 
"STRIP=/usr/src/obj/tooldir.NetBSD-4.0_BETA-i386/bin/i386--netbsdelf-strip /
usr/src/obj/tooldir.NetBSD-4.0_BETA-i386/bin/nbinstall -U -M 
/usr/src/obj/destdir.i386/METALOG -D /usr/src/obj/destdir.i386 -h sha1
 -N /usr/src/etc -c -p -r -o root -g wheel -m 444 dpt.cat4 
/usr/src/obj/destdir.i386/usr/share/man/cat4/dpt.0" && STRIP=/usr/src/ob
j/tooldir.NetBSD-4.0_BETA-i386/bin/i386--netbsdelf-strip 
/usr/src/obj/tooldir.NetBSD-4.0_BETA-i386/bin/nbinstall -U -M /usr/src/obj
/destdir.i386/METALOG -D /usr/src/obj/destdir.i386 -h sha1 -N 
/usr/src/etc -c -p -r -o root -g wheel -m 444 dpt.cat4 /usr/src/obj/d
estdir.i386/usr/share/man/cat4/dpt.0)
*** Error code 139

Stop.
nbmake: stopped in /usr/src/share/man/man4

...

This time I can't seem to find a core anywhere. I did all this as 
myself, not root, not that I think it matters. I have seen gcc described 
as a great memory tester, but the build completes fine, it is the 
release phase that blows up.

I realise this is still a BETA, but is this seemingly random segfaulting 
related to the software, or is it my hardware?
This is a completely new machine,  Core2 Duo 6300 @ 1.86 GHz, in an 
ASRock ConRoe 945G-DVI motherboard. Kernel is GENERIC.MPACPI.
Could it be defective RAM? Searching the archives indicate that this may 
well be the case. If so, how do I verify that this is in fact the cause? 
I have installed memtester from pkgsrc, and running it right now, but 
although I don't seem to find any errors, I might not be using it 
correctly. (mlock fails for some reason.)

Or is it just that the CPU/motherboard overall is not compatible with 
NetBSD? (I doubt that.)

If all else fails, now that I have the 3COM, I might revert to NetBSD 
3.x and see if everything works there.

Any suggestions would be appreciated. Logs and sh.core can be made 
available by http on request.

-Lasse