python crash in lxml with "Element("parent").find("bar")"

Bug #1972907 reported by Alexis Murzeau
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lxml
Fix Released
High
scoder

Bug Description

Hi,

When doing this on a Debian sid machine:
# apt get install locales-all
$ LC_ALL=zh_CN python3 -c 'from lxml.etree import Element; Element("parent").find("bar")'

Python crashes with a segmentation fault.
Without "LC_ALL=zh_CN", it works fine.

It may be related to this issue in Cython:
[BUG] Possible segfault in exception handling code #4722
https://github.com/cython/cython/issues/4722

This crashes too (using the same env values as in the above bug report):
LC_ALL="" LANG="en_US.ISO8859-15" python3 -c 'from lxml.etree import Element; Element("parent").find("bar")'

This bug is encountered when doing reproducible builds tests using reprotest.

gdb backtrace: see in attachment.

This is with these packages:
 - python3.10 3.10.4-3
 - python3-lxml 4.8.0-1
 - locales-all 2.33-7

Python : sys.version_info(major=3, minor=10, micro=4, releaselevel='final', serial=0)
lxml.etree : (4, 8, 0, 0)
libxml used : (2, 9, 13)
libxml compiled : (2, 9, 12)
libxslt used : (1, 1, 34)
libxslt compiled : (1, 1, 34)

Revision history for this message
Alexis Murzeau (amubtdx) wrote :
description: updated
description: updated
Revision history for this message
bastimeyer (bastimeyer) wrote :

The cython issue at
https://github.com/cython/cython/issues/4722
has been fixed, and recent lxml builds seem to be working fine with the updated cython version.

lxml 4.9.0-2 doesn't seem to have been pushed to pypi though:
https://github.com/lxml/lxml/releases/tag/lxml-4.9.0-2
https://pypi.org/project/lxml/#history

Could you please fix that? Since this release is just a couple of hours old, I'm not sure if this is already being looked into.

Thanks!

Related issue:
https://github.com/streamlink/streamlink/issues/4562

Revision history for this message
scoder (scoder) wrote :

This has been fixed in lxml 4.9.0.

Changed in lxml:
milestone: none → 4.9.3
assignee: nobody → scoder (scoder)
importance: Undecided → High
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.