fromxml.etree.ElementTreeimportElement, SubElementclassT(str):
def__eq__(self, other):
root.clear()
returnTrueroot=Element('a')
SubElement(root, T('a')).text=str(object())
repr(root.findtext('a'))Objects/object.c:766:19: runtime error: member access within misaligned address 0xdddddddddddddddd for type 'struct PyTypeObject', which requires 8 byte alignment
0xdddddddddddddddd: note: pointer points here
<memory cannot be printed>
Segmentation fault (core dumped)
Crash report
What happened?
Similar to #126037.
Under UBSan results in:
CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
Output from running 'python -VV' on the command line:
No response
Linked PRs
Element.findtext()#148738Element.findtext()(GH-148738) #148916Element.findtext()(GH-148738) #148923