question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fatal Python error: Segmentation fault - test_arpack.py::test_symmetric_modes

See original GitHub issue

My issue is about a segmentation fault when trying to run tests.

Reproducing code example:

python runtests.py -v -s  sparse

Error message:

scipy/sparse/linalg/eigen/arpack/tests/test_arpack.py::test_symmetric_modes Fatal Python error: Segmentation fault

Current thread 0x00007fe14f9fa740 (most recent call first):
  File "/home/kaleab/Documents/Code/scipy/build/testenv/lib/python3.7/site-packages/scipy/_lib/_util.py", line 121 in _aligned_zeros
  File "/home/kaleab/Documents/Code/scipy/build/testenv/lib/python3.7/site-packages/scipy/sparse/linalg/eigen/arpack/arpack.py", line 518 in __init__
  File "/home/kaleab/Documents/Code/scipy/build/testenv/lib/python3.7/site-packages/scipy/sparse/linalg/eigen/arpack/arpack.py", line 1681 in eigsh
  File "/home/kaleab/Documents/Code/scipy/build/testenv/lib/python3.7/site-packages/scipy/sparse/linalg/eigen/arpack/tests/test_arpack.py", line 244 in eval_evec
  File "/home/kaleab/Documents/Code/scipy/build/testenv/lib/python3.7/site-packages/scipy/sparse/linalg/eigen/arpack/tests/test_arpack.py", line 404 in test_symmetric_modes
  File "/home/kaleab/.conda/envs/scipy/lib/python3.7/site-packages/_pytest/python.py", line 184 in pytest_pyfunc_call
  File "/home/kaleab/.conda/envs/scipy/lib/python3.7/site-packages/pluggy/callers.py", line 187 in _multicall
  File "/home/kaleab/.conda/envs/scipy/lib/python3.7/site-packages/pluggy/manager.py", line 87 in <lambda>
  File "/home/kaleab/.conda/envs/scipy/lib/python3.7/site-packages/pluggy/manager.py", line 93 in _hookexec
  File "/home/kaleab/.conda/envs/scipy/lib/python3.7/site-packages/pluggy/hooks.py", line 286 in __call__
  File "/home/kaleab/.conda/envs/scipy/lib/python3.7/site-packages/_pytest/python.py", line 1479 in runtest
  File "/home/kaleab/.conda/envs/scipy/lib/python3.7/site-packages/_pytest/runner.py", line 135 in pytest_runtest_call
  File "/home/kaleab/.conda/envs/scipy/lib/python3.7/site-packages/pluggy/callers.py", line 187 in _multicall
  File "/home/kaleab/.conda/envs/scipy/lib/python3.7/site-packages/pluggy/manager.py", line 87 in <lambda>
  File "/home/kaleab/.conda/envs/scipy/lib/python3.7/site-packages/pluggy/manager.py", line 93 in _hookexec
  File "/home/kaleab/.conda/envs/scipy/lib/python3.7/site-packages/pluggy/hooks.py", line 286 in __call__
  File "/home/kaleab/.conda/envs/scipy/lib/python3.7/site-packages/_pytest/runner.py", line 217 in <lambda>
  File "/home/kaleab/.conda/envs/scipy/lib/python3.7/site-packages/_pytest/runner.py", line 244 in from_call
  File "/home/kaleab/.conda/envs/scipy/lib/python3.7/site-packages/_pytest/runner.py", line 217 in call_runtest_hook
  File "/home/kaleab/.conda/envs/scipy/lib/python3.7/site-packages/_pytest/runner.py", line 186 in call_and_report
  File "/home/kaleab/.conda/envs/scipy/lib/python3.7/site-packages/_pytest/runner.py", line 100 in runtestprotocol
  File "/home/kaleab/.conda/envs/scipy/lib/python3.7/site-packages/_pytest/runner.py", line 85 in pytest_runtest_protocol
  File "/home/kaleab/.conda/envs/scipy/lib/python3.7/site-packages/pluggy/callers.py", line 187 in _multicall
  File "/home/kaleab/.conda/envs/scipy/lib/python3.7/site-packages/pluggy/manager.py", line 87 in <lambda>
  File "/home/kaleab/.conda/envs/scipy/lib/python3.7/site-packages/pluggy/manager.py", line 93 in _hookexec
  File "/home/kaleab/.conda/envs/scipy/lib/python3.7/site-packages/pluggy/hooks.py", line 286 in __call__
  File "/home/kaleab/.conda/envs/scipy/lib/python3.7/site-packages/_pytest/main.py", line 272 in pytest_runtestloop
  File "/home/kaleab/.conda/envs/scipy/lib/python3.7/site-packages/pluggy/callers.py", line 187 in _multicall
  File "/home/kaleab/.conda/envs/scipy/lib/python3.7/site-packages/pluggy/manager.py", line 87 in <lambda>
  File "/home/kaleab/.conda/envs/scipy/lib/python3.7/site-packages/pluggy/manager.py", line 93 in _hookexec
  File "/home/kaleab/.conda/envs/scipy/lib/python3.7/site-packages/pluggy/hooks.py", line 286 in __call__
  File "/home/kaleab/.conda/envs/scipy/lib/python3.7/site-packages/_pytest/main.py", line 247 in _main
  File "/home/kaleab/.conda/envs/scipy/lib/python3.7/site-packages/_pytest/main.py", line 191 in wrap_session
  File "/home/kaleab/.conda/envs/scipy/lib/python3.7/site-packages/_pytest/main.py", line 240 in pytest_cmdline_main
  File "/home/kaleab/.conda/envs/scipy/lib/python3.7/site-packages/pluggy/callers.py", line 187 in _multicall
  File "/home/kaleab/.conda/envs/scipy/lib/python3.7/site-packages/pluggy/manager.py", line 87 in <lambda>
  File "/home/kaleab/.conda/envs/scipy/lib/python3.7/site-packages/pluggy/manager.py", line 93 in _hookexec
  File "/home/kaleab/.conda/envs/scipy/lib/python3.7/site-packages/pluggy/hooks.py", line 286 in __call__
  File "/home/kaleab/.conda/envs/scipy/lib/python3.7/site-packages/_pytest/config/__init__.py", line 125 in main
  File "/home/kaleab/Documents/Code/scipy/build/testenv/lib/python3.7/site-packages/scipy/_lib/_testutils.py", line 67 in __call__
  File "runtests.py", line 313 in main
  File "runtests.py", line 525 in <module>
Segmentation fault (core dumped)

Scipy/Numpy/Python version information:

Python 3.7.7/python 3.6.0, pytest-5.4.1/ pytest 4.0.0 , py-1.8.1, pluggy-0.13.1, numpy 1.18.1 

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
mdhabercommented, Dec 31, 2020

This test is also failing on master intermittently, but not a segfault.

_____________________________ test_symmetric_modes _____________________________
[gw1] linux -- Python 3.7.9 /home/travis/virtualenv/python3.7.9/bin/python
/home/travis/virtualenv/python3.7.9/lib/python3.7/site-packages/scipy/sparse/linalg/eigen/arpack/tests/test_arpack.py:404: in test_symmetric_modes
    None, sigma, mattype, None, mode)
        D          = <std-symmetric>
        k          = 2
        mattype    = <function aslinearoperator at 0xffff8b48c9e0>
        mode       = 'buckling'
        modes      = ['normal', 'buckling', 'cayley']
        params     = <scipy.sparse.linalg.eigen.arpack.tests.test_arpack.SymmetricParams object at 0xffff41cb9e90>
        sigma      = 0.5
        symmetric  = True
        typ        = 'f'
        which      = 'LA'
/home/travis/virtualenv/python3.7.9/lib/python3.7/site-packages/scipy/sparse/linalg/eigen/arpack/tests/test_arpack.py:261: in eval_evec
    assert_allclose(LHS, RHS, rtol=rtol, atol=atol, err_msg=err)
E   AssertionError: 
E   Not equal to tolerance rtol=0.00178814, atol=0.000357628
E   error for eigsh:standard, typ=f, which=LA, sigma=0.5, mattype=aslinearoperator, OPpart=None, mode=buckling
E   Mismatched elements: 4 / 12 (33.3%)
E   Max absolute difference: 0.01493526
E   Max relative difference: 0.01093912
E    x: array([[-1.072405,  0.563614],
E          [-1.455584, -0.239151],
E          [-1.004519, -0.42866 ],...
E    y: array([[-1.073047,  0.563611],
E          [-1.456878, -0.239156],
E          [-0.998997, -0.428643],...
        LHS        = array([[-1.0724047 ,  0.56361365],
       [-1.4555839 , -0.23915069],
       [-1.0045193 , -0.42866027],
       [-1.0440447 , -0.32811955],
       [-1.5183451 , -0.34796414],
       [-1.4869674 ,  0.7027782 ]], dtype=float32)
        OPpart     = None
        RHS        = array([[-1.0730466 ,  0.56361085],
       [-1.4568783 , -0.23915628],
       [-0.998997  , -0.42864323],
       [-1.0327474 , -0.32808444],
       [-1.5052823 , -0.3479238 ],
       [-1.4720322 ,  0.7028245 ]], dtype=float32)
        a          = array([[1.7170051 , 1.3009547 , 0.9104259 , 0.97003126, 1.4632134 ,
        1.8256624 ],
       [1.3009547 , 2.253338 ...  1.9766154 ],
       [1.8256624 , 2.0743165 , 1.1501507 , 1.3169256 , 1.9766154 ,
        2.8176725 ]], dtype=float32)
        ac         = <6x6 MatrixLinearOperator with dtype=float32>
        atol       = 0.00035762786865234375
        d          = <std-symmetric>
        eigenvalues = array([9.827495 , 1.2812405], dtype=float32)
        eigs_func  = <function eigsh at 0xffff8b5077a0>
        err        = 'error for eigsh:standard, typ=f, which=LA, sigma=0.5, mattype=aslinearoperator, OPpart=None, mode=buckling'
        evec       = array([[-0.10918821,  0.43989468],
       [-0.14824514, -0.18665995],
       [-0.10165327, -0.3345533 ],
       [-0.10508756, -0.2560678 ],
       [-0.1531705 , -0.2715523 ],
       [-0.14978713,  0.54855   ]], dtype=float32)
        exact_eval = array([9.884308+0.j, 1.281241+0.j], dtype=complex64)
        general    = False
        ind        = array([1, 0])
        k          = 2
        kwargs     = {'mode': 'buckling', 'sigma': 0.5, 'tol': 3.5762786865234375e-06, 'v0': None, ...}
        mattype    = <function aslinearoperator at 0xffff8b48c9e0>
        mode       = 'buckling'
        ntries     = 0
        rtol       = 0.0017881393432617188
        sigma      = 0.5
        symmetric  = True
        typ        = 'f'
        v0         = None
        which      = 'LA'
0reactions
rgommerscommented, Apr 26, 2020

The output of conda list may be useful here. Also OS and compiler versions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tests run when called by name but seg fault when part of a ...
Hi, I'm running the python3-pytest package of Ubuntu 18.04, v3.3.2-2, with cov-2.5.1 from a package and faulthandler-1.5.0 from pip.
Read more >
What causes a Python segmentation fault? - Stack Overflow
This happens when a python extension (written in C) tries to access a memory beyond reach. You can trace it in following ways....
Read more >
runtime/interp/thread state refactoring leads to segmentation ...
The segfault either happens in the `ssl` module or the `selectors` ... test/test_reproduce.py Fatal Python error: Segmentation fault Thread ...
Read more >
Solved: segmentation fault while pytest - Atlassian Community
Solved: Old builds stopped working recently. We get a segmanatation fault in something related to pymongo / or maybe to tensorflow.
Read more >
Fatal Python error: Segmentation fault - PyMC Discourse
Hello everyone, I am struggling with the segmentation error while using pymc4. Any help will be very much appreciated.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found