Crash with Python 3.12 #3486

Closed
opened 2023-11-06 15:33:14 +00:00 by thesamesam · 1 comment

Hi,

This is just a heads up that slixmpp ends up segfaulting during its tests with Python 3.12. Initially reported downstream at https://bugs.gentoo.org/916898.

This isn't a slixmpp bug and in Gentoo, we've already reported it upstream to cpython at https://github.com/python/cpython/issues/111784 with a minimised reproducer based on slixmpp, but we figured we'd post this here to let people know in case they end up wondering why tests start to fail w/ 3.12.

It might be that the cpython people say there's also a slixmpp bug here but obviously cpython shouldn't segfault in any case.

[...]
----------------------------------------------------------------------
Ran 453 tests in 3.059s

OK (skipped=22)
Can't list './slixmpp'
<<< 
>>> testing filter
<<< testing filter
/var/tmp/portage/dev-python/slixmpp-1.8.4/temp/environment: line 2591:   624 Segmentation fault      (core dumped) "${@}"
 * ERROR: dev-python/slixmpp-1.8.4::gentoo failed (test phase):
 *   Tests failed with python3.12
Core was generated by `python3.12 -m unittest discover -v'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  xmlparser_gc_clear (self=self@entry=0x7f3f6998dfc0) at ./Modules/_elementtree.c:3788
3788            EXPAT(st, ParserFree)(parser);
(gdb) bt
#0  xmlparser_gc_clear (self=self@entry=0x7f3f6998dfc0) at ./Modules/_elementtree.c:3788
#1  0x00007f3f6da1691b in xmlparser_dealloc (self=0x7f3f6998dfc0) at ./Modules/_elementtree.c:3813
#2  0x00007f3f6e7dc79e in _Py_Dealloc (op=<optimized out>) at Objects/object.c:2608
#3  Py_DECREF (op=<optimized out>) at ./Include/object.h:706
#4  Py_XDECREF (op=<optimized out>) at ./Include/object.h:799
#5  _PyObject_FreeInstanceAttributes (
    self=<XMLPullParser(_events_queue=<collections.deque at remote 0x7f3f6983e020>, _parser=<xml.etree.ElementTree.XMLParser at remote 0x7f3f6998dfc0>) at remote 0x7f3f69874350>) at Objects/dictobject.c:5571
#6  subtype_dealloc (self=<XMLPullParser(_events_queue=<collections.deque at remote 0x7f3f6983e020>, _parser=<xml.etree.ElementTree.XMLParser at remote 0x7f3f6998dfc0>) at remote 0x7f3f69874350>)
    at Objects/typeobject.c:2017
#7  0x00007f3f6e75ed9f in _Py_Dealloc (op=<optimized out>) at Objects/object.c:2625
#8  Py_DECREF (op=<optimized out>) at ./Include/object.h:706
#9  Py_XDECREF (op=<optimized out>) at ./Include/object.h:799
#10 free_keys_object (interp=0x7f3f6ebf4310 <_PyRuntime+76368>, keys=0x560896aa9ad0) at Objects/dictobject.c:673
#11 0x00007f3f6e75eb53 in dictkeys_decref (dk=0x560896aa9ad0, interp=0x7f3f6ebf4310 <_PyRuntime+76368>) at Objects/dictobject.c:333
#12 dict_dealloc (mp=0x7f3f69b31c40) at Objects/dictobject.c:2374
#13 0x00007f3f6e815c96 in _Py_Dealloc (
    op={'transport': <TestTransport at remote 0x7f3f6985f740>, 'socket': <TestSocket at remote 0x7f3f6985ffe0>, '_connect_loop_wait': 0, 'parser': <XMLPullParser(_events_queue=<collections.deque at remote 0x7f3f6983e020>, _parser=<xml.etree.ElementTree.XMLParser at remote 0x7f3f6998dfc0>) at remote 0x7f3f69874350>, 'xml_depth': 0, 'xml_root': <xml.etree.ElementTree.Element at remote 0x7f3f6985a930>, 'force_starttls': None, 'disable_starttls': None, 'waiting_queue': <Queue(_maxsize=0, _getters=<collections.deque at remote 0x7f3f6983d4e0>, _putters=<collections.deque at remote 0x7f3f6983d3f0>, _unfinished_tasks=0, _finished=<Event(_waiters=<collections.deque at remote 0x7f3f6983d5d0>, _value=True) at remote 0x7f3f6985f680>, _queue=<collections.deque at remote 0x7f3f6983d6c0>, _loop=<_UnixSelectorEventLoop at remote 0x7f3f6c9314f0>) at remote 0x7f3f6985f6b0>, 'scheduled_events': {}, 'ssl_context': <SSLContext at remote 0x7f3f6c9bcdd0>, 'event_when_connected': 'connected', 'ciphers': None, 'ca_certs': None, 'keyfile': N...(truncated)) at Objects/object.c:2625
#14 Py_DECREF (
    op={'transport': <TestTransport at remote 0x7f3f6985f740>, 'socket': <TestSocket at remote 0x7f3f6985ffe0>, '_connect_loop_wait': 0, 'parser': <XMLPullParser(_events_queue=<collections.deque at remote 0x7f3f6983e020>, _parser=<xml.etree.ElementTree.XMLParser at remote 0x7f3f6998dfc0>) at remote 0x7f3f69874350>, 'xml_depth': 0, 'xml_root': <xml.etree.ElementTree.Element at remote 0x7f3f6985a930>, 'force_starttls': None, 'disable_starttls': None, 'waiting_queue': <Queue(_maxsize=0, _getters=<collections.deque at remote 0x7f3f6983d4e0>, _putters=<collections.deque at remote 0x7f3f6983d3f0>, _unfinished_tasks=0, _finished=<Event(_waiters=<collections.deque at remote 0x7f3f6983d5d0>, _value=True) at remote 0x7f3f6985f680>, _queue=<collections.deque at remote 0x7f3f6983d6c0>, _loop=<_UnixSelectorEventLoop at remote 0x7f3f6c9314f0>) at remote 0x7f3f6985f6b0>, 'scheduled_events': {}, 'ssl_context': <SSLContext at remote 0x7f3f6c9bcdd0>, 'event_when_connected': 'connected', 'ciphers': None, 'ca_certs': None, 'keyfile': N...(truncated)) at ./Include/object.h:706
#15 _PyObject_ClearManagedDict (obj=<ClientXMPP at remote 0x7f3f697d7b30>) at Objects/dictobject.c:5620
#16 subtype_clear (self=<ClientXMPP at remote 0x7f3f697d7b30>) at Objects/typeobject.c:1863
#17 0x00007f3f6e7825a2 in delete_garbage (old=<optimized out>, collectable=0x7ffdbb2aa190, gcstate=0x7f3f6ebf4380 <_PyRuntime+76480>, tstate=0x7f3f6ec51c10 <_PyRuntime+459600>) at Modules/gcmodule.c:1029
#18 gc_collect_main (tstate=0x7f3f6ec51c10 <_PyRuntime+459600>, generation=generation@entry=2, n_collected=n_collected@entry=0x0, n_uncollectable=n_uncollectable@entry=0x0, nofail=nofail@entry=1)
    at Modules/gcmodule.c:1303
#19 0x00007f3f6e891d5c in _PyGC_CollectNoFail (tstate=<optimized out>) at Modules/gcmodule.c:2135
#20 0x00007f3f6e8799f3 in Py_FinalizeEx () at Python/pylifecycle.c:1863
#21 0x00007f3f6e88b64a in Py_RunMain () at Modules/main.c:691
#22 0x00007f3f6e847eeb in Py_BytesMain (argc=<optimized out>, argv=<optimized out>) at Modules/main.c:743
#23 0x00007f3f6e452280 in ?? () from /usr/lib64/libc.so.6
#24 0x00007f3f6e452339 in __libc_start_main () from /usr/lib64/libc.so.6
#25 0x00005608959fc085 in _start ()
Hi, This is just a heads up that slixmpp ends up segfaulting during its tests with Python 3.12. Initially reported downstream at https://bugs.gentoo.org/916898. This isn't a slixmpp bug and in Gentoo, we've already reported it upstream to cpython at https://github.com/python/cpython/issues/111784 with a minimised reproducer based on slixmpp, but we figured we'd post this here to let people know in case they end up wondering why tests start to fail w/ 3.12. It _might_ be that the cpython people say there's also a slixmpp bug here but obviously cpython shouldn't segfault in any case. ``` [...] ---------------------------------------------------------------------- Ran 453 tests in 3.059s OK (skipped=22) Can't list './slixmpp' <<< >>> testing filter <<< testing filter /var/tmp/portage/dev-python/slixmpp-1.8.4/temp/environment: line 2591: 624 Segmentation fault (core dumped) "${@}" * ERROR: dev-python/slixmpp-1.8.4::gentoo failed (test phase): * Tests failed with python3.12 ``` ``` Core was generated by `python3.12 -m unittest discover -v'. Program terminated with signal SIGSEGV, Segmentation fault. #0 xmlparser_gc_clear (self=self@entry=0x7f3f6998dfc0) at ./Modules/_elementtree.c:3788 3788 EXPAT(st, ParserFree)(parser); (gdb) bt #0 xmlparser_gc_clear (self=self@entry=0x7f3f6998dfc0) at ./Modules/_elementtree.c:3788 #1 0x00007f3f6da1691b in xmlparser_dealloc (self=0x7f3f6998dfc0) at ./Modules/_elementtree.c:3813 #2 0x00007f3f6e7dc79e in _Py_Dealloc (op=<optimized out>) at Objects/object.c:2608 #3 Py_DECREF (op=<optimized out>) at ./Include/object.h:706 #4 Py_XDECREF (op=<optimized out>) at ./Include/object.h:799 #5 _PyObject_FreeInstanceAttributes ( self=<XMLPullParser(_events_queue=<collections.deque at remote 0x7f3f6983e020>, _parser=<xml.etree.ElementTree.XMLParser at remote 0x7f3f6998dfc0>) at remote 0x7f3f69874350>) at Objects/dictobject.c:5571 #6 subtype_dealloc (self=<XMLPullParser(_events_queue=<collections.deque at remote 0x7f3f6983e020>, _parser=<xml.etree.ElementTree.XMLParser at remote 0x7f3f6998dfc0>) at remote 0x7f3f69874350>) at Objects/typeobject.c:2017 #7 0x00007f3f6e75ed9f in _Py_Dealloc (op=<optimized out>) at Objects/object.c:2625 #8 Py_DECREF (op=<optimized out>) at ./Include/object.h:706 #9 Py_XDECREF (op=<optimized out>) at ./Include/object.h:799 #10 free_keys_object (interp=0x7f3f6ebf4310 <_PyRuntime+76368>, keys=0x560896aa9ad0) at Objects/dictobject.c:673 #11 0x00007f3f6e75eb53 in dictkeys_decref (dk=0x560896aa9ad0, interp=0x7f3f6ebf4310 <_PyRuntime+76368>) at Objects/dictobject.c:333 #12 dict_dealloc (mp=0x7f3f69b31c40) at Objects/dictobject.c:2374 #13 0x00007f3f6e815c96 in _Py_Dealloc ( op={'transport': <TestTransport at remote 0x7f3f6985f740>, 'socket': <TestSocket at remote 0x7f3f6985ffe0>, '_connect_loop_wait': 0, 'parser': <XMLPullParser(_events_queue=<collections.deque at remote 0x7f3f6983e020>, _parser=<xml.etree.ElementTree.XMLParser at remote 0x7f3f6998dfc0>) at remote 0x7f3f69874350>, 'xml_depth': 0, 'xml_root': <xml.etree.ElementTree.Element at remote 0x7f3f6985a930>, 'force_starttls': None, 'disable_starttls': None, 'waiting_queue': <Queue(_maxsize=0, _getters=<collections.deque at remote 0x7f3f6983d4e0>, _putters=<collections.deque at remote 0x7f3f6983d3f0>, _unfinished_tasks=0, _finished=<Event(_waiters=<collections.deque at remote 0x7f3f6983d5d0>, _value=True) at remote 0x7f3f6985f680>, _queue=<collections.deque at remote 0x7f3f6983d6c0>, _loop=<_UnixSelectorEventLoop at remote 0x7f3f6c9314f0>) at remote 0x7f3f6985f6b0>, 'scheduled_events': {}, 'ssl_context': <SSLContext at remote 0x7f3f6c9bcdd0>, 'event_when_connected': 'connected', 'ciphers': None, 'ca_certs': None, 'keyfile': N...(truncated)) at Objects/object.c:2625 #14 Py_DECREF ( op={'transport': <TestTransport at remote 0x7f3f6985f740>, 'socket': <TestSocket at remote 0x7f3f6985ffe0>, '_connect_loop_wait': 0, 'parser': <XMLPullParser(_events_queue=<collections.deque at remote 0x7f3f6983e020>, _parser=<xml.etree.ElementTree.XMLParser at remote 0x7f3f6998dfc0>) at remote 0x7f3f69874350>, 'xml_depth': 0, 'xml_root': <xml.etree.ElementTree.Element at remote 0x7f3f6985a930>, 'force_starttls': None, 'disable_starttls': None, 'waiting_queue': <Queue(_maxsize=0, _getters=<collections.deque at remote 0x7f3f6983d4e0>, _putters=<collections.deque at remote 0x7f3f6983d3f0>, _unfinished_tasks=0, _finished=<Event(_waiters=<collections.deque at remote 0x7f3f6983d5d0>, _value=True) at remote 0x7f3f6985f680>, _queue=<collections.deque at remote 0x7f3f6983d6c0>, _loop=<_UnixSelectorEventLoop at remote 0x7f3f6c9314f0>) at remote 0x7f3f6985f6b0>, 'scheduled_events': {}, 'ssl_context': <SSLContext at remote 0x7f3f6c9bcdd0>, 'event_when_connected': 'connected', 'ciphers': None, 'ca_certs': None, 'keyfile': N...(truncated)) at ./Include/object.h:706 #15 _PyObject_ClearManagedDict (obj=<ClientXMPP at remote 0x7f3f697d7b30>) at Objects/dictobject.c:5620 #16 subtype_clear (self=<ClientXMPP at remote 0x7f3f697d7b30>) at Objects/typeobject.c:1863 #17 0x00007f3f6e7825a2 in delete_garbage (old=<optimized out>, collectable=0x7ffdbb2aa190, gcstate=0x7f3f6ebf4380 <_PyRuntime+76480>, tstate=0x7f3f6ec51c10 <_PyRuntime+459600>) at Modules/gcmodule.c:1029 #18 gc_collect_main (tstate=0x7f3f6ec51c10 <_PyRuntime+459600>, generation=generation@entry=2, n_collected=n_collected@entry=0x0, n_uncollectable=n_uncollectable@entry=0x0, nofail=nofail@entry=1) at Modules/gcmodule.c:1303 #19 0x00007f3f6e891d5c in _PyGC_CollectNoFail (tstate=<optimized out>) at Modules/gcmodule.c:2135 #20 0x00007f3f6e8799f3 in Py_FinalizeEx () at Python/pylifecycle.c:1863 #21 0x00007f3f6e88b64a in Py_RunMain () at Modules/main.c:691 #22 0x00007f3f6e847eeb in Py_BytesMain (argc=<optimized out>, argv=<optimized out>) at Modules/main.c:743 #23 0x00007f3f6e452280 in ?? () from /usr/lib64/libc.so.6 #24 0x00007f3f6e452339 in __libc_start_main () from /usr/lib64/libc.so.6 #25 0x00005608959fc085 in _start () ```
Owner

Thanks, I actually missed that report and ended up wasting some of my (and cpython upstream people as well, but not too much) time days after it was fixed in the main cpython branch. Since this will be fixed in the next 3.12 release and does not appear to be wrong on our end, I am closing this.

Thanks, I actually missed that report and ended up wasting some of my (and cpython upstream people as well, but not too much) time days after it was fixed in the main cpython branch. Since this will be fixed in the next 3.12 release and does not appear to be wrong on our end, I am closing this.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: poezio/slixmpp#3486
No description provided.