This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
linking experimental patch
- From: Janne Karhunen <jkarhune at redhat dot com>
- To: libc-alpha at sources dot redhat dot com
- Date: Tue, 18 Mar 2008 12:48:42 -0400
- Subject: linking experimental patch
Hi,
I just did a experimental patch that would add threading support to
libc backtrace API. This would add something along the lines of:
extern int backtrace_thread (void **__array, int __size, void* __fp);
to execinfo.h. In addition to this the patch would add an option to
libsegfault to use this, ie. upon crash task would be forked and
the parent task stopped to backtrace all threads the task had.
While it would definitely be better not to fork a broken task and
just freeze all threads one by one and make the dump internally,
Linux does not seem to have proper support for this. Even ptrace
interface doesn't support stopping internal threads anymore. Same
goes for SIGSTOP processing; there simply are no clean ways to
make it thread specific (as far as I know).
That being said, I have hard time following libc's linking magic.
Linking of new libsegfault bails out stating;
../build/debug/libSegFault_pic.a(segfault.os): In function `dump_thread':
../debug/../debug/segfault.c:166: undefined reference to `backtrace_thread'
Looking at the libc dynamic part we have:
nm /home/makarhun/work/glibc/F-8/glibc-20071017T2029/build/libc.so | ..
00000000000d43d0 t __GI___backtrace_thread
00000000000d43d0 t __backtrace_thread
00000000000d43d0 t backtrace_thread
Added functions are being made local. I take it this is due to
symbol versioning magic? Weak symbols seem to be missing as well
even though they are defined in the code.
--
// Janne