What will strace output when run on a binary?
Asked at
AI answer
strace shows a process’s system calls and their results, not the program’s internal logic. For example, when running strace ./program, you’ll typically see execve, libraries and files being loaded through openat, memory mapping through mmap, input/output (read, write), signals, and process termination. Errors such as ENOENT or EACCES often help identify the cause of a failure. For easier inspection, you can use strace -f -o trace.log ./program: -f also traces child processes, and -o writes the trace to a file.
Also asked at RWB
- Why did you decide to change jobs / leave your current company?
- What is the key difference between TCP and UDP?
- What is the difference between git merge and git rebase? When should each approach be used?
- What is an inode in Linux?
- Which command is used to determine the route of a packet from your device to the target host?
Similar questions
- What does strace show when a file is opened (open/openat)?
- What are Linux system calls, and which ones do you know?
- Which standard file descriptors do you know?
- What are hard links and soft links (symlinks) in Linux, and what happens to a file if its symlink is deleted?
- How does Docker work under the hood?