strace 'open' calls in a library of an executable

I have a program with no source code.

When I run it, I have a "Can't open file..." error in the logs.

I called strace to trace the open calls on the kernel, in that way:

strace -e trace=open,close,read,write,connect,accept your-command-here

However, it seems there is none of the open calls I am expecting (that shall happen before that the log says "Can't open file...")

The executable indeed delegated the open call to a tierce library. It seems that strace only trace the calls from the executable on the kernel, not those of the libraries depencies.

I tried to use ltrace to trace what happens in the subsequent libraries, but it doesnt display the same informations as strace, only the function calls (which are not human-readable).

Is there a way to run strace on the executable and the libraires in the same time ?

 

 

strace should be showing all of the open calls. However:

  • Perhaps your application calls a subprocess to do work. For that case, you can add a -foption.
  • On the other hand, it may be doing the work by opening a socket (or similar) connection to another process. For that case, you will not see any trace. Likewise, if you are using the sysloginterface, then the actual work may be done outside your process, potentially in the kernel where you cannot trace with this tool.
發佈了455 篇原創文章 · 獲贊 894 · 訪問量 233萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章