Questions tagged [strace]

strace is a Linux/UNIX tool for logging and analysing the system calls made by a user-side process.

strace is a diagnostic, debugging and instructional userspace utility for Linux. It is used to monitor interactions between processes and the Linux kernel, which include system calls, signal deliveries, and changes of process state. The operation of strace is made possible by the kernel feature known as .

Use this tag to ask programming questions related to the strace command and the strace() system call.

Source: Wikipedia

485 questions
12
votes
1 answer

Why STRACE shows EAGAIN (Resource temporarily unavailable)

Following is the sequence I am getting socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 7 setsockopt(7, SOL_TCP, TCP_NODELAY, [1], 4) = 0 setsockopt(7, SOL_SOCKET, SO_SNDBUF, [32120], 4) = 0 getsockopt(7, SOL_SOCKET, SO_SNDBUF, [30064835312],…
Avinash
  • 12,851
  • 32
  • 116
  • 186
11
votes
3 answers

Unable to "strace -p" on a running JBoss process

I am trying to use "strace -p" to attach to an already running JBoss process. JBoss is using the 1.5.0_15 Java JDK. Unfortunately, this doesn't work - I only get a single futex() result: # strace -p 3388 Process 3388 attached - interrupt to quit […
curious_george
  • 622
  • 2
  • 8
  • 19
11
votes
2 answers

strace tmux output redirected to a file

I want to check which files does tmux touch when it is launched (not just the list of open files when tmux is running). Strace tmux seemed like the best option. When trying to redirect the output to a file strace tmux > /tmp/blah. File is empty. Why…
Swair
  • 1,503
  • 2
  • 15
  • 27
10
votes
1 answer

Capture vDSO in strace

I was wondering if there is a way to capture (in other words observe) vDSO calls like gettimeofday in strace. Also, is there a way to execute a binary without loading linux-vdso.so.1 (a flag or env variable)? And lastly, what if I write a program…
Anastasios Andronidis
  • 6,310
  • 4
  • 30
  • 53
10
votes
3 answers

How to decode this information from strace output

I wrote a small go script and traced it using strace though this script, I am trying to fetch audit messages from kernel using netlink protocol, just like like auditd. Following is the strace output on my go script-…
Hardik Juneja
  • 377
  • 1
  • 2
  • 12
10
votes
2 answers

adding "-rpath,/usr/lib" in the build options of a shared library cause a segfault

I have a hello world program. #include #include int main() { printf("hello world! \n"); return 0; } I add -lmicroxml in the build of the program in the linkage phase in order to link to the library libmicroxml.so when…
MOHAMED
  • 41,599
  • 58
  • 163
  • 268
10
votes
1 answer

JVM periodically hangs

Trying to debug a misbehaving Java VM. The process in question is a large VM (100GB heap) running Sun VM 1.6u24 on Centos 5 that is doing routine back-end work - i.e. database access, file I/O and so forth. After the process was restarted for a…
Alon Pilberg
  • 101
  • 1
  • 5
9
votes
3 answers

Profiling for wall-time on Linux

I have an application that I want to profile wrt how much time is spent in various activities. Since this application is I/O intensive, I want to get a report that will summarize how much time is spent in every library/system call (wall time). I've…
sandt1g3r
  • 143
  • 1
  • 6
9
votes
2 answers

How to get cwd for relative paths?

How can I get current working directory in strace output, for system calls that are being called with relative paths? I'm trying to debug complex application that spawns multiple processes and fails to open particular file. stat("some_file",…
user1199933
  • 157
  • 2
  • 7
9
votes
7 answers

Android: How to strace an app using ADB shell am start

I need help on stracing Android apps in the SDK emulator. Here is my setup: I have an Android SDK emulator running the Android API 4.03 ADB shell connected to emulator. I am able to install an APK using the ADB install filename.apk I am able to run…
user1631295
  • 709
  • 2
  • 7
  • 5
8
votes
1 answer

strace reports x32 and 64 bit mode

I am confused about this strace report on an ArchLinux, 64bit intel machine: ~ sudo strace -c -p 876 [sudo] password for pmatos: strace: Process 876 attached strace: [ Process PID=876 runs in x32 mode. ] strace: [ Process PID=876 runs in 64 bit…
Paulo Matos
  • 1,614
  • 17
  • 23
8
votes
2 answers

Strace daemon process started using service

Strace can be used for tracing process by passing command for the process as below strace -f -tt -o strace.log -D But below command fails to trace the syscalls of started daemon process strace -f -tt -o strace.log -D service nginx…
Yogesh
  • 4,546
  • 2
  • 32
  • 41
8
votes
1 answer

How to use strace to only show calls that take a lot of time?

Is there a way to grep for only calls that over a certain amount of time?
HyderA
  • 20,651
  • 42
  • 112
  • 180
8
votes
1 answer

strace: order of and <... resumed>

I'm writing a script that analyzes file access traced with strace. The trace contains some calls which have been interrupted by another process. strace shows them with and <... close resumed> (in case of an interrupted close call)…
try-catch-finally
  • 7,436
  • 6
  • 46
  • 67
1 2
3
32 33