pcdshub / typhos

Automatic-yet-customizable Graphical User Interface Generation for Ophyd Devices
http://pcdshub.github.io/typhos
Other
16 stars 26 forks source link

Test suite segmentation fault race condition #526

Open ZLLentz opened 2 years ago

ZLLentz commented 2 years ago

From #525

typhos/tests/test_display.py::test_display_device_class_property Fatal Python error: Segmentation fault
Thread 0x00007f32999d7700 (most recent call first):
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/ophyd/sim.py", line 284 in periodic_update
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/threading.py", line 917 in run
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/threading.py", line 980 in _bootstrap_inner
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/threading.py", line 937 in _bootstrap
Thread 0x00007f329a1d8700 (most recent call first):
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/ophyd/sim.py", line 284 in periodic_update
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/threading.py", line 917 in run
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/threading.py", line 980 in _bootstrap_inner
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/threading.py", line 937 in _bootstrap
Thread 0x00007f329a9d9700 (most recent call first):
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/ophyd/sim.py", line 284 in periodic_update
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/threading.py", line 917 in run
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/threading.py", line 980 in _bootstrap_inner
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/threading.py", line 937 in _bootstrap
Thread 0x00007f329d1de700 (most recent call first):
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/ophyd/sim.py", line 284 in periodic_update
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/threading.py", line 917 in run
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/threading.py", line 980 in _bootstrap_inner
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/threading.py", line 937 in _bootstrap
Thread 0x00007f329d9df700 (most recent call first):
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/ophyd/sim.py", line 284 in periodic_update
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/threading.py", line 917 in run
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/threading.py", line 980 in _bootstrap_inner
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/threading.py", line 937 in _bootstrap
Thread 0x00007f329e1e0700 (most recent call first):
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/ophyd/sim.py", line 284 in periodic_update
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/threading.py", line 917 in run
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/threading.py", line 980 in _bootstrap_inner
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/threading.py", line 937 in _bootstrap
Thread 0x00007f329e9e1700 (most recent call first):
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/threading.py", line 316 in wait
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/threading.py", line 581 in wait
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/jupyter_client/channels.py", line 133 in _async_run
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/asyncio/tasks.py", line 256 in __step
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/nest_asyncio.py", line 196 in step
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/asyncio/events.py", line 80 in _run
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/nest_asyncio.py", line 120 in _run_once
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/nest_asyncio.py", line 84 in run_until_complete
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/jupyter_client/channels.py", line 111 in run
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/threading.py", line 980 in _bootstrap_inner
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/threading.py", line 937 in _bootstrap
Thread 0x00007f32a11e6700 (most recent call first):
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/selectors.py", line 469 in select
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/nest_asyncio.py", line 107 in _run_once
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/nest_asyncio.py", line 73 in run_forever
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/tornado/platform/asyncio.py", line 215 in start
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/jupyter_client/threaded.py", line 219 in run
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/threading.py", line 980 in _bootstrap_inner
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/threading.py", line 937 in _bootstrap
Thread 0x00007f32bba59700 (most recent call first):
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/threading.py", line 316 in wait
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/threading.py", line 581 in wait
  File "/home/travis/build/pcdshub/typhos/typhos/utils.py", line 1224 in run
