Hi. I'm running a pure Python app in pypy3. It is often deadlocking with the process in a sleep stating and making no progress. For example…
PID TTY STAT TIME COMMAND 211617 ? Sl 16:13 pypy3 mytool
I attach to the running process using
gdb -p 211617.
info threads show two threads. My code has created no threads. Are those two threads the Python interpreter and the garbage collector (just for my curiosity)? Both threads are blocked in the function
futex_abstimed_wait_cancelable. The backtrace is…
#0 0x00007fe62694c18a in futex_abstimed_wait_cancelable (private=128, abstime=0x0, expected=0, futex_word=0x7fe62a671000) at ../sysdeps/unix/sysv/linux/futex-internal.h:205 #1 do_futex_wait (sem=sem@entry=0x7fe62a671000, abstime=0x0) at sem_waitcommon.c:111 #2 0x00007fe62694c231 in __new_sem_wait_slow (sem=0x7fe62a671000, abstime=0x0) at sem_waitcommon.c:181 #3 0x00007fe627e3c806 in ?? () from /gsc/btl/linuxbrew/Cellar/pypy3/6.0.0/lib/libpypy3-c.so
Each thread is blocked on a different mutex. Thread 1 is blocked on mutex 0x7fe62a835780 and thread 2 on mutex 0x7fe62a671000. My guess is that the deadlock is the usual thread 1 holds mutex A and is blocked on mutex B, and thread 2 holds mutex B and is blocked on mutex A.
Is there more information that would be useful to you, or anything I can do to help troubleshoot this situation?
$ pypy3 --version Python 3.5.3 (fdd60ed87e941677e8ea11acf9f1819466521bf2, Jul 13 2018, 18:38:41) [PyPy 6.0.0 with GCC 5.4.0 20160609]
I'm using PyPy 6. I see that PyPy 7 is released. I'll try it out.
I'm using a Intel(R) Xeon(R) Gold 6150 CPU @ 2.70GHz with 72 physical cores (144 hyperthreads).
Thanks for your help, Shaun