Using strace to troubleshoot issues
summary
Strace is used with -f -tt -T -v -s1k to record syscall arguments and timings, but ptrace serializes threads and can slow a program by ~10x. Concrete case studies: df shows 440 ms stalls reading a custom LD_LIBRARY_PATH; ssh delays by 25 seconds because sshd blocks on a systemd-logind dbus call; sudo tracing requires attaching as root (use echo $$ to find pid and attach); cron failure is due to wrong SELinux file context; boot tracing uses a systemd unit with enforcing=0; a patch adds SELinux context output.
AI-written summary · about
chapters (8)
- 0:00Introduction to strace
- 1:24Understanding system calls
- 3:06How strace works internally
- 4:27When to use strace
- 6:59Recommended usage tips
- 7:59Analyzing strace output
- 12:07Common error patterns
- 15:03Practical troubleshooting examples








