Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Following on from a problem described in "How is it that I can attach strace to a process that isn't in the output of ps?"

I'm trying to debug a process that hangs part way through.

By using strace -f on my parent process, I was able to determine that I have a bunch of threads that are just showing:

# strace -p 26334
Process 26334 attached - interrupt to quit
epoll_wait(607, {}, 4096, 500)          = 0
epoll_wait(607, {}, 4096, 500)          = 0
epoll_wait(607, {}, 4096, 500)          = 0
epoll_wait(607, {}, 4096, 500)          = 0
epoll_wait(607, ^C <unfinished ...>
Process 26334 detached

Investigating further:

# readlink /proc/26334/fd/607
anon_inode:[eventpoll]

My gut tells me that I've managed to get some threads in a deadlock situation, but I don't really know enough about epoll to move forward. Are there any commands that can give me some insight into what these threads are polling for, or which file descriptors this epoll descriptor maps to.

share|improve this question

1 Answer 1

When you run strace the lines it's returning are system functions. In case it wasn't obvious epoll_wait() is a function that you can do a man epoll_wait to find out implementation details like so:

   epoll_wait, epoll_pwait - wait for an I/O event on an epoll file descriptor

The description for epoll:

The epoll API performs a similar task to poll(2): monitoring multiple file descriptors to see if I/O is possible on any of them. The epoll API can be used either as an edge-triggered or a level-triggered interface and scales well to large numbers of watched file descriptors.

So it would seem that you're process is blocking on file descriptors, waiting to see if I/O is possible on any of them.

I would change my tactics a bit and try and make use of lsof -p <pid> to see if you can narrow down what these files actually are.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.