In yesterday’s blog post on using strace to avoid reading Ruby code I asked the Internet for some more suggestions of practical uses for strace.
There were so many excellent suggestions that I couldn’t not share!
Mike English pointed me to this
Tools for Debugging Running Ruby Processes he wrote about using strace, lsof, and gdb to debug a running Ruby processes. He remarks that some of the things are like open-heart surgery – you can go into a running Ruby process and execute code using gdb, but you might kill the process. Super cool and definitely worth a read.
Some more great suggestions of what to do with strace:
Look for the ‘open’ system call!
A suggestion to also use ltrace:
@b0rk all I know is that I usually start with strace, get annoyed with it, then remember to use ltrace instead. :-)— Brian Mastenbrook (@bmastenbrook) February 27, 2014
I didn’t know syscall tracing was a thing! This seems very worthy of investigation.
@b0rk check out syscall tracing on Linux, it's like strace for the whole system, handy if you want to know which process is doing something.— Michael Ellerman (@michaelellerman) February 27, 2014
Alex Clemmer wrote a super cool post on using dtruss (strace, but for OS X/BSD) to try to better understand concurrency primitives: The unfamiliar world of OS X syscalls.