Message 55926 - Python tracker (original) (raw)
We need to start from PyFile_WriteString() and PyFile_WriteObject() and PyObject_Print(), which are what the PRINT_* opcodes use, and make sure there is no single fprintf() or fputs() that occurs with the GIL held. It is not enough to fix a few places that could clearly write a lot of data, because even if there is just one place left where the GIL is not released it could be precisely where the OS decides to block, causing a deadlock.