Skip to content

Tag: strace

Raw clone system call not working correctly

I’m trying to use the raw clone system call to avoid having to refactor the pid 0 code into a function. Linux requires stacks to by 16 bytes, additionally, libc reserves 16 bits presumably to store ptid and ctid. The code below creates an aligned stack then exits from the child. After waiting for the ch…

How to see system call that executed in current time by process?

Linux utility “strace” show the list of syscall that started after run of strace. How I can see syscall that run in current moment by process? before start of strace. Answer proc offers some information about what the kernel is currently doing “for” a process /proc/${pid}/syscall /proc…

strace -c does not show correct seconds

I have got results for strace -c on RHEL 7 and RHEL 6 for this command: and I don’t understand why the seconds column for nanosleep is equal to 0. I had expected it to be 20. Here is a full strace report: And there is a call to nanosleep in a detailed report: So seconds must be 20, not

strace -e trace=network only showing SIGCHLD?

I am using the command: strace -tt -o ${filename} -e trace=network gdb –args ${EXECUTABLE} to track which system calls occur whilst connecting to and sending messages to a peer. However, I am only receiving the following entries: Should I not see the socket calls to read() close() etc? Answer Using stra…

Interpreting STRACE output – pipes and forks

I have the following code written in C, taken from https://beej.us/guide/bgipc/html/multi/pipes.html: When compiling and running this code in the terminal using strace I get the following output: Can anybody explain, line by line, what is going on in the strace output? I’ve attempted to research how to …