Questions tagged [strace]

39 questions
12
votes
1 answer

Will strace watch system calls recursively on child processes of the main process being observed?

If I run strace on a program and that program spawns a subprocess (e.g. perl's system() call), will strace report the system calls for the child process as well?
Ross Rogers
  • 4,427
  • 8
  • 32
  • 43
8
votes
6 answers

Linux equivalent to Mac OS X's fs_usage

Is there a Linux equivalent to the Mac OS X command fs_usage? According to the man page it does the following: "report system calls and page faults related to filesystem activity in real-time". I suppose one option would be to use strace and filter…
Khai
  • 156
  • 1
  • 8
7
votes
2 answers

Debugging connection timeouts using strace?

I'm trying to figure out why is Eclipse spinning, so I decided to fire up strace. I found the eclipse process using: $ ps ax | grep java 5546 ? Sl 19:04 /usr/bin/java ... [arguments omitted] By running strace on this process, I see that…
jabalsad
  • 1,427
  • 3
  • 13
  • 19
6
votes
0 answers

What’s the command line equivalent of strace on Windows?

I need to | findstr SomePATH in order to search if a program access and close immediately a specific path. On Linux, I would use myprogram | strace 2>&1 | grep SomPATH. But what’s the equivalent on Windows ?
user2284570
  • 1,799
  • 7
  • 35
  • 62
6
votes
1 answer

Why strace sudo command bombs when sudo command works?

my username is allowed to execute sudo command then why does this bomb strace sudo command with the error: sudo: must be setuid root
user322908
  • 769
  • 2
  • 13
  • 24
4
votes
0 answers

Understanding the strace output on a mac

I am seeing syscalls that I do not understand. Multiple calls ending with _nocancel. E.g. open_nocancel, close_nocancel. What are these calls and where do I find information about these? Google does not answer this question surprisingly and neither…
user220201
  • 161
  • 4
4
votes
1 answer

What is a SIG_0 when looking at an strace

Attaching strace to a process that is using a lot of cpu, shows that the pid is 'killed' over and over. The process is using 130% cpu. What is a tgkill( SIG_0) ? strace -p 3876 nanosleep({0, 100000}, NULL) = 0 tgkill(3876, 3884, SIG_0) = 0…
spuder
  • 9,854
  • 4
  • 42
  • 57
4
votes
3 answers

Interfacing strace with Process Name instead of PID

How do I implement a wrapper script pstrace in bash that changes the interface of [sudo] strace -c -p [PID] to [sudo] pstrace -c -p [PROCESS-NAME] similar to how killall [PROCESS-NAME] is used. With completion and everything.
Nordlöw
  • 197
  • 1
  • 8
4
votes
2 answers

How do I strace the whole system?

strace allows you to monitor the activity of a particular program. How can I monitor the activity of all programs (expect for sshd/bash/strace_itself)? Currently I'm using a hack like this: function ppid() { cat /proc/"$1"/status | grep PPid: | grep…
Vi.
  • 16,755
  • 32
  • 111
  • 189
4
votes
1 answer

Why do strace/truss sometimes 'fix' stuck processes?

Sometimes you have a stuck process that's been stuck for a while, and as soon as you go to poke at it with strace/truss just to see what's going on, it gets magically unstuck and continues to run! So from merely 'observing' these programs have some…
Emmel
  • 351
  • 2
  • 4
  • 9
4
votes
1 answer

What can trigger a SIGPWR signal that interrupts a 'sendmsg' system call?

On a RHEL 6 host, I have a Cassandra server listening for TCP connections on localhost. In parallel, I have a client application that sends it requests. The client (C# Mono) uses sendmsg to send the serialized bytes. I consistently see the sendmsg…
3
votes
1 answer

Is it possible to strace pinging a host?

I am doing this $ strace -f ping -s 1 www.google.com execve("/bin/ping", ["ping", "-s", "1", "www.google.com"], [/* 80 vars */]) = 0 getuid() = 1001 setuid(1001) = 0 getuid() …
socgen hacker
  • 417
  • 1
  • 4
  • 10
3
votes
1 answer

docker version hangs before server info

Introduction I'm attempting to use the following version of docker on a Linux VM (uname -a returns Linux xen 4.1.17-yocto-standard #1 SMP PREEMPT Thu Jun 2 13:29:47 PDT 2016 x86_64 GNU/Linux), built from the docker_git BitBake recipe. If I try to…
karobar
  • 237
  • 2
  • 14
2
votes
1 answer

why doesn't strace use test syscalls to find out their indices in the system call table?

I understand that strace command uses ptrace(PTRACE_PEEKUSER, child, __builtin_offsetof(struct user, regs.orig_eax)) to find the index of a system call the tracee child is trapped at. Then to translate the index into the syscall function name, it…
user322908
  • 769
  • 2
  • 13
  • 24
2
votes
1 answer

why doesn't strace work on gcc -c

>echo > foobar.c >strace gcc -c foobar.c 2>&1 | grep foobar.o > (nothing) - foobar.o is being written obviously, but I don't see it on strace. Why?
user461984
  • 63
  • 1
  • 5
1
2 3