I'm trying to monitor library calls system-wide. I've written this script to trace library calls for libguestfs:

probe begin {
probe process("/usr/lib64/libguestfs.so.0.471.0").function("*") {

Afterwards, I save it as test.stp and run "sudo stap test.stp". I needed some process which uses these function calls so I can intercept them. Therefore, I used a simple program called libguestfs-test-tool which is a part of libguestfs package. IT SEGFAULTS! It does not segfault if I don't run stap.

So basically I have two questions:

1- Why is this happening? Have I done something wrong?

2- I need to use the ltrace functionality, but system-wide. For every library call, I need to get the top-level API called along with the pid of the process which called this function. I tried using stap but seems it has some instability problems... Do you have any alternatives for me?

p.s: I use CentOS 7 with kernel

  • 1
    Have you poked at the core which you can dump on a segmentation fault to see what happened at all? – DopeGhoti Jun 4 '18 at 21:55
  • Program received signal SIGILL, Illegal instruction. 0x00007ffff7df498b in munmap () at ../sysdeps/unix/syscall-template.S:81 81 T_PSEUDO (SYSCALL_SYMBOL, SYSCALL_NAME, SYSCALL_NARGS) – MoeKav Jun 4 '18 at 23:23
  • I suspect the function("*") all function trace may be problematical perhaps due to threading where the delays caused by systemtap doing its work creates a condition where the library-using code fails. – thrig Jun 7 '18 at 13:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.