[uClibc 0002834]: libc_pthread_init() causes segfault
bugs at busybox.net
bugs at busybox.net
Tue Apr 29 13:59:10 UTC 2008
A NOTE has been added to this issue.
======================================================================
http://busybox.net/bugs/view.php?id=2834
======================================================================
Reported By: hank_le
Assigned To: uClibc
======================================================================
Project: uClibc
Issue ID: 2834
Category: Posix Threads
Reproducibility: always
Severity: major
Priority: normal
Status: feedback
======================================================================
Date Submitted: 04-04-2008 12:08 PDT
Last Modified: 04-29-2008 06:59 PDT
======================================================================
Summary: libc_pthread_init() causes segfault
Description:
Initializing programs that link to libpthread segfault. Simple "Hello
World" program segfaults when linked against libpthread, yet runs fine
without. Attached pthread_test.c won't run.
======================================================================
Relationships ID Summary
----------------------------------------------------------------------
duplicate of 0002264 pthread issues with 0.9.29
======================================================================
----------------------------------------------------------------------
carmelo73 - 04-22-08 08:23
----------------------------------------------------------------------
Please, specify which libpthread implementation you are using
(old or new linuxthreads) ?
----------------------------------------------------------------------
hank_le - 04-24-08 11:07
----------------------------------------------------------------------
Linking to libpthread causes segfaults using NPTL and linuxthreads (new),
but no problems using linuxthreads (old).
----------------------------------------------------------------------
carmelo73 - 04-24-08 22:23
----------------------------------------------------------------------
There is not NPTL implementation for x86, so how can you link against it ?
it doesn't make sense.
Trying using a freshen version to see if the fix in linuxthreads suggested
by Will (that I applied) works or not.
----------------------------------------------------------------------
hank_le - 04-28-08 13:32
----------------------------------------------------------------------
I grabbed a buildroot snapshot from 2008-04-25 and rebuilt everything using
my oritional .config (uClibc-0.9.29, NPTL/linuxthreads,gcc-4.2.1,
binutils-2.18) and my pthread_test.c still segfaults. I need to re-verify
all the versions to be sure.
BTW, for my x86 target, I "chose" NPTL in the menuconfig, but it seems
that linuxthreads is actually used (a little misleading). Sorry for the
confusion.
----------------------------------------------------------------------
hank_le - 04-29-08 06:59
----------------------------------------------------------------------
Ok, I grabbed the latest buildroot snapshot (20080429), and configured for
uClibc-snapshot, linuxthreads,gcc-4.2.1, andbinutils-2.18. The build gets
as far as gcc, and I get the following error:
make[2]: Entering directory
`/home/leinhos/src/buildroot-20080429/toolchain_build_i586/gcc-4.2.1-initial/gcc'
/home/leinhos/src/buildroot-20080429/toolchain_build_i586/gcc-4.2.1-initial/./gcc/xgcc
-B/home/leinhos/src/buildroot-20080429/toolchain_build_i586/gcc-4.2.1-initial/./gcc/
-B/home/leinhos/src/buildroot-20080429/build_i586/staging_dir/usr/i586-linux-uclibc/bin/
-B/home/leinhos/src/buildroot-20080429/build_i586/staging_dir/usr/i586-linux-uclibc/lib/
-isystem
/home/leinhos/src/buildroot-20080429/build_i586/staging_dir/usr/i586-linux-uclibc/include
-isystem
/home/leinhos/src/buildroot-20080429/build_i586/staging_dir/usr/i586-linux-uclibc/sys-include
-O2 -g -Os -DIN_GCC -DCROSS_COMPILE -W -Wall -Wwrite-strings
-Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem
./include -I. -I.
-I/home/leinhos/src/buildroot-20080429/toolchain_build_i586/gcc-4.2.1/gcc
-I/home/leinhos/src/buildroot-20080429/toolchain_build_i586/gcc-4.2.1/gcc/.
-I/home/leinhos/src/buildroot-20080429/toolchain_build_i586/gcc-4.2.1/gcc/../include
-I/home/leinhos/src/buildroot-20080429/toolchain_build_i586/gcc-4.2.1/gcc/../libcpp/include
-I/home/leinhos/src/buildroot-20080429/toolchain_build_i586/gmp/include
-I/home/leinhos/src/buildroot-20080429/toolchain_build_i586/mpfr/include
-I/home/leinhos/src/buildroot-20080429/toolchain_build_i586/gcc-4.2.1/gcc/../libdecnumber
-I../libdecnumber -g0 -finhibit-size-directive -fno-inline-functions
-fno-exceptions -fno-zero-initialized-in-bss -fno-toplevel-reorder
-fno-omit-frame-pointer \
-c
/home/leinhos/src/buildroot-20080429/toolchain_build_i586/gcc-4.2.1/gcc/crtstuff.c
-DCRT_BEGIN \
-o crtbegin.o
In file included from
/home/leinhos/src/buildroot-20080429/toolchain_build_i586/uClibc_dev//usr/include/bits/uClibc_stdio.h:119,
from
/home/leinhos/src/buildroot-20080429/toolchain_build_i586/uClibc_dev//usr/include/stdio.h:72,
from
/home/leinhos/src/buildroot-20080429/toolchain_build_i586/gcc-4.2.1/gcc/tsystem.h:90,
from
/home/leinhos/src/buildroot-20080429/toolchain_build_i586/gcc-4.2.1/gcc/crtstuff.c:68:
/home/leinhos/src/buildroot-20080429/toolchain_build_i586/uClibc_dev//usr/include/bits/uClibc_mutex.h:15:21:
error: pthread.h: No such file or directory
In file included from
/home/leinhos/src/buildroot-20080429/toolchain_build_i586/uClibc_dev//usr/include/bits/uClibc_mutex.h:16,
from
/home/leinhos/src/buildroot-20080429/toolchain_build_i586/uClibc_dev//usr/include/bits/uClibc_stdio.h:119,
from
/home/leinhos/src/buildroot-20080429/toolchain_build_i586/uClibc_dev//usr/include/stdio.h:72,
from
/home/leinhos/src/buildroot-20080429/toolchain_build_i586/gcc-4.2.1/gcc/tsystem.h:90,
from
/home/leinhos/src/buildroot-20080429/toolchain_build_i586/gcc-4.2.1/gcc/crtstuff.c:68:
/home/leinhos/src/buildroot-20080429/toolchain_build_i586/uClibc_dev//usr/include/bits/uClibc_pthread.h:27:3:
error: #error "Always include <pthread.h> rather than
<bits/uClibc_pthread.h>"
make[2]: *** [crtbegin.o] Error 1
make[2]: Leaving directory
`/home/leinhos/src/buildroot-20080429/toolchain_build_i586/gcc-4.2.1-initial/gcc'
make[1]: *** [all-gcc] Error 2
make[1]: Leaving directory
`/home/leinhos/src/buildroot-20080429/toolchain_build_i586/gcc-4.2.1-initial'
make: ***
[/home/leinhos/src/buildroot-20080429/toolchain_build_i586/gcc-4.2.1-initial/.compiled]
Error 2
Issue History
Date Modified Username Field Change
======================================================================
04-04-08 12:08 hank_le New Issue
04-04-08 12:08 hank_le Status new => assigned
04-04-08 12:08 hank_le Assigned To => uClibc
04-04-08 12:08 hank_le File Added: pthread_test.c
04-19-08 23:00 carmelo73 Relationship added duplicate of 0002264
04-22-08 08:23 carmelo73 Note Added: 0006974
04-24-08 11:07 hank_le Note Added: 0007054
04-24-08 22:23 carmelo73 Note Added: 0007104
04-24-08 22:29 carmelo73 Status assigned => feedback
04-28-08 13:19 hank_le Note Added: 0007284
04-28-08 13:32 hank_le Note Edited: 0007284
04-29-08 06:59 hank_le Note Added: 0007304
======================================================================
More information about the uClibc-cvs
mailing list