-
Notifications
You must be signed in to change notification settings - Fork 99
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
Segmentation fault on xmlsec.tree.add_ids()
in Python Development Mode
#259
Comments
I checked whether this is an lxml <-> xmlsec issue, but it is not: $ pip install --no-binary :all: --force-reinstall lxml
$ PYTHONDEVMODE=1 python boom.py
(...)
Segmentation fault |
Hello just had a similar problem with xmlsec.tree.add_ids Brgds JL |
@jlthorel You saved my life...!! 👍 |
This fixed a problem for me too. It was causing a SAML SSO login failure for me. Has anyone submitted a bug to lxml? Their bug tracker is here: https://launchpad.net/lxml |
@jlthorel You saved my life as well..! 💯 |
@jlthorel thank you for saving us as well! You are the best!!! |
@jlthorel You saved my life!! |
We had the same issue with our SAML SSO failing due to a seg fault, downgrading |
OMG, this was driving me crazy: my SAML SSO was failing most of the times, but sometimes it did work 😠 . |
I couldn't find any bug report about this, so I just submitted one: |
Thank you very much! This solution worked for me too. |
The folks at lxml closed the report. |
I believe commit ee9fbd0 by @jonathangreen avoids the segfault without any error message, and emits instead an exception ("lxml & xmlsec libxml2 library version mismatch"). However, it's still not clear to me what we should do to avoid it. |
Hi @quique. My comment here gives some context #316 (comment) that might be helpful. Basically to avoid the issue, either both The most recent release for |
@jonathangreen Thank you for your helpful comment! Unfortunately it seems I'm quite thick today, because I am unable to make it work. This is what I do: docker run -it python:3.12-slim-bookworm /bin/bash
# Place sign1-res.xml and boom.py inside the container (see the issue report by @Anthchirp )
pip install lxml --only-binary=lxml
pip install xmlsec --only-binary=xmlsec
PYTHONDEVMODE=1 python boom.py # See it crash If I understand it correctly, this way both root@d199d2820803:/# pip install lxml --only-binary=lxml
Collecting lxml
Downloading lxml-5.2.1-cp312-cp312-manylinux_2_28_x86_64.whl.metadata (3.4 kB)
Downloading lxml-5.2.1-cp312-cp312-manylinux_2_28_x86_64.whl (4.9 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.9/4.9 MB 7.5 MB/s eta 0:00:00
Installing collected packages: lxml
Successfully installed lxml-5.2.1
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
root@d199d2820803:/# pip install xmlsec --only-binary=xmlsec
Collecting xmlsec
Downloading xmlsec-1.3.14-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (7.3 kB)
Requirement already satisfied: lxml>=3.8 in /usr/local/lib/python3.12/site-packages (from xmlsec) (5.2.1)
Downloading xmlsec-1.3.14-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.9 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.9/3.9 MB 7.2 MB/s eta 0:00:00
Installing collected packages: xmlsec
Successfully installed xmlsec-1.3.14
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
root@d199d2820803:/# python boom.py
root@d199d2820803:/# PYTHONDEVMODE=1 python boom.py
Debug memory block at address p=0x56499b02ca70: API '!'
6873730420813529088 bytes originally requested
The 7 pad bytes at p-7 are not all FORBIDDENBYTE (0xfd):
at p-7: 0x00 *** OUCH
at p-6: 0x00 *** OUCH
at p-5: 0x00 *** OUCH
at p-4: 0x00 *** OUCH
at p-3: 0x00 *** OUCH
at p-2: 0x00 *** OUCH
at p-1: 0x00 *** OUCH
Because memory is corrupted at the start, the count of bytes requested
may be bogus, and checking the trailing pad bytes may segfault.
The 8 pad bytes at tail=0x5f64bbafc965ca70 are Fatal Python error: Segmentation fault
Current thread 0x00007fb0f0a63740 (most recent call first):
File "//boom.py", line 6 in <module>
Extension modules: lxml._elementpath, lxml.etree, xmlsec (total: 3)
Segmentation fault (core dumped) Any hint? Thank you! |
boom.py:
with
sign-res.xml
coming from the xmlsec examples.Expected output
Observed output
Environment
I'm running on Ubuntu 22.04 with system python 3.10.6 and xmlsec 1.3.13.
pip list
apt list | grep xmlsec | grep installed
The text was updated successfully, but these errors were encountered: