Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debug a futex lock

I have a process waiting on a futex:

# strace -p 5538
Process 5538 attached - interrupt to quit
futex(0x7f86c9ed6a0c, FUTEX_WAIT, 20, NULL

How can I best debug such a situation? Can I identify who holds the futex? Are there any tools similar to ipcs and ipcrm but for futexes?

like image 746
user300811 Avatar asked Jun 20 '13 10:06

user300811


1 Answers

Try using gdb -p *PID* and then run where or bt to see a backtrace.

It won't be spectacularly useful with binaries and libraries that have had their debugging symbols stripped, but you may be able to deduce a fair bit from the context. It might be able to indicate to you which part of a complex process is hanging, and then you could examine the right part of the sources to search for the lock.

like image 79
Josip Rodin Avatar answered Oct 07 '22 12:10

Josip Rodin