Search code examples
linuxlibcbacktrace

How can I check the version of ld-linux.so.2?


Recently I hit a crash with the backtrace in the following:

gdb) bt
#0  0x41447f48 in do_lookup_x () from /auto/andpkg/rep_cache/wr-x86/3.0FCS/sysroot/lib/ld-linux.so.2
#1  0x4144821f in _dl_lookup_symbol_x () from /auto/andpkg/rep_cache/wr-x86/3.0FCS/sysroot/lib/ld-linux.so.2
#2  0x4144c4cb in _dl_fixup () from /auto/andpkg/rep_cache/wr-x86/3.0FCS/sysroot/lib/ld-linux.so.2
#3  0x41452020 in _dl_runtime_resolve () from /auto/andpkg/rep_cache/wr-x86/3.0FCS/sysroot/lib/ld-linux.so.2
#4  0xf4553f44 in free_thread_specific (arg=0x92ce390) at ../infra/med/med_intf.c:4346
#5  0x415c3007 in __nptl_deallocate_tsd () from /auto/andpkg/rep_cache/wr-x86/3.0FCS/sysroot/lib/libpthread.so.0
#6  0x415c414e in start_thread () from /auto/andpkg/rep_cache/wr-x86/3.0FCS/sysroot/lib/libpthread.so.0
#7  0x415278ce in clone () from /auto/andpkg/rep_cache/wr-x86/3.0FCS/sysroot/lib/libc.so.6

I have no clue on how to debug from frame 4, so I start googling do_lookup_x, _dl_lookup_symbol_x in the first several frames, and found that it could be an existing bug in ld-linux.so.2. So I want to get the version number of this .so file. Can someone help me? Thanks!


Solution

  • From the Linux from Scratch (LFS) Host System Requirements document,

    ldd --version | head -n1 | cut -d" " -f2-  # glibc version
    

    When I run that on my present machine, it outputs

    $ ldd --version | head -n1 | cut -d" " -f2-
    (Ubuntu EGLIBC 2.19-0ubuntu6.1) 2.19