strace in linux

garryjp

New Member
Joined
Mar 29, 2022
Messages
10
Reaction score
0
Credits
89
If a user or system process seems to be stuck. When attaching strace to the process, i see strace shows an unfinished system call. What could this mean?

When and why would using strace be a poor choice while debugging an issue of this type?
 


N

NorthWest

Guest
It would likely help if you posted the strace output including the lines before and after the "unfinished" system call so that more information is available. The strace output can be so voluminous, it's hard to know just how much to reproduce so that the viewer can draw useful conclusions. That's a matter of judgement.

The "unfinished" system call could mean a number of things, primary among them that the code in the program making the system call has not provided the variables or their values the program is dealing with which are needed to complete the system call.

The use of strace is basically the next best approach to debugging if one doesn't have the source code of the calling program because strace will record all of the steps the calling program makes of the system.
 

needafatima

New Member
Joined
May 19, 2022
Messages
3
Reaction score
5
Credits
37
Strace is one of the most powerful process monitoring, diagnostic, instructional tool of Linux. It also acts as a debugging tool that helps in troubleshooting issues.

If a system call is being executed and meanwhile another one is being called from a different thread/process then strace will try to preserve the order of those events and mark the ongoing call as being unfinished. When the call returns it will be marked as resumed.

Other call is executed by another process, while the kernel is executing current system call.

Strace can be a poor choice when:-

  • Strace causes the process it is attached with it to pause, thus leading to performance overhead. In worst case slowing the target application
  • Cannot trace multiple processes simultaneously.
  • Visibility is limited to system call interface.
But it is a good debugging tool because trouble shooters invaluable for solving problems with programs for which source is not readily available.
Screenshot from 2022-04-22 16-02-26[10424].png
Screenshot 2022-04-22 161447[10423] (1).png
 
Last edited:
$100 Digital Ocean Credit
Get a free VM to test out Linux!


Top