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.

Test with napari rc fails with segmentation fault during process qt viewer buttons events.

See original GitHub issue

🐛 Bug

My test of pre-release on macos fails with segmentation fail after processing some napari button events. In the past such problem was caused by keeping references to Qt objects in some global state. Error is not deterministic and it my happen that after restart test pass.

To Reproduce

https://github.com/4DNucleome/PartSeg/runs/5384644974?check_suite_focus=true

  Current thread 0x00000001116addc0 (most recent call first):
    File "/tmp/tox/py38-PyQt5-all/lib/python3.8/site-packages/napari/utils/events/event.py", line 354 in callback_refs
    File "/tmp/tox/py38-PyQt5-all/lib/python3.8/site-packages/napari/utils/events/event.py", line 432 in connect
    File "/tmp/tox/py38-PyQt5-all/lib/python3.8/site-packages/napari/utils/action_manager.py", line 209 in bind_button
    File "/tmp/tox/py38-PyQt5-all/lib/python3.8/site-packages/napari/_qt/widgets/qt_viewer_buttons.py", line 468 in __init__
    File "/tmp/tox/py38-PyQt5-all/lib/python3.8/site-packages/napari/_qt/widgets/qt_viewer_buttons.py", line 432 in _func
    File "/tmp/tox/py38-PyQt5-all/lib/python3.8/site-packages/napari/_qt/widgets/qt_viewer_buttons.py", line 129 in __init__
    File "/tmp/tox/py38-PyQt5-all/lib/python3.8/site-packages/napari/_qt/qt_viewer.py", line 208 in __init__
    File "/tmp/tox/py38-PyQt5-all/lib/python3.8/site-packages/PartSeg/common_gui/napari_image_view.py", line 911 in __init__
    File "/tmp/tox/py38-PyQt5-all/lib/python3.8/site-packages/PartSeg/common_gui/napari_image_view.py", line 160 in __init__
    File "/tmp/tox/py38-PyQt5-all/lib/python3.8/site-packages/PartSeg/_roi_mask/image_view.py", line 13 in __init__
    File "/tmp/tox/py38-PyQt5-all/lib/python3.8/site-packages/PartSeg/_roi_mask/main_window.py", line 878 in __init__
    File "/tmp/tox/py38-PyQt5-all/lib/python3.8/site-packages/PartSeg/_launcher/main_window.py", line 133 in launch
    File "/tmp/tox/py38-PyQt5-all/lib/python3.8/site-packages/pytestqt/qt_compat.py", line 156 in exec
    File "/tmp/tox/py38-PyQt5-all/lib/python3.8/site-packages/pytestqt/wait_signal.py", line 51 in wait
    File "/tmp/tox/py38-PyQt5-all/lib/python3.8/site-packages/pytestqt/wait_signal.py", line 151 in __exit__
    File "/Users/runner/work/PartSeg/PartSeg/package/tests/test_PartSeg/test_main_windows.py", line 62 in test_open_mask
    File "/tmp/tox/py38-PyQt5-all/lib/python3.8/site-packages/_pytest/python.py", line 192 in pytest_pyfunc_call
    File "/tmp/tox/py38-PyQt5-all/lib/python3.8/site-packages/pluggy/_callers.py", line 39 in _multicall
    File "/tmp/tox/py38-PyQt5-all/lib/python3.8/site-packages/pluggy/_manager.py", line 80 in _hookexec
    File "/tmp/tox/py38-PyQt5-all/lib/python3.8/site-packages/pluggy/_hooks.py", line 265 in __call__
    File "/tmp/tox/py38-PyQt5-all/lib/python3.8/site-packages/_pytest/python.py", line 1718 in runtest
    File "/tmp/tox/py38-PyQt5-all/lib/python3.8/site-packages/_pytest/runner.py", line 168 in pytest_runtest_call
    File "/tmp/tox/py38-PyQt5-all/lib/python3.8/site-packages/pluggy/_callers.py", line 39 in _multicall
    File "/tmp/tox/py38-PyQt5-all/lib/python3.8/site-packages/pluggy/_manager.py", line 80 in _hookexec
    File "/tmp/tox/py38-PyQt5-all/lib/python3.8/site-packages/pluggy/_hooks.py", line 265 in __call__
    File "/tmp/tox/py38-PyQt5-all/lib/python3.8/site-packages/_pytest/runner.py", line 261 in <lambda>
    File "/tmp/tox/py38-PyQt5-all/lib/python3.8/site-packages/_pytest/runner.py", line 340 in from_call
    File "/tmp/tox/py38-PyQt5-all/lib/python3.8/site-packages/_pytest/runner.py", line 260 in call_runtest_hook
    File "/tmp/tox/py38-PyQt5-all/lib/python3.8/site-packages/_pytest/runner.py", line 221 in call_and_report
    File "/tmp/tox/py38-PyQt5-all/lib/python3.8/site-packages/_pytest/runner.py", line 132 in runtestprotocol
    File "/tmp/tox/py38-PyQt5-all/lib/python3.8/site-packages/_pytest/runner.py", line 113 in pytest_runtest_protocol
    File "/tmp/tox/py38-PyQt5-all/lib/python3.8/site-packages/pluggy/_callers.py", line 39 in _multicall
    File "/tmp/tox/py38-PyQt5-all/lib/python3.8/site-packages/pluggy/_manager.py", line 80 in _hookexec
    File "/tmp/tox/py38-PyQt5-all/lib/python3.8/site-packages/pluggy/_hooks.py", line 265 in __call__
    File "/tmp/tox/py38-PyQt5-all/lib/python3.8/site-packages/_pytest/main.py", line 347 in pytest_runtestloop
    File "/tmp/tox/py38-PyQt5-all/lib/python3.8/site-packages/pluggy/_callers.py", line 39 in _multicall
    File "/tmp/tox/py38-PyQt5-all/lib/python3.8/site-packages/pluggy/_manager.py", line 80 in _hookexec
    File "/tmp/tox/py38-PyQt5-all/lib/python3.8/site-packages/pluggy/_hooks.py", line 265 in __call__
    File "/tmp/tox/py38-PyQt5-all/lib/python3.8/site-packages/_pytest/main.py", line 322 in _main
    File "/tmp/tox/py38-PyQt5-all/lib/python3.8/site-packages/_pytest/main.py", line 268 in wrap_session
    File "/tmp/tox/py38-PyQt5-all/lib/python3.8/site-packages/_pytest/main.py", line 315 in pytest_cmdline_main
    File "/tmp/tox/py38-PyQt5-all/lib/python3.8/site-packages/pluggy/_callers.py", line 39 in _multicall
    File "/tmp/tox/py38-PyQt5-all/lib/python3.8/site-packages/pluggy/_manager.py", line 80 in _hookexec
    File "/tmp/tox/py38-PyQt5-all/lib/python3.8/site-packages/pluggy/_hooks.py", line 265 in __call__
    File "/tmp/tox/py38-PyQt5-all/lib/python3.8/site-packages/_pytest/config/__init__.py", line 165 in main
    File "/tmp/tox/py38-PyQt5-all/lib/python3.8/site-packages/_pytest/config/__init__.py", line 188 in console_main
    File "/tmp/tox/py38-PyQt5-all/lib/python3.8/site-packages/pytest/__main__.py", line 5 in <module>
    File "/Users/runner/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/runpy.py", line 87 in _run_code
    File "/Users/runner/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/runpy.py", line 194 in _run_module_as_main

Expected behavior

There should be no global reference to old instances.

Environment

napari==0.4.15rc0

Additional context

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
Czakicommented, Mar 5, 2022

I could not reproduce it now. I will try more when I come back to home.

0reactions
Czakicommented, May 3, 2022

All test green.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cellfinder-napari crashes with segmentation fault on macOS ...
Napari crashes early on when saving training data. Claims segmentation fault 11, the yml file was saved, but no cubes were saved.
Read more >
Totally confusing segmentation violation - Qt Forum
I have a problem which appears apparently randomly which is a SIGSEGV but the stack trace only has main() as a viewable level....
Read more >
Process finished with exit code 139 (interrupted by signal 11
The SIGSEGV signal indicates a "segmentation violation" or a "segfault". More or less, this equates to a read or write of a memory...
Read more >
Simple index
... adafruit-circuitpython-debug-i2c adafruit-circuitpython-dht adafruit-circuitpython-display-button ... apache-airflow-backport-providers-segment ...
Read more >
Simple Index
abc-test-reader ... adafruit-circuitpython-display-button · adafruit-circuitpython-display-notification ... alephvault-evm-events-http-mongodb-storage
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