-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
Crash in _elementtree.c after #24061 #100689
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Looks like that this comment is not exactly right: /* The PyExpat_CAPI structure is an immutable dispatch table, so it can be
* cached globally without being in per-module state.
*/ And it should also go to per-module state ( Also related: #99221 |
Yes, we should definitely isolate |
This affects 3.11 too so I suggest to revert that PR which caused this and fix this properly in 3.12. cc RM @pablogsal |
Doesn't #24061 also affect 3.10? In any case, for maintained branches, the best would be to revert the PR unless someone sees something that may break for external users. |
Yes, this affects 3.10 as well. |
…on the heap memory (pythonGH-24061)" This reverts commit 7c83eaa.
I've opened a PR with the revert: #100745 |
Thanks for the PR, marked release blocker so that the fix gets in the next release. |
…on the heap memory (pythonGH-24061)" (pythonGH-100745) * pythongh-100689: Revert "bpo-41798: pyexpat: Allocate the expat_CAPI on the heap memory (pythonGH-24061)" This reverts commit 7c83eaa. (cherry picked from commit b034fd3) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
…on the heap memory (pythonGH-24061)" (pythonGH-100745) * pythongh-100689: Revert "bpo-41798: pyexpat: Allocate the expat_CAPI on the heap memory (pythonGH-24061)" This reverts commit 7c83eaa. (cherry picked from commit b034fd3) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
… on the heap memory (GH-24061)" (GH-100745) (#100847) gh-100689: Revert "bpo-41798: pyexpat: Allocate the expat_CAPI on the heap memory (GH-24061)" (GH-100745) * gh-100689: Revert "bpo-41798: pyexpat: Allocate the expat_CAPI on the heap memory (GH-24061)" This reverts commit 7c83eaa. (cherry picked from commit b034fd3) Co-authored-by: Nikita Sobolev <mail@sobolevn.me> Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Crash report
Tell us what happened, ideally including a minimal, reproducible example (https://stackoverflow.com/help/minimal-reproducible-example).
Since updating LibreELEC master from Python 3.9.15 to 3.11/3.11.1 there are several reports of crashes in _elementtree module, see xbmc/xbmc#22344.
It is hard to reproduce, you have to set up a minimal kodi addon like:
... and start it a few hundred to thousand times.
Error messages
Enter any relevant error message caused by the crash, including a core dump if there is one.
Typical stack trace is:
Your environment
Conclusion
With #24061 the expat_CAPI is allocated on the heap but _elementtree.c is still using a static reference to a may be already freed structure.
Reverting #24061 solves the issue for me. A true fix from someone with more cpython experience should move
*expat_capi
to the heap too.Linked PRs
The text was updated successfully, but these errors were encountered: