Subject: SIGILL with pthreads on netbsd-4
To: None <port-mac68k@NetBSD.org>
From: Paul Ripke <stix@stix.id.au>
List: port-mac68k
Date: 10/30/2006 11:48:54
Now that I've got my netbsd-mac68k system up and running again, I've
been testing some home-grown pthread code, and it appears to not be
100% stable. The code works fine under other netbsd architectures I've
tested (i386, sparc) but gets SIGILL occassionally on mac68k. The
program below only has two threads, so to my eye something is causing
the PC to take a flying leap to nowhere. Any ideas on where I can look?

FYI: running "./fblckgen -ab 1k -c 0 > /dev/null" works fine, since it
appears to only allocate the one LWP, due to the m:n thread model.

kitt:ksh$ ./fblckgen -ab 1k -c 0 | compress > /dev/null
Illegal instruction (core dumped)
kitt:ksh$ gdb fblckgen fblckgen.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 "m68k--netbsdelf"...
Core was generated by `fblckgen'.
Program terminated with signal 4, Illegal instruction.
Reading symbols from /usr/lib/libpthread.so.0...done.
Loaded symbols for /usr/lib/libpthread.so.0
Reading symbols from /usr/lib/libc.so.12...done.
Loaded symbols for /usr/lib/libc.so.12
Reading symbols from /usr/libexec/ld.elf_so...done.
Loaded symbols for /usr/libexec/ld.elf_so
#0  0x043ffbe4 in ?? ()
(gdb) thr app all bt

Thread 3 (Thread 22 ()):
#0  0x04023174 in pthread__locked_switch () from /usr/lib/libpthread.so.0
#1  0x06bffb70 in ?? ()
#2  0x040283b2 in pthread_cond_wait () from /usr/lib/libpthread.so.0
#3  0x00003548 in makeBlocks (dummy=0x0) at fblckgen.c:234
#4  0x040296ec in pthread_create () from /usr/lib/libpthread.so.0

Thread 2 (LWP 2):
#0  0x040584c2 in write () from /usr/lib/libc.so.12
#1  0x04022fca in write () from /usr/lib/libpthread.so.0
#2  0x000031be in main (argc=1024, argv=0x0) at fblckgen.c:179

Thread 1 (LWP 1):
#0  0x043ffbe4 in ?? ()
#0  0x043ffbe4 in ?? ()

Cheers,
-- 
Paul Ripke