Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

Debugging ld.so

From: Kurt Miller <truk(at)optonline.net>
Date: Sat Jun 07 2003 - 23:39:42 EDT


I could use some pointers on how to debug a segfault in ld.so on i386 -current (as of last night). I'm trying (so far in vain) to figure out a
problem with devel/jdk/1.2 in -current. javac segfaults before it reaches the main function. niklas@ gave me some pointers on how to track down problems in ld.so, but I've kind of hit the wall and can't make any more progress...

Using DL_DEB statements in the _dl_boot function in libexec/ld.so : loader.c, I know that the segfault is happening while executing line 365/366:

(*(void (*)(Elf_Addr))(sym->st_value + ooff))

    ((Elf_Addr)_dl_dtors);

The comments and code indicate this code calls the atexit function. I placed printf statements in the atexit function of libc/stdlib/atexit.c (don't do this at home), however I never reach them while attempting to execute javac_g. (I did see my printf all over while executing other stuff and I would not recommend doing it at least not without a backup of libc).

OK, at this point I'm a bit perplexed because I expected to see the printf's I added to libc/stdlib/atexit.c, but I didn't. However, I know something is being executed by lines 365/366 in loader.c because DL_DEB statements are being output from dlopen:

calling atexit - (before line 365 of loader.c) dlopen: loading: libc.so
linking dep /usr/lib/libc.so.30.0 as child of /usr/ports/devel/jdk/1.2/w-jdk-1.2.2/build/bsd/bin/i386/green_threads/javac_ g
dlopen returning: already loaded (at line 72 of dlfcn.c)

Program received signal SIGSEGV, Segmentation fault. 0x0 in ?? ()
(gdb)

Do you need help?X

So I'm stuck. Something is being executed but I don't know what. I haven't been able to put a breakpoint in using gdb because all of this happens before the main function of javac_g. Is there a way I can halt execution and step through this code? or Would someone enlighten me as to what is being executed by line 365/366 so I can continue using DL_DEB or printf's to figure this out? Any assistance, RTFM or flames welcome ;-)

Thanks,
-Kurt Received on Mon Jul 7 12:00:41 2003

This archive was generated by hypermail 2.1.8 : Wed Aug 23 2006 - 13:48:42 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library