APLawrence.com -  Resources for Unix and Linux Systems, Bloggers and the self-employed

2004/10/29 strace, trace

© October 2004 Tony Lawrence

System Call Trace, strace on Linux, often just trace on other Unixes. I have used this tool many times to track down baffling application problems. For example, I recently had a client transfer Cobol programs from an old SCO system to Linux. With a Linux runtime in place, the programs worked, but failed mysteriously at certain points. By using strace, I produced a file that showed "open" calls failing due to improper directory permissions.

You don't need to understand much to benefit. You'll see lines like:

open("/etc/mtab", O_RDONLY)             = 3

That's a succesful open. A failure looks like this:

open("/tmp/thingy", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)

Pretty obvious, even if you didn't realize that the "-1" meant a problem.

Of course, the more you understand about system calls and programming, the more you can glean from strace output.

Got something to add? Send me email.

(OLDER)    <- More Stuff -> (NEWER)    (NEWEST)   

Printer Friendly Version

-> strace, trace

Inexpensive and informative Apple related e-books:

Take Control of High Sierra

Take Control of Pages

Take Control of Upgrading to El Capitan

Take Control of iCloud, Fifth Edition

Photos: A Take Control Crash Course

More Articles by © Tony Lawrence

Printer Friendly Version

Have you tried Searching this site?

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more.

Contact us

Printer Friendly Version

When Life Gives You Questions, Google has Answers (AJ Carpio)

Linux posts

Troubleshooting posts

This post tagged:




Unix/Linux Consultants

Skills Tests

Unix/Linux Book Reviews

My Unix/Linux Troubleshooting Book

This site runs on Linode