Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 201376 - sys-libs/glibc[profile]: programs linked with -lc_p always segfault early
Summary: sys-libs/glibc[profile]: programs linked with -lc_p always segfault early
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High major (vote)
Assignee: Gentoo Toolchain Maintainers
URL: https://sourceware.org/bugzilla/show_...
Whiteboard:
Keywords:
: 236524 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-12-05 16:43 UTC by Jeffrey Graham
Modified: 2015-08-21 21:19 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jeffrey Graham 2007-12-05 16:43:26 UTC
Added use flag profile to /etc/make.conf and re-emerged glibc 2.6.1 to get libc_p.a

Built my app and linked it against libc_p.a like this:
gcc test.c -g -pg -O0 -o test -static -lc_p

The program segfaults. The debugger reports this:
Program received signal SIGSEGV, Segmentation fault.
0x08083aeb in __mcount_internal().


This bug has been reported to other distributions...
http://people.debian.org/~terpstra/message/20070917.132524.9ab97a81.en.html



Reproducible: Always
Comment 1 SpanKY gentoo-dev 2008-09-07 06:39:36 UTC
*** Bug 236524 has been marked as a duplicate of this bug. ***
Comment 2 SpanKY gentoo-dev 2008-12-27 10:32:58 UTC
still happens with glibc-2.9 :/

$ gcc test.c -g -pg -O0 -o test -static -lc_p
$ gdb ./test
(gdb) r
Starting program: /home/vapier/test

Program received signal SIGSEGV, Segmentation fault.
0x000000000042fecb in __mcount_internal ()
(gdb) bt
#0  0x000000000042fecb in __mcount_internal ()
#1  0x000000000040dc04 in mcount ()
#2  0x0000000000000000 in ?? ()
(gdb)
Comment 3 SpanKY gentoo-dev 2008-12-27 22:02:32 UTC
Debian bug report (not that it has any info):
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=506850

the crash seems to be because mcount uses atomic code which relies on the TLS descriptors being setup, but that doesnt happen until __libc_start_main.  but since __libc_start_main itself calls mcount, we crash.

at any rate, moved upstream