Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

See stacktrace of hanging Python in futex(..., FUTEX_WAIT_BITSET_PRIVATE|...)

A Python process hangs in futex():

root@pc:~# strace -p 9042
strace: Process 9042 attached
futex(0x1e61900, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, NULL, ffffffff

I want to see the stacktrace if the hanging process.

Unfortunately ctrl-c does not work :-(

How can I see the stacktrace if Python hangs like this?

like image 467
guettli Avatar asked Sep 15 '16 08:09

guettli


1 Answers

  1. install the gdb python extensions if needed for your system (see here for example, or look at your distro documentation)
  2. attach gdb to your hung process
  3. run

    (gdb) py-bt
    

    instead of regular bt to get the Python backtrace

like image 53
Useless Avatar answered Nov 15 '22 00:11

Useless