October 28, 2003

Debugging with strace

In an ideal world, whenever a program cannot perform a function it exits with a useful error message, giving you enough clues to fix the problem.
Unfortunately, we do not live in an ideal world -- at least, not all the time. Sometimes when an application encounters an error, you are none the
wiser.

This is where debugging tools come in. One tool I cannot live without is called strace which is a system call tracer. You can trace calls made by a
program that is already running (bind strace to an existing PID) or you can tell strace to start a process to examine.

Let me demonstrate the use of strace with a few real world examples.

Link: devchannel.org

Click Here!