Minimal c program does more system-calls than expected
I am trying to learn more about strace. I use strace to understand the calls a c program makes.The c program is:void_start (){ for (;;) { }}The program gets compiled withclang -nostdlib littletest.cThe...
View Articlestrace write calls to stdout
Is there a way to use strace to just show a process's stdout? I know I can dostrace -p pid -e writebut that shows calls to write(2) to multiple file descriptors. When reading the man page I also saw...
View ArticleWhy top is not reporting high %wa on too many write sys calls
My HTTP application suddenly started taking extra time to start up. During this phase, it loads the data from the disk to the in-memory data structure.I doubt it is due to the extensive logging inside...
View ArticleHint to investigate some SEGFAULT no longer happening when strace-ing
I get an application (webcamoid in its 8.8 version) that used to be working troublefree and which now segfaults systematically at startup (kde-plasma/X11 do not even get the opportunity to open some...
View Articleterminal: Error occurred while reset 800b: errno=25
I have an extremely bizarre problem, occurring somewhere at the intersection of terminal, su, w3m and /dev/null:when I su - from user1 to user2, following command does not work:$ w3m zz.html...
View ArticleConnecting to IP 0.0.0.0 succeeds. How? Why?
We are serving a port on localhost and want to check in another process if the port is available. Due to a bug in our code, it is actually trying to connect to the IP 0.0.0.0:<port>, and for some...
View ArticleWhy doesn't strace -f work on GNOME Terminal?
I tried running the commandstrace -f gnome-terminal --wait |& grep writeand then in the terminal window that opened, I typed ls and pressed enter.I expected to see write syscalls corresponding to...
View Articlevim very slow over SSH connection
I have a non-stellar SSH connection to some machine; the echo time is... I don't know, 0.2 seconds or so.Anyway, when I start vim, say with no input file, I experience a long delay, of about 3 to 4...
View ArticleVery slow auto-completion in Linux for Windows
For some reason auto-completion is very slow for me in WSL, it always takes several seconds display the result of, for example ll ~/Te<tab> (which would, after 2-3 seconds, print ll ~/Temp).I've...
View ArticleProcess stucked at recvfrom syscall
A process is stucked at recvfrom syscall.> sudo strace -p 4146278strace: Process 4146278 attachedrecvfrom(9 ...I looked up under /proc/4146278/fd.fd 9 seems to be a socket.> sudo ls -al...
View ArticlePlotting the sleep/wait chain of a process
I often want to know why a process in the middle of a pipeline is sleeping and not busy processing data. My current method is: find the pid of interestsudo strace -pt pid to get the blocking syscall...
View ArticleHow can I get a custom tmux.conf file to work with tmux 3.3a? `-f` flag not...
I have tmux and wanted to set some custom configurations, but I cannot find a default tmux.conf file.tmux -V tmux 3.3aAccording to the manpage:-f fileSpecify an alternative configuration file. By...
View ArticleHow to trace on continuously running process?
So I wanted to know how files are opened by zsh like .xinitrc, .xprofile, .zprofile, and exactly in which order. So I have decided to strace on zsh process with the grep command to see how the open...
View ArticleList the files accessed by a program
time is a brilliant command if you want to figure out how much CPU time a given command takes.I am looking for something similar that can list the files being accessed by a program and its children....
View Articlecondensing locale requests on every program load
I ran strace on a number of programs (used syntax strace -fe trace=open --insert program here-- ) and every time I execute a program that automatically forks other processes, I notice lines similar to...
View ArticleWhy is there no apparent clone or fork in simple bash command and how it's done?
Consider the following (with sh being /bin/dash):$ strace -e trace=process sh -c 'grep "^Pid:" /proc/self/status /proc/$$/status'execve("/bin/sh", ["sh", "-c", "grep \"^Pid:\" /proc/self/status /"...],...
View ArticleHow to trace file descriptor duplication?
I am learning to use redirection. the typical operation is like below: command > file 2>&1Refer to APUE 3.10 and 3.12, I think the critical syscall sequence is like below: open(file) == 3...
View Articlestrace for troubleshooting inter process communication
I have output captured by following command:strace -f -e trace=process,socketpair,open,close,dup,dup2,read,write -o rsync.log rsync -avcz --progress src/ dst/it is a bit long so I've uploaded it here....
View ArticleDebugging strange EACCES (Permission denied) permission error
I have a symlink to a world-readable file that a c program is being unable to read. redshift is supposed to pick up configuration from $HOME/.config/redshift/redsihft.conf automatically, but it wasn't....
View Articlegrep does not colorize properly
I am trying to pipe a output from command to grep.$ strace a.out | grep --color=always "mmap"but it only outputs non-colorized output of strace:...mmap(NULL, 503808, PROT_READ|PROT_WRITE,...
View Articlelog out from slim, or slim restart results in blank screen for several minutes
I am using slim login manager.when I log out from my session, or restart slim from the commandline:service slim restartI get blank console for couple of minutes, before the slim login screen appears...
View ArticleHow to parse strace recvfrom syscall?
I strace a curl command:strace -s 2000 -f curl google.comand see 2 DNS queriesrecvfrom(3,...
View ArticleWrite strace output to a file
I'm trying to write the output of strace ls to a file. I know that I need to use > in order to forward output of a command to a file, but it doesn't work. It creates a file but the command prints...
View Articlestrace top: EAGAIN (Resource temporarily unavailable)
On one of my ubuntu server, top command start very slow, when I run top command on terminal, it will display info after more than 10 seconds.Then I use strace -yy top to analysis the problem, I found...
View ArticleHow to perform strace on shell without changing your current shell?
I use strace to trace the behavior of a bash process. The purpose is to find out the order bash loads its configuration files.I am running the following command under zsh:strace -e openat bashAfter...
View ArticleHow to trace networking activity of a command?
I want to trace the networking activity of a command, I tried tcpdump and strace without success. For an example, If I am installing a package or using any command that tries to reach some site, I want...
View ArticleWhen (and how) are file permission/access decisions made in kernel space?
(I think) I have a relatively good understanding of how Linux permissions work - traditional Unix DAC permissions, and how they're represented, security context in relation to processes (i.e. cred...
View Articlehow to keep stty sane after piping strace to vim?
this makes vim madness:$strace -o >(vim -; stty sane) file.out; stty saneI have typed stty sane in processed substitution as well as in next command but none of them did their job. Once i piped the...
View ArticleHow to correctly use strace -e read=fd option?
I'm trying to monitor read activity on a particular file descriptor in a running process. Here is the C++ test bench I'm testing various solutions on:#include <fcntl.h>#include...
View ArticleTyping in the Terminal on Ubuntu takes seconds until the typed character appears
The problem: typing in the terminal on Ubuntu takes seconds until the typed character appears.I first noticed this after I moved large chunks of data onto another LUKS encrypted HDD which I mounted via...
View Article
More Pages to Explore .....