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 it's waiting on another process:
$ sudo strace -p 5546
Process 5546 attached - interrupt to quit
futex(0x7f6c416679d0, FUTEX_WAIT, 5547, NULL^C <unfinished ...>
Process 5546 detached
Interestingly, process 5547 doesn't appear in ps
(can anyone tell me why?), but I can strace
it. It is repeatedly spitting out a lot of EAGAIN failures (with the occasional success)
read(16, 0x7f6c41664d10, 16) = -1 EAGAIN (Resource temporarily unavailable)
recvfrom(15, 0x7f6c3815f2e4, 4096, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
clock_gettime(CLOCK_MONOTONIC, {67410, 357843264}) = 0
poll([{fd=16, events=POLLIN}, {fd=15, events=POLLIN}, {fd=68, events=POLLIN}, {fd=128, events=POLLIN}, {fd=69, events=POLLIN}], 5, 0) = 0 (Timeout)
read(16, 0x7f6c41664cb0, 16) = -1 EAGAIN (Resource temporarily unavailable)
recvfrom(15, 0x7f6c3815f2e4, 4096, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
...
Judging from the output, it looks like it is polling the file descriptors 16, 15, 68, 128 and 69. Particularly, the EAGAIN
errors are coming from fds 15 and 6, as seen from the read(2)
and recvfrom(2)
calls.
How do I find more information on those fds? I tried lsof -p 5547
but no output is printed. I suspect these are sockets that are open to some website, but why it is spinning in a tight loop with EAGAIN
failures is puzzling...