xmlsec / python-xmlsec

Python bindings for the XML Security Library.
MIT License
93 stars 97 forks source link

"Fatal Python error: Segmentation fault" in CI #287

Closed deronnax closed 6 months ago

deronnax commented 6 months ago

Does anyone have an idea of what is this error we are getting in the CI? It's happening both on linux (job) and macOS (link):

tests/test_ds.py::TestSignContext::test_no_key PASSED                    [ 47%]
Fatal Python error: Floating point exception

Current thread 0x000000010defc600 (most recent call first):
  File "/Users/runner/work/python-xmlsec/python-xmlsec/tests/test_ds.py", line 51 in test_register_id
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/unittest/case.py", line 579 in _callTestMethod
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/unittest/case.py", line 623 in run
[...]

I am willing to fix the CI but I have no solution for this error.

jonathangreen commented 6 months ago

This looks to me like its the same error as this https://github.com/xmlsec/python-xmlsec/issues/277 since lxml is being installed from a wheel https://github.com/xmlsec/python-xmlsec/actions/runs/8271024317/job/22629856568#step:7:36 and there is a libxml2 mismatch between what they ship with and what xmlsec is being compiled against.

jonathangreen commented 6 months ago

It seems like https://github.com/xmlsec/python-xmlsec/issues/283 is probably the right fix here, but maybe a stopgap would be to figure out what version of libxml2 lxml uses and package up wheels that are statically linked against that version, so the wheels for lxml and xmlsec will play nicely together.

jonathangreen commented 6 months ago

@deronnax I made a PR here that updates the CI workflow to build wheels and run tests https://github.com/xmlsec/python-xmlsec/pull/288

deronnax commented 6 months ago

@jonathangreen I did several tests and indeed that's the problems you pointed. Thank you very much for this enlighten.