strange segfault with pthreads in 0.9.28

Dr. Rupert Mazzucco rmaz at gmx.net
Sun May 14 20:02:40 UTC 2006


I'm trying to build a uClibc-based VIA Epia system, and all went well until I ran into a problem building glib - its configure script wouldn't detect posix thread support. And true enough, config.log showed that the test program died with a segmentation violation.

Then I found that this didn't have to do with details of actual thread support, but simply linking something with -lpthread causes the app to segfault.  A minimal reproduction is below.  Does anybody have an idea what could be causing this?

Thanks,
Rupert

# cat > foo.c
int main() {}
# gcc foo.c
# ./a.out
# gcc foo.c -lpthread
# ./a.out
Segmentation fault
# ldd a.out
        libpthread.so.0 => /lib/libpthread.so.0 (0x40008000)
        libc.so.0 => /lib/libc.so.0 (0x4001a000)
        ld-uClibc.so.0 => /lib/ld-uClibc.so.0 (0x40000000)
# gcc -D_REENTRANT foo.c -lpthread
# ./a.out
Segmentation fault
# gcc -v
Reading specs from /pkg/tools/lib/gcc/i686-linux-uclibc/3.4.6/specs
Configured with: ../buildroot/toolchain_build_i686/gcc-3.4.6/configure --host=i686-linux-uclibc --prefix=/pkg/tools --enable-shared --enable-threads --disable-nls --with-arch=c3 --with-sysroot=/pkg/uClibc-0.9.28 --enable-languages=c,c++,f77 --disable-__cxa_atexit

(uClibc built with kernel headers from 2.6.16, buildroot snapshot 20060418)



More information about the uClibc mailing list