[Ltrace-devel] How can I definitely relate a library call to a library file?

Uwe Galle uga at domestic.de
Tue Feb 12 22:32:23 UTC 2008


Hi,

I didn't find an answer in a FAQ or with a web search so I want to post
it here.

My procinfo (version 18) crashes with a "[Floating point exception]".
ldd shows me the following dynamic link libraries:

        linux-gate.so.1 =>  (0xffffe000)
        libncurses.so.5 => /lib/libncurses.so.5 (0xb7f46000)
        librt.so.1 => /lib/librt.so.1 (0xb7f3d000)
        libc.so.6 => /lib/libc.so.6 (0xb7e0a000)
        libdl.so.2 => /lib/libdl.so.2 (0xb7e06000)
        libpthread.so.0 => /lib/libpthread.so.0 (0xb7def000)
        /lib/ld-linux.so.2 (0xb7f8f000)

Now I invoked "ltrace --indent 10 -o trace-indent-S.txt -Si procinfo -f"
and got the lines, inter alia:

...
[0xb7f08c74] SYS_open("/lib/libc.so.6", 0, 077300)         = 3
[0xb7f08cf4] SYS_read(3, "\177ELF\001\001\001", 512)       = 512
[0xb7f08c3e] SYS_fstat64(3, 0xbff90020, 0xb7f0eff4, 15, 0xb7f0f670) = 0
[0xb7f09273] SYS_mmap2(0, 0x1325f0, 5, 2050, 3)            = 0xb7d6f000
[0xb7f08ef9] SYS_fadvise64(3, 0, 0, 0x1325f0, 3)           = 0
[0xb7f09273] SYS_mmap2(0xb7e9c000, 12288, 3, 2066, 3)      = 0xb7e9c000
[0xb7f09273] SYS_mmap2(0xb7e9f000, 9712, 3, 50, -1)        = 0xb7e9f000
[0xb7f08cad] SYS_close(3)                                  = 0
... (many other lines)
[0xffffe410] SYS_set_tid_address(0xb7d52708, 0xb7d67ff4, 2, 0xb7d526c0,
0) = 21774
[0xffffe410] SYS_set_robust_list(0xb7d52710, 12, 0xb7d67ff4, 0xb7d526c0,
0) = 0
[0xffffe410] SYS_rt_sigaction(32, 0xbff90568, 0, 8, 0xb7d67ff4) = 0
[0xffffe410] SYS_rt_sigaction(33, 0xbff90568, 0, 8, 0xb7d67ff4) = 0
[0xffffe410] SYS_rt_sigprocmask(1, 0xbff90820, 0, 8, 0xb7d67ff4) = 0
[0xffffe410] SYS_ugetrlimit(3, 0xbff908a8, 0xb7e9dff4, 16, 1) = 0
[0xffffe410] SYS_uname(0xbff9061c)                         = 0
[0x8049521] __libc_start_main(0x804da50, 2, 0xbff90954, 0x8050510,
0x8050500 <unfinished ...>

The logged sequence of calls is interrupted on the indent level of
__libc_start_main so it seems to be this function what crashes. Of
course, the name __libc_start_main let me suggest that this call should
be contained in /lib/libc.so.6. But what puzzles me is the difference of
the IP before __libc_start_main and after /lib/libc.so.6. On my system
there is no man page for ldd so that I assume that (0xb7e0a000) in the
ldd output is the address where /lib/libc.so.6 is loaded. So I still
don't know if /lib/libc.so.6 is the faulting library. Some explanations
or a detailed resource are very welcome. Note that I am an administrator
so that I lack some programming details.

Thanks



More information about the Ltrace-devel mailing list