LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   why are my apps using the wrong thread library? (https://www.linuxquestions.org/questions/linux-software-2/why-are-my-apps-using-the-wrong-thread-library-413263/)

dombrowsky 02-08-2006 10:17 PM

why are my apps using the wrong thread library?
 
Almost all of my gnome apps are dying. I look at the stacktraces, and for all the ones I've checked, they start by referencing the wrong thread library:

Code:

Backtrace was generated from '/usr/glibc2/opt/bin/gnome-background-properties'

Using host libthread_db library "/lib/tls/libthread_db.so.1".
0x40beeb98 in waitpid () from /usr/glibc2/lib/libpthread.so.0
#0  0x40beeb98 in waitpid () from /usr/glibc2/lib/libpthread.so.0
#1  0x4011be70 in ?? () from /usr/glibc2/opt/lib/libgnomeui-2.so.0
#2  0x400d7e25 in libgnomeui_segv_handle () from /usr/glibc2/opt/lib/libgnomeui-2.so.0
#3  0x40bed469 in __pthread_sighandler () from /usr/glibc2/lib/libpthread.so.0
#4  <signal handler called>
#5  0x40c5c581 in kill () from /usr/glibc2/lib/libc.so.6
#6  0x40be9f55 in pthread_kill () from /usr/glibc2/lib/libpthread.so.0
#7  0x40bea2e0 in raise () from /usr/glibc2/lib/libpthread.so.0
#8  0x40c5c199 in raise () from /usr/glibc2/lib/libc.so.6
#9  0x40c5d802 in abort () from /usr/glibc2/lib/libc.so.6
#10 0x409f6b10 in g_logv () from /usr/glibc2/opt/lib/libglib-2.0.so.0
#11 0x409f6b49 in g_log () from /usr/glibc2/opt/lib/libglib-2.0.so.0
#12 0x409f6c9c in g_return_if_fail_warning () from /usr/glibc2/opt/lib/libglib-2.0.so.0
#13 0x0804cc39 in gnome_wp_capplet_scroll_to_item ()
#14 0x0804df4b in gnome_wp_load_stuffs ()
#15 0x409ef3b1 in g_idle_dispatch () from /usr/glibc2/opt/lib/libglib-2.0.so.0
#16 0x409ece3c in g_main_context_dispatch () from /usr/glibc2/opt/lib/libglib-2.0.so.0
#17 0x409f022b in g_main_context_iterate () from /usr/glibc2/opt/lib/libglib-2.0.so.0
#18 0x409f0547 in g_main_loop_run () from /usr/glibc2/opt/lib/libglib-2.0.so.0
#19 0x403341d1 in gtk_main () from /usr/glibc2/opt/lib/libgtk-x11-2.0.so.0
#20 0x08050470 in main ()

It SAYS it's using the lib in /lib/tls, which it shouldn't be. It should be using the threads library compiled with glibc. Does anyone know what's going wrong here? Should I recompile glibc?

dombrowsky 02-11-2006 08:15 PM

I'm in the process of recompiling everything with the env variable LD_LIBRARY_PATH set to point to the new libraries. I thought this wasn't needed, becuase the gcc I'm using automatically links to new glibc and new libraries. Perhaps this wasn't enough to force it to use new libs. I'll post more once I find out if it works or not.

foo_bar_foo 02-11-2006 10:09 PM

well i mean the libthread_db.so.1 is just the debugging thing
for after it already goes bad i think
so yea it tries to initialize the one in /lib/tls first
cause thats just the way the beguhher works
and the thing is it appears to work fine cause it hunts through the problem.
/lib/tls is a distribution added hack to glibc.

if you are using new glibc and gnome is compiled against the old one
OOPS

LD_LIBRARY_PATH works only for the loader not the linker i think
in a twist of confusion for linking you should use LD_RUN_PATH
as in RUN_LD or "run the native linker" not run an executable or library.
man ld says LD_RUN_PATH is used just like -rpath-link. so it specifies directories to look first for secondary libs used by the libs mentioned in -l flags. glibc would be one of those for shure

proper way might be to just use -L for linking
ld searches -L option first and in order before defaults.
plus -rpath-link option or LD_RUN_PATH.

and for runtime make sure you have LD_LIBRARY_PATH set


All times are GMT -5. The time now is 08:36 AM.