Thread 0x00007f32c0a84700 (most recent call first):
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/pydm/widgets/rules.py", line 230 in run
Thread 0x00007f32f8bdb700 (most recent call first):
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/ophyd/_dispatch.py", line 164 in _debug_monitor
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/threading.py", line 917 in run
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/threading.py", line 980 in _bootstrap_inner
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/threading.py", line 937 in _bootstrap
Thread 0x00007f32f93dc700 (most recent call first):
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/threading.py", line 316 in wait
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/queue.py", line 180 in get
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/ophyd/_dispatch.py", line 46 in run
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/threading.py", line 980 in _bootstrap_inner
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/threading.py", line 937 in _bootstrap
Thread 0x00007f32f9bdd700 (most recent call first):
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/threading.py", line 316 in wait
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/queue.py", line 180 in get
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/ophyd/_dispatch.py", line 46 in run
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/threading.py", line 980 in _bootstrap_inner
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/threading.py", line 937 in _bootstrap
Thread 0x00007f32fa3de700 (most recent call first):
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/threading.py", line 316 in wait
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/queue.py", line 180 in get
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/ophyd/_dispatch.py", line 46 in run
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/threading.py", line 980 in _bootstrap_inner
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/threading.py", line 937 in _bootstrap
Thread 0x00007f32fabdf700 (most recent call first):
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/threading.py", line 316 in wait
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/queue.py", line 180 in get
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/ophyd/_dispatch.py", line 46 in run
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/threading.py", line 980 in _bootstrap_inner
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/threading.py", line 937 in _bootstrap
Thread 0x00007f32fb3e0700 (most recent call first):
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/threading.py", line 316 in wait
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/queue.py", line 180 in get
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/ophyd/_dispatch.py", line 46 in run
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/threading.py", line 980 in _bootstrap_inner
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/threading.py", line 937 in _bootstrap
Thread 0x00007f32fbbe1700 (most recent call first):
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/threading.py", line 316 in wait
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/queue.py", line 180 in get
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/ophyd/_dispatch.py", line 46 in run
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/threading.py", line 980 in _bootstrap_inner
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/threading.py", line 937 in _bootstrap
Thread 0x00007f3301133700 (most recent call first):
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/threading.py", line 316 in wait
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/queue.py", line 180 in get
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/ophyd/_dispatch.py", line 46 in run
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/threading.py", line 980 in _bootstrap_inner
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/threading.py", line 937 in _bootstrap
Current thread 0x00007f3315d28700 (most recent call first):
  File "/home/travis/build/pcdshub/typhos/typhos/plugins/core.py", line 240 in remove_listener
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/pydm/data_plugins/plugin.py", line 275 in remove_connection
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/pydm/widgets/channel.py", line 148 in disconnect
  File "/home/travis/build/pcdshub/typhos/typhos/tests/conftest.py", line 280 in reset_signal_plugin
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/_pytest/fixtures.py", line 907 in call_fixture_func
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/_pytest/fixtures.py", line 1128 in pytest_fixture_setup
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/pluggy/_callers.py", line 39 in _multicall
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/pluggy/_manager.py", line 80 in _hookexec
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/pluggy/_hooks.py", line 265 in __call__
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/_pytest/fixtures.py", line 1074 in execute
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/_pytest/fixtures.py", line 676 in _compute_fixture_value
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/_pytest/fixtures.py", line 590 in _get_active_fixturedef
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/_pytest/fixtures.py", line 568 in getfixturevalue
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/_pytest/fixtures.py", line 549 in _fillfixtures
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/_pytest/python.py", line 1792 in setup
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/_pytest/runner.py", line 492 in setup
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/_pytest/runner.py", line 155 in pytest_runtest_setup
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/pluggy/_callers.py", line 39 in _multicall
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/pluggy/_manager.py", line 80 in _hookexec
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/pluggy/_hooks.py", line 265 in __call__
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/_pytest/runner.py", line 260 in <lambda>
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/_pytest/runner.py", line 339 in from_call
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/_pytest/runner.py", line 259 in call_runtest_hook
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/_pytest/runner.py", line 220 in call_and_report
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/_pytest/runner.py", line 125 in runtestprotocol
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/_pytest/runner.py", line 112 in pytest_runtest_protocol
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/pluggy/_callers.py", line 39 in _multicall
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/pluggy/_manager.py", line 80 in _hookexec
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/pluggy/_hooks.py", line 265 in __call__
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/_pytest/main.py", line 349 in pytest_runtestloop
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/pluggy/_callers.py", line 39 in _multicall
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/pluggy/_manager.py", line 80 in _hookexec
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/pluggy/_hooks.py", line 265 in __call__
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/_pytest/main.py", line 324 in _main
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/_pytest/main.py", line 270 in wrap_session
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/_pytest/main.py", line 317 in pytest_cmdline_main
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/pluggy/_callers.py", line 39 in _multicall
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/pluggy/_manager.py", line 80 in _hookexec
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/pluggy/_hooks.py", line 265 in __call__
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/_pytest/config/__init__.py", line 167 in main
  File "/home/travis/micromamba/envs/testenv/lib/python3.9/site-packages/_pytest/config/__init__.py", line 190 in console_main
  File "/home/travis/micromamba/envs/testenv/bin/pytest", line 10 in <module>
