[issue34416] PyCapsule_Import seems to release the GIL without acquiring it

Pablo Galindo Salgado report at bugs.python.org
Thu Aug 16 18:33:44 EDT 2018


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:

Breaking in take_gil and drop_gil I get this trace:

Thread 2 "gil" hit Breakpoint 1, 0x000055555559563d in acquire_gil ()
Thread 3 "gil" hit Breakpoint 1, 0x000055555559563d in acquire_gil ()
Waiting for GIL (0)
Waiting for GIL (1)
Thread 2 "gil" hit Breakpoint 2, take_gil (tstate=tstate at entry=0x7ffff0000f40) at Python/ceval_gil.h:192
Thread 3 "gil" hit Breakpoint 2, take_gil (tstate=tstate at entry=0x7fffe8000b30) at Python/ceval_gil.h:192
Gil acquired! (0)
Thread 2 "gil" hit Breakpoint 3, drop_gil (tstate=tstate at entry=0x7ffff0000f40) at Python/ceval_gil.h:150
Gil acquired! (1)
Thread 2 "gil" hit Breakpoint 2, take_gil (tstate=tstate at entry=0x7ffff0000f40) at Python/ceval_gil.h:192
Thread 3 "gil" hit Breakpoint 3, drop_gil (tstate=tstate at entry=0x7fffe8000b30) at Python/ceval_gil.h:150
Thread 2 "gil" hit Breakpoint 3, drop_gil (tstate=tstate at entry=0x7ffff0000f40) at Python/ceval_gil.h:150
Thread 3 "gil" hit Breakpoint 2, take_gil (tstate=tstate at entry=0x7fffe8000b30) at Python/ceval_gil.h:192
Thread 3 "gil" hit Breakpoint 3, drop_gil (tstate=tstate at entry=0x7fffe8000b30) at Python/ceval_gil.h:150
Thread 3 "gil" hit Breakpoint 2, take_gil (tstate=tstate at entry=0x7fffe8000b30) at Python/ceval_gil.h:192
Thread 3 "gil" hit Breakpoint 3, drop_gil (tstate=tstate at entry=0x7fffe8000b30) at Python/ceval_gil.h:150
Thread 3 "gil" hit Breakpoint 2, take_gil (tstate=tstate at entry=0x7fffe8000b30) at Python/ceval_gil.h:192
Thread 3 "gil" hit Breakpoint 3, drop_gil (tstate=tstate at entry=0x7fffe8000b30) at Python/ceval_gil.h:150
Thread 3 "gil" hit Breakpoint 2, take_gil (tstate=tstate at entry=0x7fffe8000b30) at Python/ceval_gil.h:192
Thread 2 "gil" hit Breakpoint 2, take_gil (tstate=tstate at entry=0x7ffff0000f40) at Python/ceval_gil.h:192
Thread 3 "gil" hit Breakpoint 3, drop_gil (tstate=tstate at entry=0x7fffe8000b30) at Python/ceval_gil.h:150
Thread 3 "gil" hit Breakpoint 2, take_gil (tstate=tstate at entry=0x7fffe8000b30) at Python/ceval_gil.h:192
Thread 2 "gil" hit Breakpoint 3, drop_gil (tstate=tstate at entry=0x7ffff0000f40) at Python/ceval_gil.h:150
Thread 2 "gil" hit Breakpoint 2, take_gil (tstate=tstate at entry=0x7ffff0000f40) at Python/ceval_gil.h:192
Thread 3 "gil" hit Breakpoint 3, drop_gil (tstate=0x0) at Python/ceval_gil.h:150
Thread 2 "gil" hit Breakpoint 3, drop_gil (tstate=tstate at entry=0x7ffff0000f40) at Python/ceval_gil.h:150
Thread 2 "gil" hit Breakpoint 2, take_gil (tstate=tstate at entry=0x7ffff0000f40) at Python/ceval_gil.h:192
Thread 2 "gil" hit Breakpoint 3, drop_gil (tstate=tstate at entry=0x7ffff0000f40) at Python/ceval_gil.h:150
Thread 2 "gil" hit Breakpoint 2, take_gil (tstate=tstate at entry=0x7ffff0000f40) at Python/ceval_gil.h:192
Thread 2 "gil" hit Breakpoint 3, drop_gil (tstate=tstate at entry=0x7ffff0000f40) at Python/ceval_gil.h:150
Thread 2 "gil" hit Breakpoint 2, take_gil (tstate=tstate at entry=0x7ffff0000f40) at Python/ceval_gil.h:192
Thread 2 "gil" hit Breakpoint 3, drop_gil (tstate=tstate at entry=0x7ffff0000f40) at Python/ceval_gil.h:150
Thread 2 "gil" hit Breakpoint 2, take_gil (tstate=tstate at entry=0x7ffff0000f40) at Python/ceval_gil.h:192
Thread 2 "gil" hit Breakpoint 3, drop_gil (tstate=0x0) at Python/ceval_gil.h:150
Gil released! (0)


which seems normal to me. This is tested on current master.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34416>
_______________________________________


More information about the Python-bugs-list mailing list