Search code examples
gdbshared-libraries

What is the Read column of 'info sharedlibrary' indicating?


Here is some output. I have found the gdb manual but the sharedlibrary information doesn't explain what the columns of the output mean. Can someone tell me what the Read column indicates and what it means for the rows that have an (*)? I'm trying to debug on rhel8 why there are two instances of libcrypto being read.

(gdb) info sharedlibrary
From                To                  Syms Read   Shared Object Library
0x00007fffe91d53d0  0x00007fffe91df040  Yes (*)     /lib64/libcrypto.so.1.1
0x00007fffe8f52380  0x00007fffe8fad973  Yes (*)     /lib64/libpcre2-8.so.0
0x00007fffe8c93700  0x00007fffe8e09a03  Yes         /data/repos/ext/lib/linux/64/libcrypto.so.1.0.0
0x00007fffe8bbc870  0x00007fffe8c0c670  Yes         /data/repos/ext/lib/linux/64/libssl.so.1.0.0

Solution

  • what it means for the rows that have an (*)?

    There should be a line following the output you showed which explains that:

    (*): Shared library is missing debugging information.
    

    These libraries have a .gnu_debuglink section suggesting that the (separate) debug info for them should be available, but that info is not present on the current system, or there is a mismatch between the version of the library itself and the debug info file that is available.

    I'm trying to debug on rhel8 why there are two instances of libcrypto being read.

    You are loading different versions of libcrypto: libcrypto.so.1.1 and libcrypto.so.1.0.0. This is almost guaranteed to cause crashes of memory corruption.

    This is happening because one of your ELF images (perhaps the main binary) requires libcrypto.so.1.1, and another one requires libcrypto.so.1.0.0.

    You can see what each of the binary needs by using this command:

    readelf -d ./a.out | grep NEEDED
    

    Alternatively, using LD_DEBUG=files ldd ./a.out should also show which binary wants which version of libcrypto.