On Sun, 29 Mar 2009 09:30:05 +0000 Andrew Doran <a...@netbsd.org> wrote:
> Module Name: src > Committed By: ad > Date: Sun Mar 29 09:30:05 UTC 2009 > > Modified Files: > src/lib/libpthread: pthread.c > src/lib/libpthread/arch/i386: pthread_md.c pthread_md.h > > Log Message: > - Make the threadreg code use _lwp_setprivate() instead of MD hooks. > > XXX This must not be enabled by default because the LWP private mechanism > is reserved for TLS. It is provided only as a test/demo. > > XXX Since ucontext_t does not contain the thread private variable, for a > short time after threads are created their thread specific data is unset. > If a signal arrives during that time we are screwed. > > - No longer need pthread__osrev. > > - Rearrange _lwp_ctl() calls slightly. Hi, I have problems with pthread using applications crashing on startup after this change (both on i386 and amd64). Am I the only one? Simple "hello, world" compiled with -pthread: Starting program: /tmp/test Program received signal SIGSEGV, Segmentation fault. 0x00007f7ffd98ac4a in free () from /usr/lib/libc.so.12 (gdb) bt #0 0x00007f7ffd98ac4a in free () from /usr/lib/libc.so.12 #1 0x00007f7ffd98bdcd in posix_memalign () from /usr/lib/libc.so.12 #2 0x00007f7ffd98c3eb in malloc () from /usr/lib/libc.so.12 #3 0x00007f7ffd9e443b in __smakebuf () from /usr/lib/libc.so.12 #4 0x00007f7ffd9e42a5 in __swsetup () from /usr/lib/libc.so.12 #5 0x00007f7ffd9e3d25 in __sfvwrite () from /usr/lib/libc.so.12 #6 0x00007f7ffd9a4869 in puts () from /usr/lib/libc.so.12 #7 0x000000000040092e in main () at test.c:3 (gdb) Backing out the change makes things work again. Kind regards, -Tobias