Search code examples
gdbshared-librariescoredumpdebug-symbolsbacktrace

Is it possible to get the backtrace in the case where "No shared libraries loaded at this time"?


I'm getting "No shared libraries loaded at this time", when I give "info share" command and I also loaded the symbol file and core on gdb. But generally the coredump should be loaded with the shared libs as per its corresponding application. I have specified the solib-search-path where GDB will look for shared libraries when searching for symbols.

Is it possible to get the backtrace in the case where "No shared libraries loaded at this time"?

gdb>info sharedlibrary
No shared libraries loaded at this time.
gdb> bt
#0  0xb6d1f232 in ?? ()
#1  0xb6d25ddc in ?? ()
#2  0xb6d25ddc in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thanks a lot, in advance.


Solution

  • I'm getting "No shared libraries loaded at this time"

    The most frequent cause: binary mismatch.

    Let's define host as the machine where you are running GDB, and target as the machine on which the core dump happened.

    • If host == target, you may have given GDB the main executable that does not match the executable that crashed, or
    • system libraries (and libc in particular) have been updated, or
    • host != target and system libraries differ between host and target.

    I have specified the solib-search-path

    Specifying solib-search-path after you loaded the core doesn't work. Do this instead:

    gdb ./a.out
    (gdb) set solib-search-path /path/to/libs
    (gdb) core core  # load core *after* setting solib-search-path
    

    Using set verbose on may help show exactly which libraries GDB is trying to load (if any).