[PATCHv4] print stack trace after each syscall

Masatake YAMATO yamato at redhat.com
Tue Sep 17 10:52:49 UTC 2013

In the patch `delete_mmap_cache' is used as a trigger for updating
proc/maps info cache.  It is called as expected when mmap and friends
are traced.  However, if the tracing is disabled with -e option, strae
misses the chance to updating the info cache.

Here is the example:

    $ LD_LIBRARY_PATH=/usr/local/lib ./strace  -e read,mmap -k ps  > /dev/null
    read(6, "Name:\tps\nState:\tR (running)\nTgid"..., 1023) = 888
     > /usr/lib64/libc-2.16.so(__read_nocancel+0x7) [0xe5790]
     > /usr/lib64/libprocps.so.0.0.1(file2str.constprop.2+0x63) [0x7f73]
     > /usr/lib64/libprocps.so.0.0.1(simple_readproc+0x316) [0x8786]
     > /usr/lib64/libprocps.so.0.0.1(readproc+0xea) [0x8a0a]
     > /usr/bin/ps(main+0x7b9) [0x2aa9]
     > /usr/lib64/libc-2.16.so(__libc_start_main+0xf5) [0x21a05]
     > /usr/bin/ps(deregister_tm_clones+0x1d) [0x2bed]

    $ LD_LIBRARY_PATH=/usr/local/lib ./strace  -e read -k ps  > /dev/null
    read(6, "Name:\tps\nState:\tR (running)\nTgid"..., 1023) = 888
     > backtracing_error

If -k option is given, mmap and friends must be traced to update the
cache info.

...Sorry but a patch for fixing it is not included here.

Masatake YAMATO

More information about the Strace-devel mailing list