Skip to content

Segfault in numcodecs/tests/test_vlen_bytes.py::test_encode_none #735

Closed

Description

@avalentino

I run the unit test suite in debian sid (x86_64) i get a segmentation fault:

python3.13 -m pytes -v --pyargs numcodecs
============================= test session starts ==============================
platform linux -- Python 3.13.2, pytest-8.3.5, pluggy-1.5.0 -- /usr/bin/python3.13
cachedir: .pytest_cache
rootdir: /build/numcodecs-0.16.0+ds/.pybuild/cpython3_3.13_numcodecs/build
configfile: pyproject.toml
plugins: typeguard-4.4.2, cov-5.0.0
collecting ... collected 698 items / 27 deselected / 4 skipped / 671 selected

numcodecs/astype.py::numcodecs.astype.AsType PASSED                      [  0%]

[...]

numcodecs/tests/test_vlen_bytes.py::test_decode_errors PASSED            [ 96%]
numcodecs/tests/test_vlen_bytes.py::test_encode_none Fatal Python error: Aborted

Current thread 0x00007ebfefa2e100 (most recent call first):
  File "/build/numcodecs-0.16.0+ds/.pybuild/cpython3_3.13_numcodecs/build/numcodecs/tests/test_vlen_bytes.py", line 94 in test_encode_none
  File "/usr/lib/python3/dist-packages/_pytest/python.py", line 159 in pytest_pyfunc_call
  File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103 in _multicall
  File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120 in _hookexec
  File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513 in __call__
  File "/usr/lib/python3/dist-packages/_pytest/python.py", line 1627 in runtest
  File "/usr/lib/python3/dist-packages/_pytest/runner.py", line 174 in pytest_runtest_call
  File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103 in _multicall
  File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120 in _hookexec
  File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513 in __call__
  File "/usr/lib/python3/dist-packages/_pytest/runner.py", line 242 in <lambda>
  File "/usr/lib/python3/dist-packages/_pytest/runner.py", line 341 in from_call
  File "/usr/lib/python3/dist-packages/_pytest/runner.py", line 241 in call_and_report
  File "/usr/lib/python3/dist-packages/_pytest/runner.py", line 132 in runtestprotocol
  File "/usr/lib/python3/dist-packages/_pytest/runner.py", line 113 in pytest_runtest_protocol
  File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103 in _multicall
  File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120 in _hookexec
  File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513 in __call__
  File "/usr/lib/python3/dist-packages/_pytest/main.py", line 362 in pytest_runtestloop
  File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103 in _multicall
  File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120 in _hookexec
  File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513 in __call__
  File "/usr/lib/python3/dist-packages/_pytest/main.py", line 337 in _main
  File "/usr/lib/python3/dist-packages/_pytest/main.py", line 283 in wrap_session
  File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330 in pytest_cmdline_main
  File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103 in _multicall
  File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120 in _hookexec
  File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513 in __call__
  File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175 in main
  File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201 in console_main
  File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9 in <module>
  File "<frozen runpy>", line 88 in _run_code
  File "<frozen runpy>", line 198 in _run_module_as_main

Extension modules: numpy._core._multiarray_umath, numpy.linalg._umath_linalg, numcodecs.compat_ext, numcodecs.blosc, numcodecs.zstd, numcodecs.lz4, numcodecs._shuffle, numcodecs.jenkins, crc32c._crc32c, numcodecs.vlen, numcodecs.fletcher32, msgpack._cmsgpack, numpy.random._common, numpy.random.bit_generator, numpy.random._bounded_integers, numpy.random._mt19937, numpy.random.mtrand, numpy.random._philox, numpy.random._pcg64, numpy.random._sfc64, numpy.random._generator (total: 21)
Aborted (core dumped)

Activity

  1. jakirkham commented on Apr 9, 2025

    @jakirkham
    Member

    Thanks for the report! 🙏

    Are you able to run the test with gdb (perhaps like so)?

  2. jakirkham commented on Apr 9, 2025

    @jakirkham
    Member

    Looks like this happened before on macOS ( #683 )

    Appears we had skipped test on macOS in PR: #690

  3. jakirkham commented on Apr 10, 2025

    @jakirkham
    Member

    Was able to reproduce the issue. Did a bit more digging here: #683 (comment)

    Came up with a fix that works for me locally in PR: #736

    Please try it out and let us know how it goes 🙂

  4. avalentino commented on Apr 10, 2025

    @avalentino
    ContributorAuthor

    Thanks @jakirkham or the super-fast solution.
    I confirm that everything works fine with your patch.

  5. jakirkham commented on Apr 11, 2025

    @jakirkham
    Member

    Thanks Antonio! 🙏

    Appreciate the timely retesting

    Have gone ahead and merged

    This will show up in the next release

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