Pavel Kostyuchenko added the comment:
I was able to reproduce the error with version
f13c5c8b9401a9dc19e95d8b420ee100ac022208 on FreeBSD 12.0 VM. The error seems to
be caused not by those changes, but by lack of synchronization in the
multiprocessing.managers.Server.
The failure happens
Pavel Kostyuchenko added the comment:
Also it might be viable to add some assertion to verify the take_gil is not
called with uninitialized interpreter.
I used the changes in the attachment (take_gil.assert.patch), but it produced
errors during test_tracemalloc with