Skip to content

Segfault when testing test_reinitialize_module #203

Description

@mweinelt

With xmlsec 1.2.33, typing_extensions 4.1.1, mypy_extensions 0.4.3. Excluding test_xmlsec.py makes the remaining test work. Trying to pin-point the package update that broke this.

============================= test session starts ==============================
platform linux -- Python 3.9.10, pytest-7.0.1, pluggy-1.0.0
rootdir: /build/xmlsec-1.3.12
plugins: hypothesis-6.38.0
collected 165 items / 1 skipped / 164 selected                                 

tests/test_xmlsec.py Fatal Python error: Segmentation fault

Current thread 0x00007ffff7832b80 (most recent call first):
  File "/build/xmlsec-1.3.12/tests/test_xmlsec.py", line 14 in test_reinitialize_module
  File "/nix/store/4nc88s687709yzy8pz7k987fpzhfbj0f-python3-3.9.10/lib/python3.9/unittest/case.py", line 550 in _callTestMethod
  File "/nix/store/4nc88s687709yzy8pz7k987fpzhfbj0f-python3-3.9.10/lib/python3.9/unittest/case.py", line 592 in run
  File "/build/xmlsec-1.3.12/tests/base.py", line 57 in run
  File "/nix/store/4nc88s687709yzy8pz7k987fpzhfbj0f-python3-3.9.10/lib/python3.9/unittest/case.py", line 651 in __call__
  File "/nix/store/6c9iqs6x50545pd3sg6qjbv01h8lwzaw-python3.9-pytest-7.0.1/lib/python3.9/site-packages/_pytest/unittest.py", line 327 in runtest
  File "/nix/store/6c9iqs6x50545pd3sg6qjbv01h8lwzaw-python3.9-pytest-7.0.1/lib/python3.9/site-packages/_pytest/runner.py", line 168 in pytest_runtest_call
  File "/nix/store/iwbyv0fk6sx0ihshpf0pw1ligp1qmdwg-python3.9-pluggy-1.0.0/lib/python3.9/site-packages/pluggy/_callers.py", line 39 in _multicall
  File "/nix/store/iwbyv0fk6sx0ihshpf0pw1ligp1qmdwg-python3.9-pluggy-1.0.0/lib/python3.9/site-packages/pluggy/_manager.py", line 80 in _hookexec
  File "/nix/store/iwbyv0fk6sx0ihshpf0pw1ligp1qmdwg-python3.9-pluggy-1.0.0/lib/python3.9/site-packages/pluggy/_hooks.py", line 265 in __call__
  File "/nix/store/6c9iqs6x50545pd3sg6qjbv01h8lwzaw-python3.9-pytest-7.0.1/lib/python3.9/site-packages/_pytest/runner.py", line 261 in <lambda>
  File "/nix/store/6c9iqs6x50545pd3sg6qjbv01h8lwzaw-python3.9-pytest-7.0.1/lib/python3.9/site-packages/_pytest/runner.py", line 340 in from_call
  File "/nix/store/6c9iqs6x50545pd3sg6qjbv01h8lwzaw-python3.9-pytest-7.0.1/lib/python3.9/site-packages/_pytest/runner.py", line 260 in call_runtest_hook
  File "/nix/store/6c9iqs6x50545pd3sg6qjbv01h8lwzaw-python3.9-pytest-7.0.1/lib/python3.9/site-packages/_pytest/runner.py", line 221 in call_and_report
  File "/nix/store/6c9iqs6x50545pd3sg6qjbv01h8lwzaw-python3.9-pytest-7.0.1/lib/python3.9/site-packages/_pytest/runner.py", line 132 in runtestprotocol
  File "/nix/store/6c9iqs6x50545pd3sg6qjbv01h8lwzaw-python3.9-pytest-7.0.1/lib/python3.9/site-packages/_pytest/runner.py", line 113 in pytest_runtest_protocol
  File "/nix/store/iwbyv0fk6sx0ihshpf0pw1ligp1qmdwg-python3.9-pluggy-1.0.0/lib/python3.9/site-packages/pluggy/_callers.py", line 39 in _multicall
  File "/nix/store/iwbyv0fk6sx0ihshpf0pw1ligp1qmdwg-python3.9-pluggy-1.0.0/lib/python3.9/site-packages/pluggy/_manager.py", line 80 in _hookexec
  File "/nix/store/iwbyv0fk6sx0ihshpf0pw1ligp1qmdwg-python3.9-pluggy-1.0.0/lib/python3.9/site-packages/pluggy/_hooks.py", line 265 in __call__
  File "/nix/store/6c9iqs6x50545pd3sg6qjbv01h8lwzaw-python3.9-pytest-7.0.1/lib/python3.9/site-packages/_pytest/main.py", line 347 in pytest_runtestloop
  File "/nix/store/iwbyv0fk6sx0ihshpf0pw1ligp1qmdwg-python3.9-pluggy-1.0.0/lib/python3.9/site-packages/pluggy/_callers.py", line 39 in _multicall
  File "/nix/store/iwbyv0fk6sx0ihshpf0pw1ligp1qmdwg-python3.9-pluggy-1.0.0/lib/python3.9/site-packages/pluggy/_manager.py", line 80 in _hookexec
  File "/nix/store/iwbyv0fk6sx0ihshpf0pw1ligp1qmdwg-python3.9-pluggy-1.0.0/lib/python3.9/site-packages/pluggy/_hooks.py", line 265 in __call__
  File "/nix/store/6c9iqs6x50545pd3sg6qjbv01h8lwzaw-python3.9-pytest-7.0.1/lib/python3.9/site-packages/_pytest/main.py", line 322 in _main
  File "/nix/store/6c9iqs6x50545pd3sg6qjbv01h8lwzaw-python3.9-pytest-7.0.1/lib/python3.9/site-packages/_pytest/main.py", line 268 in wrap_session
  File "/nix/store/6c9iqs6x50545pd3sg6qjbv01h8lwzaw-python3.9-pytest-7.0.1/lib/python3.9/site-packages/_pytest/main.py", line 315 in pytest_cmdline_main
  File "/nix/store/iwbyv0fk6sx0ihshpf0pw1ligp1qmdwg-python3.9-pluggy-1.0.0/lib/python3.9/site-packages/pluggy/_callers.py", line 39 in _multicall
  File "/nix/store/iwbyv0fk6sx0ihshpf0pw1ligp1qmdwg-python3.9-pluggy-1.0.0/lib/python3.9/site-packages/pluggy/_manager.py", line 80 in _hookexec
  File "/nix/store/iwbyv0fk6sx0ihshpf0pw1ligp1qmdwg-python3.9-pluggy-1.0.0/lib/python3.9/site-packages/pluggy/_hooks.py", line 265 in __call__
  File "/nix/store/6c9iqs6x50545pd3sg6qjbv01h8lwzaw-python3.9-pytest-7.0.1/lib/python3.9/site-packages/_pytest/config/__init__.py", line 165 in main
  File "/nix/store/6c9iqs6x50545pd3sg6qjbv01h8lwzaw-python3.9-pytest-7.0.1/lib/python3.9/site-packages/_pytest/config/__init__.py", line 188 in console_main
  File "/nix/store/6c9iqs6x50545pd3sg6qjbv01h8lwzaw-python3.9-pytest-7.0.1/lib/python3.9/site-packages/pytest/__main__.py", line 5 in <module>
  File "/nix/store/4nc88s687709yzy8pz7k987fpzhfbj0f-python3-3.9.10/lib/python3.9/runpy.py", line 87 in _run_code
  File "/nix/store/4nc88s687709yzy8pz7k987fpzhfbj0f-python3-3.9.10/lib/python3.9/runpy.py", line 197 in _run_module_as_main
