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 vstinner
Recipients eric.snow, nanjekyejoannah, ncoghlan, pablogsal, vstinner
Date 2020-03-06.14:53:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1583506396.46.0.676310852477.issue39877@roundup.psfhosted.org>
In-reply-to
Content
Patch to get a cleaner error if the bug occurs, but also to make the bug more reliable:

diff --git a/Python/ceval.c b/Python/ceval.c
index ef4aac2f9a..8bf1e4766d 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -382,7 +382,8 @@ PyEval_SaveThread(void)
 void
 PyEval_RestoreThread(PyThreadState *tstate)
 {
-    assert(tstate != NULL);
+    assert(!_PyMem_IsPtrFreed(tstate));
+    assert(!_PyMem_IsPtrFreed(tstate->interp));
 
     _PyRuntimeState *runtime = tstate->interp->runtime;
     struct _ceval_runtime_state *ceval = &runtime->ceval;
History
Date User Action Args
2020-03-06 14:53:16vstinnersetrecipients: + vstinner, ncoghlan, eric.snow, pablogsal, nanjekyejoannah
2020-03-06 14:53:16vstinnersetmessageid: <1583506396.46.0.676310852477.issue39877@roundup.psfhosted.org>
2020-03-06 14:53:16vstinnerlinkissue39877 messages
2020-03-06 14:53:16vstinnercreate