-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
gh-111784: Fix two segfaults #113405
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
gh-111784: Fix two segfaults #113405
Conversation
@mgorny Can you confirm that problem is resolved now? |
Also, I check it for reference leaks: ./python.exe -m test -R 3:3 test_xml_etree_c
Using random seed: 1167552768
0:00:00 load avg: 2.77 Run 1 test sequentially
0:00:00 load avg: 2.77 [1/1] test_xml_etree_c
beginning 6 repetitions
123456
......
== Tests result: SUCCESS ==
1 test OK.
Total duration: 2.7 sec
Total tests: run=208 skipped=6
Total test files: run=1/1
Result: SUCCESS |
Thanks! I can confirm that with this patch, slixmpp's test suite passes without segfaults on top of Python 3.12. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Yes, add a NEWS entry, please.
Done. |
Misc/NEWS.d/next/Library/2023-12-23-13-10-42.gh-issue-111784.Nb4L1j.rst
Outdated
Show resolved
Hide resolved
Thanks @Eclips4 for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12. |
GH-113446 is a backport of this pull request to the 3.12 branch. |
…H-113405) First fix resolve situation when pyexpat module (which contains expat_CAPI capsule) deallocates before _elementtree, so we need to hold a strong reference to pyexpat module to. Second fix resolve situation when module state is deallocated before deallocation of XMLParser instances, which uses module state to clear some stuff. (cherry picked from commit 894f0e5) Co-authored-by: Kirill Podoprigora <[email protected]>
) (GH-113446) First fix resolve situation when pyexpat module (which contains expat_CAPI capsule) deallocates before _elementtree, so we need to hold a strong reference to pyexpat module to. Second fix resolve situation when module state is deallocated before deallocation of XMLParser instances, which uses module state to clear some stuff. (cherry picked from commit 894f0e5) Co-authored-by: Kirill Podoprigora <[email protected]>
Thanks Serhiy for your review! |
…H-113405) First fix resolve situation when pyexpat module (which contains expat_CAPI capsule) deallocates before _elementtree, so we need to hold a strong reference to pyexpat module to. Second fix resolve situation when module state is deallocated before deallocation of XMLParser instances, which uses module state to clear some stuff.
…H-113405) First fix resolve situation when pyexpat module (which contains expat_CAPI capsule) deallocates before _elementtree, so we need to hold a strong reference to pyexpat module to. Second fix resolve situation when module state is deallocated before deallocation of XMLParser instances, which uses module state to clear some stuff.
…H-113405) First fix resolve situation when pyexpat module (which contains expat_CAPI capsule) deallocates before _elementtree, so we need to hold a strong reference to pyexpat module to. Second fix resolve situation when module state is deallocated before deallocation of XMLParser instances, which uses module state to clear some stuff.
…H-113405) First fix resolve situation when pyexpat module (which contains expat_CAPI capsule) deallocates before _elementtree, so we need to hold a strong reference to pyexpat module to. Second fix resolve situation when module state is deallocated before deallocation of XMLParser instances, which uses module state to clear some stuff.
This PR contains two fixes.
First fix resolve situation when
pyexpat
module (which containsexpat_CAPI
capsule) deallocates before_elementtree
, so we need to hold a strong reference topyexpat
module to.Second fix resolve situation when module state is deallocated before deallocation of
XMLParser
instances, which uses module state to clear some stuff.(I'll write a
NEWS
entry later, if it is necessary)_elementtree.XMLParser
#111784