/nix/store/jwmvl741k8md09cfhwf9bds380123vqv-pytest-check-hook/nix-support/setup-hook: line 53:   211 Segmentation fault      (core dumped) /nix/store/4nc88s687709yzy8pz7k987fpzhfbj0f-python3-3.9.10/bin/python3.9 -m pytest --ignore="tests/test_doc_examples.py" --deselect=tests/test_xmlsec.py::test_reinitialize_module
builder for '/nix/store/2zrv3w28bkrw010hq1720nxrsv625ryg-python3.9-xmlsec-1.3.12.drv' failed with exit code 139

Activity

  1. mweinelt commented on Mar 6, 2022

    @mweinelt
    Author

    Seems to be related to the PyTest 7.0 update.

  2. andyrtr commented on Apr 22, 2026

    @andyrtr

    I'm running into a very similar issue now:

    ============================= test session starts ==============================
    platform linux -- Python 3.14.4, pytest-9.0.3, pluggy-1.6.0 -- /usr/bin/python
    cachedir: .pytest_cache
    hypothesis profile 'default'
    rootdir: /build/python-xmlsec/src/python-xmlsec
    configfile: pyproject.toml
    plugins: hypothesis-6.152.1
    collecting ... collected 290 items / 1 skipped
    
    tests/test_xmlsec.py::TestModule::test_reinitialize_module Fatal Python error: Segmentation fault
    
    Current thread 0x00007f38b1023b80 [pytest] (most recent call first):
      File "/build/python-xmlsec/src/python-xmlsec/tests/test_xmlsec.py", line 13 in test_reinitialize_module
      File "/usr/lib/python3.14/unittest/case.py", line 615 in _callTestMethod
      File "/usr/lib/python3.14/unittest/case.py", line 669 in run
      File "/build/python-xmlsec/src/python-xmlsec/tests/base.py", line 37 in run
      File "/usr/lib/python3.14/unittest/case.py", line 725 in __call__
      File "/usr/lib/python3.14/site-packages/_pytest/unittest.py", line 389 in runtest
      File "/usr/lib/python3.14/site-packages/_pytest/runner.py", line 179 in pytest_runtest_call
      File "/usr/lib/python3.14/site-packages/pluggy/_callers.py", line 121 in _multicall
      File "/usr/lib/python3.14/site-packages/pluggy/_manager.py", line 120 in _hookexec
      File "/usr/lib/python3.14/site-packages/pluggy/_hooks.py", line 512 in __call__
      File "/usr/lib/python3.14/site-packages/_pytest/runner.py", line 245 in <lambda>
      File "/usr/lib/python3.14/site-packages/_pytest/runner.py", line 353 in from_call
      File "/usr/lib/python3.14/site-packages/_pytest/runner.py", line 244 in call_and_report
      File "/usr/lib/python3.14/site-packages/_pytest/runner.py", line 137 in runtestprotocol
      File "/usr/lib/python3.14/site-packages/_pytest/runner.py", line 118 in pytest_runtest_protocol
      File "/usr/lib/python3.14/site-packages/pluggy/_callers.py", line 121 in _multicall
      File "/usr/lib/python3.14/site-packages/pluggy/_manager.py", line 120 in _hookexec
      File "/usr/lib/python3.14/site-packages/pluggy/_hooks.py", line 512 in __call__
      File "/usr/lib/python3.14/site-packages/_pytest/main.py", line 396 in pytest_runtestloop
      File "/usr/lib/python3.14/site-packages/pluggy/_callers.py", line 121 in _multicall
      File "/usr/lib/python3.14/site-packages/pluggy/_manager.py", line 120 in _hookexec
      File "/usr/lib/python3.14/site-packages/pluggy/_hooks.py", line 512 in __call__
      File "/usr/lib/python3.14/site-packages/_pytest/main.py", line 372 in _main
      File "/usr/lib/python3.14/site-packages/_pytest/main.py", line 318 in wrap_session
      File "/usr/lib/python3.14/site-packages/_pytest/main.py", line 365 in pytest_cmdline_main
      File "/usr/lib/python3.14/site-packages/pluggy/_callers.py", line 121 in _multicall
      File "/usr/lib/python3.14/site-packages/pluggy/_manager.py", line 120 in _hookexec
      File "/usr/lib/python3.14/site-packages/pluggy/_hooks.py", line 512 in __call__
      File "/usr/lib/python3.14/site-packages/_pytest/config/__init__.py", line 199 in main
      File "/usr/lib/python3.14/site-packages/_pytest/config/__init__.py", line 223 in console_main
      File "/usr/bin/pytest", line 8 in <module>
    
    Current thread's C stack trace (most recent call first):
      Binary file "/usr/lib/libpython3.14.so.1.0", at _Py_DumpStack+0x4d [0x7f38b0b3a9ae]
      Binary file "/usr/lib/libpython3.14.so.1.0", at +0x13b1f1 [0x7f38b0b3b1f1]
      Binary file "/usr/lib/libc.so.6", at +0x3e2d0 [0x7f38b063e2d0]
      Binary file "/usr/lib/libc.so.6", at __pthread_rwlock_rdlock+0x11 [0x7f38b069c531]
      Binary file "/usr/lib/libcrypto.so.3", at CRYPTO_THREAD_read_lock+0xe [0x7f38ae7a3c7e]
      Binary file "/usr/lib/libcrypto.so.3", at ERR_lib_error_string+0x67 [0x7f38ae73eca7]
      Binary file "/usr/lib/libcrypto.so.3", at +0x13fa65 [0x7f38ae73fa65]
      Binary file "/usr/lib/libxmlsec1-openssl.so", at xmlSecOpenSSLAppInit+0x8e [0x7f38adadfe6b]
      Binary file "/usr/lib/libxmlsec1.so.10311", at xmlSecCryptoAppInit+0x3a [0x7f38adc80840]
      Binary file "/build/python-xmlsec/src/python-xmlsec/test_dir/usr/lib/python3.14/site-packages/xmlsec.cpython-314-x86_64-linux-gnu.so", at +0xf46c [0x7f38aebec46c]
      Binary file "/build/python-xmlsec/src/python-xmlsec/test_dir/usr/lib/python3.14/site-packages/xmlsec.cpython-314-x86_64-linux-gnu.so", at +0xf4ca [0x7f38aebec4ca]
      Binary file "/usr/lib/libpython3.14.so.1.0", at PyObject_Vectorcall+0x5d [0x7f38b0b7261d]
      Binary file "/usr/lib/libpython3.14.so.1.0", at _PyEval_EvalFrameDefault+0xaa17 [0x7f38b0b90187]
      Binary file "/usr/lib/libpython3.14.so.1.0", at +0x1b54cc [0x7f38b0bb54cc]
      Binary file "/usr/lib/libpython3.14.so.1.0", at +0x1fa0ee [0x7f38b0bfa0ee]
      Binary file "/usr/lib/libpython3.14.so.1.0", at +0x282ad5 [0x7f38b0c82ad5]
      Binary file "/usr/lib/libpython3.14.so.1.0", at _PyEval_EvalFrameDefault+0x464a [0x7f38b0b89dba]
      Binary file "/usr/lib/libpython3.14.so.1.0", at +0x1816a5 [0x7f38b0b816a5]
      Binary file "/usr/lib/libpython3.14.so.1.0", at +0x26d2fc [0x7f38b0c6d2fc]
      Binary file "/usr/lib/libpython3.14.so.1.0", at +0x2cd413 [0x7f38b0ccd413]
      Binary file "/usr/lib/libpython3.14.so.1.0", at _PyObject_MakeTpCall+0x46c [0x7f38b0b6fe0c]
      Binary file "/usr/lib/libpython3.14.so.1.0", at _PyEval_EvalFrameDefault+0xebbc [0x7f38b0b9432c]
      Binary file "/usr/lib/libpython3.14.so.1.0", at +0x1816a5 [0x7f38b0b816a5]
      Binary file "/usr/lib/libpython3.14.so.1.0", at +0x26d2fc [0x7f38b0c6d2fc]
      Binary file "/usr/lib/libpython3.14.so.1.0", at +0x2cd413 [0x7f38b0ccd413]
      Binary file "/usr/lib/libpython3.14.so.1.0", at +0x282a3a [0x7f38b0c82a3a]
      Binary file "/usr/lib/libpython3.14.so.1.0", at _PyEval_EvalFrameDefault+0x464a [0x7f38b0b89dba]
      Binary file "/usr/lib/libpython3.14.so.1.0", at +0x1816a5 [0x7f38b0b816a5]
      Binary file "/usr/lib/libpython3.14.so.1.0", at +0x26d2fc [0x7f38b0c6d2fc]
      Binary file "/usr/lib/libpython3.14.so.1.0", at +0x2cd413 [0x7f38b0ccd413]
      Binary file "/usr/lib/libpython3.14.so.1.0", at _PyObject_MakeTpCall+0x46c [0x7f38b0b6fe0c]
      Binary file "/usr/lib/libpython3.14.so.1.0", at _PyEval_EvalFrameDefault+0xebbc [0x7f38b0b9432c]
      <truncated rest of calls>
    
    Extension modules: lxml._elementpath, lxml.etree, xmlsec (total: 3)
    /startdir/PKGBUILD: line 30:  1314 Segmentation fault         (core dumped) pytest -vv
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions