I have a multi-threaded application running in a production environment that freezes at random with the state of FUTEX_WAIT_PRIVATEall threads, and gdb shows that all threads are trying to make a lock call PyThread_acquire_lock. This is a really massive application with tens of thousands of lines of code, and I cannot figure out which line this error is. Is there any way to debug this problem? I can fix the threading.Lock call and write to the file all the locks were received / released in the application, and then read this file in case of an error again, but I think there are other python functions that call PyThread_acquire_lock. So how can I debug the problem? Maybe it's possible to “subscribe” to this call to the C function from Python and record all these calls?
source
share