“Many times I have come across seemingly hopeless situations where a program when compiled and installed in GNU/Linux just fails to run. In such situations after I have tried every trick in the book like searching on the net and posting questions to Linux forums, and still failed to resolve the problem, I turn to the last resort which is trace the output of the misbehaving program. Tracing the output of a program throws up a lot of data which is not usually available when the program is run normally. And in many instances, sifting through this volume of data has proved fruitful in pin pointing the cause of error.”
Strace has saved me more than once troubleshooting issues on various Linux servers. In Solaris/HP-UX, the equivalent is truss even though it might not be installed by default.
This article comes from Ravi’s blog http://linuxhelp.blogspot.com It’s one of the most solid Linux System Administration blogs I’ve ever found.
Another really good one is nixCraft’s sys admin blog:
http://www.cyberciti.biz/nixcraft/vivek/blogger/blogger.php
these are great blogs, thanks for the links.
I posted a similar writeup of using strace a while back here:
http://www.debian-administration.org/articles/352
Interestingly we both thought alike and used the same example once!
I have really wondered if there are other ways of trouble shooting a program. I guess strace is one of the swiss army knives which are available in GNU/Linux for this purpose. A well written article with some personal experience thrown in.
GDB