Segfault when testing test.python.quantum_info.operators.channel
See original GitHub issueInformation
- Qiskit Terra version: master
- Python version: 3.5 and 3.7
- Operating system: MacOS
What is the current behavior?
When testing test.python.quantum_info.operators.channel I’m getting a Segmentation fault: 11, speficically when test.python.quantum_info.operators.channel.test_kraus.TestKraus.test_circuit_init is being executed. Notice that I have not errors when executing only that test:
$ python -q -X faulthandler -m unittest -v test.python.quantum_info.operators.channel.test_kraus.TestKraus.test_circuit_init
test_circuit_init (test.python.quantum_info.operators.channel.test_kraus.TestKraus)
Test initialization from a circuit. ... ok
----------------------------------------------------------------------
Ran 1 test in 0.058s
OK
Steps to reproduce the problem
python -q -X faulthandler -m unittest discover -v test.python.quantum_info.operators.channel
....
test_circuit_init (test.python.quantum_info.operators.channel.test_kraus.TestKraus)
Test initialization from a circuit. ... Fatal Python error: Segmentation fault
Current thread 0x0000000111c5c5c0 (most recent call first):
File "/Users/lucianobello/repos/qiskit-terra/venv/lib/python3.5/site-packages/scipy/linalg/decomp.py", line 432 in eigh
File "/Users/lucianobello/repos/qiskit-terra/qiskit/quantum_info/operators/channel/transformations.py", line 211 in _choi_to_kraus
File "/Users/lucianobello/repos/qiskit-terra/qiskit/quantum_info/operators/channel/transformations.py", line 81 in _to_kraus
File "/Users/lucianobello/repos/qiskit-terra/qiskit/quantum_info/operators/channel/kraus.py", line 144 in __init__
File "/Users/lucianobello/repos/qiskit-terra/test/python/quantum_info/operators/channel/test_kraus.py", line 64 in test_circuit_init
File "/Users/lucianobello/.pyenv/versions/3.5.6/lib/python3.5/unittest/case.py", line 605 in run
File "/Users/lucianobello/.pyenv/versions/3.5.6/lib/python3.5/unittest/case.py", line 653 in __call__
File "/Users/lucianobello/.pyenv/versions/3.5.6/lib/python3.5/unittest/suite.py", line 122 in run
File "/Users/lucianobello/.pyenv/versions/3.5.6/lib/python3.5/unittest/suite.py", line 84 in __call__
File "/Users/lucianobello/.pyenv/versions/3.5.6/lib/python3.5/unittest/suite.py", line 122 in run
File "/Users/lucianobello/.pyenv/versions/3.5.6/lib/python3.5/unittest/suite.py", line 84 in __call__
File "/Users/lucianobello/.pyenv/versions/3.5.6/lib/python3.5/unittest/suite.py", line 122 in run
File "/Users/lucianobello/.pyenv/versions/3.5.6/lib/python3.5/unittest/suite.py", line 84 in __call__
File "/Users/lucianobello/.pyenv/versions/3.5.6/lib/python3.5/unittest/runner.py", line 176 in run
File "/Users/lucianobello/.pyenv/versions/3.5.6/lib/python3.5/unittest/main.py", line 256 in runTests
File "/Users/lucianobello/.pyenv/versions/3.5.6/lib/python3.5/unittest/main.py", line 95 in __init__
File "/Users/lucianobello/.pyenv/versions/3.5.6/lib/python3.5/unittest/__main__.py", line 18 in <module>
File "/Users/lucianobello/.pyenv/versions/3.5.6/lib/python3.5/runpy.py", line 85 in _run_code
File "/Users/lucianobello/.pyenv/versions/3.5.6/lib/python3.5/runpy.py", line 193 in _run_module_as_main
Segmentation fault: 11
Suggested solutions
No idea…
Issue Analytics
- State:
- Created 4 years ago
- Comments:17 (14 by maintainers)
Top Results From Across the Web
`pytest` output missing when test triggers a segfault
The issue is that python itself buffers all the output, which is being discarded in the segfault See here. The solution is find...
Read more >Issue 45329: pyexpat: segmentation fault when
Some tests, which are related to pyexpat, get failed with `./configure --with-system-expat`. ``` 11 tests failed: test_minidom ...
Read more >I'm an Expert in Memory Management & Segfaults, Ask Me ...
Any burning questions about dynamic allocation, undefined behavior, pointers, memory safety, or anything even remotely related? Ask me anything!
Read more >error message - Shortest code that raises a SIGSEGV
Assembly (Linux, x86-64), 1 byte. RET. This code segfaults. ... This is the Python version I'm testing on: ... Test ./bang Segmentation fault...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Found the problem! (and the solution).
For future reference: The first line in the call stack is from scipy. I noticed that
requirements.txtsaysscipy>=1.0. However, my envs hasscipy-1.3.0. Therefore,pip install scipy==1.0did the trick.It seems that we are not compatible (in a very ugly way) with new versions of scipy.
I managed to reproduce the issue just to confirm that https://github.com/Qiskit/qiskit-terra/pull/3884 fixes it. Thanks @nonhermitian !