Closed MarcoGorelli closed 7 months ago
pytest-valgrind output:
$ PYTHONMALLOC=malloc valgrind --show-leak-kinds=definite --log-file=/tmp/valgrind-output \
python -m pytest -vv --valgrind --valgrind-log=/tmp/valgrind-output
============================================================================================== test session starts ==============================================================================================
platform linux -- Python 3.10.12, pytest-7.4.3, pluggy-1.3.0 -- /home/marcogorelli/pyo3-polars-dev/polars_business/venv/bin/python
cachedir: .pytest_cache
hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase(PosixPath('/home/marcogorelli/pyo3-polars-dev/polars_business/.hypothesis/examples'))
pytest-valgrind: logfile=/tmp/valgrind-output
pytest-valgrind: Reporting direct+indirect leaks and ignoring the
pytest-valgrind: `--errors-for-leak-kinds` valgrind option.
pytest-valgrind: Python always causes "possible" leaks but you can use
pytest-valgrind: `--errors-for-leak-kinds=direct` to hide indirect leaks.)
rootdir: /home/marcogorelli/pyo3-polars-dev/polars_business
plugins: valgrind-0.2.0, hypothesis-6.91.0
collected 2 items
tests/test_business_offsets.py::test_invalid_roll_strategy PASSED [ 50%]
tests/test_business_offsets.py::test_against_np_busday_count Fatal Python error: Segmentation fault
Current thread 0x0000000004bc3780 (most recent call first):
File "/home/marcogorelli/pyo3-polars-dev/polars_business/venv/lib/python3.10/site-packages/polars/series/series.py", line 420 in name
File "/home/marcogorelli/pyo3-polars-dev/polars_business/venv/lib/python3.10/site-packages/polars/functions/lit.py", line 117 in lit
File "/home/marcogorelli/pyo3-polars-dev/polars_business/tests/test_business_offsets.py", line 25 in test_against_np_busday_count
File "/home/marcogorelli/pyo3-polars-dev/polars_business/venv/lib/python3.10/site-packages/_pytest/python.py", line 194 in pytest_pyfunc_call
File "/home/marcogorelli/pyo3-polars-dev/polars_business/venv/lib/python3.10/site-packages/pluggy/_callers.py", line 77 in _multicall
File "/home/marcogorelli/pyo3-polars-dev/polars_business/venv/lib/python3.10/site-packages/pluggy/_manager.py", line 115 in _hookexec
File "/home/marcogorelli/pyo3-polars-dev/polars_business/venv/lib/python3.10/site-packages/pluggy/_hooks.py", line 493 in __call__
File "/home/marcogorelli/pyo3-polars-dev/polars_business/venv/lib/python3.10/site-packages/_pytest/python.py", line 1792 in runtest
File "/home/marcogorelli/pyo3-polars-dev/polars_business/venv/lib/python3.10/site-packages/_pytest/runner.py", line 169 in pytest_runtest_call
File "/home/marcogorelli/pyo3-polars-dev/polars_business/venv/lib/python3.10/site-packages/pluggy/_callers.py", line 77 in _multicall
File "/home/marcogorelli/pyo3-polars-dev/polars_business/venv/lib/python3.10/site-packages/pluggy/_manager.py", line 115 in _hookexec
File "/home/marcogorelli/pyo3-polars-dev/polars_business/venv/lib/python3.10/site-packages/pluggy/_hooks.py", line 493 in __call__
File "/home/marcogorelli/pyo3-polars-dev/polars_business/venv/lib/python3.10/site-packages/_pytest/runner.py", line 262 in <lambda>
File "/home/marcogorelli/pyo3-polars-dev/polars_business/venv/lib/python3.10/site-packages/_pytest/runner.py", line 341 in from_call
File "/home/marcogorelli/pyo3-polars-dev/polars_business/venv/lib/python3.10/site-packages/_pytest/runner.py", line 261 in call_runtest_hook
File "/home/marcogorelli/pyo3-polars-dev/polars_business/venv/lib/python3.10/site-packages/_pytest/runner.py", line 222 in call_and_report
File "/home/marcogorelli/pyo3-polars-dev/polars_business/venv/lib/python3.10/site-packages/_pytest/runner.py", line 133 in runtestprotocol
File "/home/marcogorelli/pyo3-polars-dev/polars_business/venv/lib/python3.10/site-packages/_pytest/runner.py", line 114 in pytest_runtest_protocol
File "/home/marcogorelli/pyo3-polars-dev/polars_business/venv/lib/python3.10/site-packages/pluggy/_callers.py", line 77 in _multicall
File "/home/marcogorelli/pyo3-polars-dev/polars_business/venv/lib/python3.10/site-packages/pluggy/_manager.py", line 115 in _hookexec
File "/home/marcogorelli/pyo3-polars-dev/polars_business/venv/lib/python3.10/site-packages/pluggy/_hooks.py", line 493 in __call__
File "/home/marcogorelli/pyo3-polars-dev/polars_business/venv/lib/python3.10/site-packages/_pytest/main.py", line 350 in pytest_runtestloop
File "/home/marcogorelli/pyo3-polars-dev/polars_business/venv/lib/python3.10/site-packages/pluggy/_callers.py", line 77 in _multicall
File "/home/marcogorelli/pyo3-polars-dev/polars_business/venv/lib/python3.10/site-packages/pluggy/_manager.py", line 115 in _hookexec
File "/home/marcogorelli/pyo3-polars-dev/polars_business/venv/lib/python3.10/site-packages/pluggy/_hooks.py", line 493 in __call__
File "/home/marcogorelli/pyo3-polars-dev/polars_business/venv/lib/python3.10/site-packages/_pytest/main.py", line 325 in _main
File "/home/marcogorelli/pyo3-polars-dev/polars_business/venv/lib/python3.10/site-packages/_pytest/main.py", line 271 in wrap_session
File "/home/marcogorelli/pyo3-polars-dev/polars_business/venv/lib/python3.10/site-packages/_pytest/main.py", line 318 in pytest_cmdline_main
File "/home/marcogorelli/pyo3-polars-dev/polars_business/venv/lib/python3.10/site-packages/pluggy/_callers.py", line 77 in _multicall
File "/home/marcogorelli/pyo3-polars-dev/polars_business/venv/lib/python3.10/site-packages/pluggy/_manager.py", line 115 in _hookexec
File "/home/marcogorelli/pyo3-polars-dev/polars_business/venv/lib/python3.10/site-packages/pluggy/_hooks.py", line 493 in __call__
File "/home/marcogorelli/pyo3-polars-dev/polars_business/venv/lib/python3.10/site-packages/_pytest/config/__init__.py", line 169 in main
File "/home/marcogorelli/pyo3-polars-dev/polars_business/venv/lib/python3.10/site-packages/_pytest/config/__init__.py", line 192 in console_main
File "/home/marcogorelli/pyo3-polars-dev/polars_business/venv/lib/python3.10/site-packages/pytest/__main__.py", line 5 in <module>
File "/usr/lib/python3.10/runpy.py", line 86 in _run_code
File "/usr/lib/python3.10/runpy.py", line 196 in _run_module_as_main
Extension modules: pytest_valgrind.valgrind (total: 1)
Segmentation fault
this has since been fixed in polars
I've posted the smallest reproducible example I could come up with here: https://github.com/MarcoGorelli/mcve-segfaulty-plugin
It doesn't always segfault, just sometimes (I tried running
pytest
now, and it failed 6 times out of 10)If I remove the argument
other
fromdef sub
, thenpytest
always passesI'll continue trying to narrow this down, but reporting in the meantime