This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author skrah
Recipients boytsovea, skrah
Date 2020-02-27.20:07:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I built your example with 3.6:

git clone

git checkout v3.6.7
./configure --with-pydebug

g++ -std=c++11 -pthread -Wno-unused-result -Wsign-compare -g -Og -Wall -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -I. -I./Include -I./pybind11/include -c main.cpp

g++ -pthread -Xlinker -export-dynamic -o main main.o libpython3.6dm.a -lpthread -ldl -lutil -lm

cp python python3

And I literally get this error (not always, it may take 10 runs or so):

$ ./main
Fatal Python error: Python memory allocator called without holding the GIL

Thread 0x00007f1e73fff700 (most recent call first):

Thread 0x00007f1e7b836700 (most recent call first):

Thread 0x00007f1e7a834700 (most recent call first):

Thread 0x00007f1e7b035700 (most recent call first):

Thread 0x00007f1e7d039700 (most recent call first):

Thread 0x00007f1e7c838700 (most recent call first):

Current thread 0x00007f1e7c037700 (most recent call first):

Thread 0x00007f1e7e84f740 (most recent call first):
Aborted (core dumped)

So no, I don't think the GIL handling is correct.
Date User Action Args
2020-02-27 20:07:54skrahsetrecipients: + skrah, boytsovea
2020-02-27 20:07:54skrahsetmessageid: <>
2020-02-27 20:07:54skrahlinkissue39776 messages
2020-02-27 20:07:54skrahcreate