Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Segmentation fault during cleanup of the XMLPullParser #113583

Closed as not planned
Closed as not planned
@mathieui

Description

@mathieui

Crash report

What happened?

This is the issue found while debugging #113566. I have not been able to extract a proper minimal viable reproduction code. It does seem to depend on whether some things are tied to asyncio.
This happens upon exit.

I will try to isolate a better case, but in the meantime, in case someone knows the ins and out of the expat mechanisms and has an idea about it, here is the backtrace:

Program received signal SIGSEGV, Segmentation fault.
bt0x00007f827c3acf90 in xmlparser_gc_clear (self=self@entry=0x7f827bf4f250) at ./Modules/_elementtree.c:3788
3788    ./Modules/_elementtree.c: No such file or directory.
(gdb) bt
#0  0x00007f827c3acf90 in xmlparser_gc_clear (self=self@entry=0x7f827bf4f250) at ./Modules/_elementtree.c:3788
#1  0x00007f827c3aeba7 in xmlparser_dealloc (self=0x7f827bf4f250) at ./Modules/_elementtree.c:3813
#2  0x00007f827d4e2d95 in _Py_Dealloc (op=<optimized out>) at Objects/object.c:2625
#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 0x7f827bdd93f0>, _parser=<xml.etree.ElementTree.XMLParser at remote 0x7f827bf4f250>) at remote 0x7f827be049e0>)
    at Objects/dictobject.c:5571
#6  subtype_dealloc (self=<XMLPullParser(_events_queue=<collections.deque at remote 0x7f827bdd93f0>, _parser=<xml.etree.ElementTree.XMLParser at remote 0x7f827bf4f250>) at remote 0x7f827be049e0>) at Objects/typeobject.c:2017
#7  0x00007f827d4a9308 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=0x7f827d837728 <_PyRuntime+76392>, keys=0x55c5909de360) at Objects/dictobject.c:673
#11 0x00007f827d4a9169 in dictkeys_decref (dk=0x55c5909de360, interp=0x7f827d837728 <_PyRuntime+76392>) at Objects/dictobject.c:333
#12 dict_dealloc (mp=0x7f827cd18c00) at Objects/dictobject.c:2374
#13 0x00007f827d53dab4 in subtype_clear (self=<ClientXMPP at remote 0x7f827cf54ef0>) at Objects/typeobject.c:1863
#14 0x00007f827d4bd54d in delete_garbage (old=0x7f827d8377e0 <_PyRuntime+76576>, collectable=0x7ffd0b8053f0, gcstate=0x7f827d837798 <_PyRuntime+76504>, tstate=0x7f827d895048 <_PyRuntime+459656>) at Modules/gcmodule.c:1029
#15 gc_collect_main (tstate=0x7f827d895048 <_PyRuntime+459656>, 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
#16 0x00007f827d53d51c in _PyGC_CollectNoFail (tstate=<optimized out>) at Modules/gcmodule.c:2135
#17 0x00007f827d526cb2 in Py_FinalizeEx () at Python/pylifecycle.c:1889
#18 0x00007f827d536ddd in Py_RunMain () at Modules/main.c:711
#19 0x00007f827d4f10d7 in Py_BytesMain (argc=<optimized out>, argv=<optimized out>) at Modules/main.c:763
#20 0x00007f827d0b71ca in __libc_start_call_main (main=main@entry=0x55c58e9c2140 <main>, argc=argc@entry=2, argv=argv@entry=0x7ffd0b8057e8) at ../sysdeps/nptl/libc_start_call_main.h:58
#21 0x00007f827d0b7285 in __libc_start_main_impl (main=0x55c58e9c2140 <main>, argc=2, argv=0x7ffd0b8057e8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffd0b8057d8) at ../csu/libc-start.c:360
#22 0x000055c58e9c2071 in _start ()

py-bt only says Garbage-collecting

CPython versions tested on:

3.12

Operating systems tested on:

Linux

Output from running 'python -VV' on the command line:

Python 3.12.1 (main, Dec 19 2023, 20:14:15) [GCC 12.2.0]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions