Bug summary
We've previously not been installing Qt wrappers such as PyQt6 or PySide. #27723 adds those back, but we have discovered that test_other_signal_before_sigint fails on CI. The subprocess appears to segfault somewhere in the Qt event loop.
I had tried to debug it with c1afbac, but then it stopped failing. Reverting that change then failed again, though one time it passed. So this seems to be fairly flaky.
I went through all CI runs, and found that this is not particularly limited to any parametrization:
4 _ test_other_signal_before_sigint[show-kwargs0-MPLBACKEND=qtcairo-QT_API=PyQt6-BACKEND_DEPS=PyQt6,cairocffi] _
3 _ test_other_signal_before_sigint[show-kwargs0-MPLBACKEND=qtcairo-QT_API=PySide6-BACKEND_DEPS=PySide6,cairocffi] _
3 _ test_other_signal_before_sigint[show-kwargs0-MPLBACKEND=qtcairo-QT_API=PyQt5-BACKEND_DEPS=PyQt5,cairocffi] _
3 _ test_other_signal_before_sigint[show-kwargs0-MPLBACKEND=qtagg-QT_API=PyQt6-BACKEND_DEPS=PyQt6] _
2 _ test_other_signal_before_sigint[show-kwargs0-MPLBACKEND=qtcairo-QT_API=PySide2-BACKEND_DEPS=PySide2,cairocffi] _
2 _ test_other_signal_before_sigint[show-kwargs0-MPLBACKEND=qtagg-QT_API=PySide6-BACKEND_DEPS=PySide6] _
1 _ test_other_signal_before_sigint[show-kwargs0-MPLBACKEND=qtagg-QT_API=PySide2-BACKEND_DEPS=PySide2] _
Unfortunately, I don't think @tacaswell was able to reproduce the crash, and @ksunden was only able to reproduce once, but only as part of a full test suite, and never again later in a smaller run.
So as part of #27723, I've marked these as xfail, but if we can figure out a way to reproduce, we should be able to fix this.
Code for reproduction
pytest -k test_other_signal_before_sigint lib/matplotlib/tests/test_backends_interactive.py
Actual outcome
_ test_other_signal_before_sigint[show-kwargs0-MPLBACKEND=qtagg-QT_API=PySide6-BACKEND_DEPS=PySide6] _
[gw1] darwin -- Python 3.12.2 /Library/Frameworks/Python.framework/Versions/3.12/bin/python
env = {'BACKEND_DEPS': 'PySide6', 'MPLBACKEND': 'qtagg', 'QT_API': 'PySide6'}
target = 'show', kwargs = {'block': True}
request = <FixtureRequest for <Function test_other_signal_before_sigint[show-kwargs0-MPLBACKEND=qtagg-QT_API=PySide6-BACKEND_DEPS=PySide6]>>
@pytest.mark.skipif(sys.platform == 'win32',
reason='No other signal available to send on Windows')
@pytest.mark.parametrize("env", _get_testable_interactive_backends())
@pytest.mark.parametrize("target, kwargs", [
('show', {'block': True}),
('pause', {'interval': 10})
])
def test_other_signal_before_sigint(env, target, kwargs, request):
backend = env.get("MPLBACKEND")
if not backend.startswith(("qt", "macosx")):
pytest.skip("SIGINT currently only tested on qt and macosx")
if backend == "macosx":
request.node.add_marker(pytest.mark.xfail(reason="macosx backend is buggy"))
proc = _WaitForStringPopen(
[sys.executable, "-c",
inspect.getsource(_test_other_signal_before_sigint_impl) +
"\n_test_other_signal_before_sigint_impl("
f"{backend!r}, {target!r}, {kwargs!r})"])
try:
proc.wait_for('DRAW')
os.kill(proc.pid, signal.SIGUSR1)
proc.wait_for('SIGUSR1')
os.kill(proc.pid, signal.SIGINT)
stdout, _ = proc.communicate(timeout=_test_timeout)
except Exception:
proc.kill()
stdout, _ = proc.communicate()
raise
print(stdout)
> assert 'SUCCESS' in stdout
E AssertionError
/Users/runner/work/matplotlib/matplotlib/lib/matplotlib/tests/test_backends_interactive.py:790: AssertionError
----------------------------- Captured stdout call -----------------------------
----------------------------- Captured stderr call -----------------------------
Fatal Python error: Segmentation fault
Current thread 0x00000001d88a9c40 (most recent call first):
File "/Users/runner/work/matplotlib/matplotlib/lib/matplotlib/backends/qt_compat.py", line 159 in _exec
File "/Users/runner/work/matplotlib/matplotlib/lib/matplotlib/backends/backend_qt.py", line 633 in start_main_loop
File "/Users/runner/work/matplotlib/matplotlib/lib/matplotlib/backend_bases.py", line 3536 in show
File "/Users/runner/work/matplotlib/matplotlib/lib/matplotlib/pyplot.py", line 590 in show
File "<string>", line 21 in _test_other_signal_before_sigint_impl
File "<string>", line 25 in <module>
Extension modules: numpy.core._multiarray_umath, numpy.core._multiarray_tests, numpy.linalg._umath_linalg, numpy.fft._pocketfft_internal, numpy.random._common, numpy.random.bit_generator, numpy.random._bounded_integers, numpy.random._mt19937, numpy.random.mtrand, numpy.random._philox, numpy.random._pcg64, numpy.random._sfc64, numpy.random._generator, PIL._imaging, kiwisolver._cext, PyQt6.QtCore, PyQt6.QtGui, PyQt6.QtWidgets (total: 18)
Expected outcome
Tests pass
Additional information
No response
Operating system
macOS
Matplotlib Version
main
Matplotlib Backend
QtAgg
Python version
3.10 or 3.12
Jupyter version
No response
Installation
git checkout
Bug summary
We've previously not been installing Qt wrappers such as PyQt6 or PySide. #27723 adds those back, but we have discovered that
test_other_signal_before_sigintfails on CI. The subprocess appears to segfault somewhere in the Qt event loop.I had tried to debug it with c1afbac, but then it stopped failing. Reverting that change then failed again, though one time it passed. So this seems to be fairly flaky.
I went through all CI runs, and found that this is not particularly limited to any parametrization:
Unfortunately, I don't think @tacaswell was able to reproduce the crash, and @ksunden was only able to reproduce once, but only as part of a full test suite, and never again later in a smaller run.
So as part of #27723, I've marked these as
xfail, but if we can figure out a way to reproduce, we should be able to fix this.Code for reproduction
Actual outcome
Expected outcome
Tests pass
Additional information
No response
Operating system
macOS
Matplotlib Version
main
Matplotlib Backend
QtAgg
Python version
3.10 or 3.12
Jupyter version
No response
Installation
git checkout