/home/travis/.travis/functions: line 109:  7126 Segmentation fault      pytest "${PYTEST_ARGS[@]}"
The command "pytest "${PYTEST_ARGS[@]}"" exited with 139.
klauer commented 2 years ago

With https://github.com/pcdshub/pcds-local-ci-travis/pull/1:

(gdb) py-list
 235            logger.debug("Removing %r ...", channel)
 236            # Disconnect put_value from outgoing channel
 237            if channel.value_signal is not None and not destroying:
 238                for _typ in self.supported_types:
 239                    try:
>240                        channel.value_signal[_typ].disconnect(self.put_value)
 241                    except (KeyError, TypeError):
 242                        logger.debug("Unable to disconnect value_signal from %s "
 243                                     "for type %s", channel.address, _typ)
 244            # Disconnect any other signals
 245            super().remove_listener(channel, destroying=destroying, **kwargs)
(gdb) py-locals
self = <SignalConnection(protocol='sig', address='test_motor_acceleration', connected=False, value=None, listener_count=1, app=<PyDMApplication(main_window=None, display_args=[], hide_nav_bar=False, hide_menu_bar=False, hide_status_bar=False, fullscreen=False, stylesheet_path=None, perfmon=False, home_file=None, had_file=False) at remote 0x7f649d430ca0>, signal_type=<type at remote 0x556945b94700>, signal=<Signal(_ophyd_labels_=set(), _kind=<Kind(_value_=2, _name_='config', __objclass__=<EnumMeta(_generate_next_value_=<function at remote 0x7f64f765fd30>, __module__='ophyd.ophydobj', __doc__="\n    This is used in the .kind attribute of all OphydObj (Signals, Devices).\n\n    A Device examines its components' .kind atttribute to decide whether to\n    traverse it in read(), read_configuration(), or neither. Additionally, if\n    decides whether to include its name in `hints['fields']`.\n    ", _member_names_=['omitted', 'normal', 'config', 'hinted'], _member_map_={'omitted': <Kind(_value_=0, _name_='omitted', __objcl...(truncated)
channel = <PyDMChannel(_address='sig://test_motor_acceleration', connection_slot=<method at remote 0x7f6492c9aac0>, value_slot=<method at remote 0x7f6492c9ae40>, severity_slot=<method at remote 0x7f6492c9a600>, write_access_slot=<method at remote 0x7f6492c9a700>, enum_strings_slot=<method at remote 0x7f6492c9a540>, unit_slot=<method at remote 0x7f6492c9a240>, prec_slot=<method at remote 0x7f6492c9a440>, upper_ctrl_limit_slot=<method at remote 0x7f6492c9a640>, lower_ctrl_limit_slot=<method at remote 0x7f6492c9aa80>, upper_alarm_limit_slot=<method at remote 0x7f6492c9afc0>, lower_alarm_limit_slot=<method at remote 0x7f6492c9ab00>, upper_warning_limit_slot=<method at remote 0x7f6492c9a140>, lower_warning_limit_slot=<method at remote 0x7f6492c9a2c0>, timestamp_slot=<method at remote 0x7f6492c9a080>, value_signal=<PyQt5.QtCore.pyqtBoundSignal at remote 0x7f649c8ebc90>) at remote 0x7f649c8eba60>
destroying = False
kwargs = {}
_typ = <type at remote 0x556945b94700>