ltrace icon indicating copy to clipboard operation
ltrace copied to clipboard

attaching ltrace to a process started with LD_PRELOAD does not recognize -x filter

Open gonber opened this issue 9 years ago • 0 comments

I want to test a library mylib.so that is to be used in LD_PRELOAD. To test that certain functions in the library are being called I run

# LD_PRELOAD=mylib.so ltrace -CLx *opendir*@mylib.so python
>>> import os
>>> os.listdir(".")
[email protected]("." <unfinished ...>
(...)

However I'd prefer to operate in attached mode. Something like

# ltrace -CLx *opendir*@mylib.so -p <pid>

If I start python with LD_PRELOAD in a separate shell and give the correct pid to ltrace I do not get any output from ltrace.

Interestingly this works

# ltrace -Ce *opendir* -p <pid>
exe->opendir(".") = 0x22bcb00

Do you have any idea of what's going on?

gonber avatar Oct 07 '16 09:10 gonber