Debugging with strace
Dig Deep

© Stephen Mcsweeny, 123RF
After "Hello World," you really need to look at system calls in more detail. In this second of two articles, we'll look at debugging in the real world.
An article in the June issue [1] explored the very useful system call tracer strace [2]. Strace helps you hunt down the source of problems with home-grown apps or buggy open source programs that won't quite work on your system. In this article, I take a closer look at how to interpret some of the system call information discovered through strace and describe some ways to make strace more useful in practical situations.
Hello Again!
In the previous article, I introduced the simple test program shown in Listing 1. To run strace on this program and send the output to a file, I typed:
strace -o outputfile.txt helloworld.c
[...]