GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||
GeezerVison is showing github.com — bpo-46070: Revert "bpo-36854: Move _PyRuntimeState.gc to PyInterpreterState (GH-17287)" by vstinner · Pull Request #30564 · python/cpython Conversation
|
|
FTR, this is to resolve https://bugs.python.org/issue46070. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
BTW, do we have any sort of reproducer for which we can add a test? That way we don't cause the same problem when we move GC back to PyInterpreterState later. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
So far, I was only able to reproduce the crash on Windows with Python 3.9 using win_py399_crash_reproducer.py script of https://bugs.python.org/issue46070 I failed to write a reliable reproducer which works on any platform. I didn't fully understand the root issue. My theory is that an object is shared by two interprereter. The first interpreter runs a GC collection which traverses this shared object, an object finalizer releases the GIL. Now the second interpreter gets the GIL and also runs a GC collection which traverses the same shared object. The problem is that the PyGC_Head header cannot be modified by two interpreters in parallel: data races are likely and Python does crash somehow. Since the bug is a crash and so far nobody managed to fully understand it, IMO it's safer to revert the change for now. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Your theory sounds plausible. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I wrote a simpler fix: GH-30577. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.