title: Pytest core dump on Unbutu 22.04 LTS when using pyqt5 with mayavi and pyvirtualdisplay
body: <h2>Want I want to do:</h2>
  <p>I want to have these requirements running on Ubuntu 22.04 LTS:</p>
  <pre><code># Bug on Ub.22.04 but avoids AttributeError: 'Timer' object has no attribute 'start' on other OS
  pyqt5==5.15.7
  
  # These together work:
  mayavi==4.7.4
  PyVirtualDisplay==3.0
  pytest==7.1.2
  </code></pre>
  <p>So I can run this test:</p>
  <pre class="lang-py prettyprint-override"><code>import pytest
  
  from pyvirtualdisplay import Display
  import os
  display = Display(visible=0, size=(1280, 1024))
  display.start()
  
  from mayavi import mlab
  
  def foo(tmp_path):
  
      assert 0 == 0;
  </code></pre>
  <h2>Problem</h2>
  <p>Adding the PyQt5 to the list of dependencies seems to break the behavior of the program on Ubuntu 22.04 LTS (although it works on Ubuntu 20.04 LTS and MacOS for multiple version of Python 3.</p>
  <p>The output error is the following:</p>
  <pre><code>Run python3 -m pip install pytest
    python3 -m pip install pytest
    cd tests
    python3 -m pytest
    shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
  Defaulting to user installation because normal site-packages is not writeable
  Collecting pytest
    Downloading pytest-7.1.2-py3-none-any.whl (297 kB)
       ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 297.0/297.0 KB 8.8 MB/s eta 0:00:00
  Collecting pluggy&lt;2.0,&gt;=0.12
    Downloading pluggy-1.0.0-py2.py3-none-any.whl (13 kB)
  Collecting iniconfig
    Downloading iniconfig-1.1.1-py2.py3-none-any.whl (5.0 kB)
  Requirement already satisfied: attrs&gt;=19.2.0 in /usr/lib/python3/dist-packages (from pytest) (21.2.0)
  Requirement already satisfied: packaging in /usr/local/lib/python3.10/dist-packages (from pytest) (21.3)
  Collecting py&gt;=1.8.2
    Downloading py-1.11.0-py2.py3-none-any.whl (98 kB)
       ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 98.7/98.7 KB 23.2 MB/s eta 0:00:00
  Collecting tomli&gt;=1.0.0
    Downloading tomli-2.0.1-py3-none-any.whl (12 kB)
  Requirement already satisfied: pyparsing!=3.0.5,&gt;=2.0.2 in /usr/lib/python3/dist-packages (from packaging-&gt;pytest) (2.4.7)
  Installing collected packages: iniconfig, tomli, py, pluggy, pytest
  Successfully installed iniconfig-1.1.1 pluggy-1.0.0 py-1.11.0 pytest-7.1.2 tomli-2.0.1
  Fatal Python error: Aborted
  Current thread 0x00007f99b32c8000 (most recent call first):
    File &quot;/home/runner/.local/lib/python3.10/site-packages/pyface/ui/qt4/init.py&quot;, line 36 in &lt;module&gt;
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 241 in _call_with_frames_removed
    File &quot;&lt;frozen importlib._bootstrap_external&gt;&quot;, line 883 in exec_module
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 688 in _load_unlocked
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1006 in _find_and_load_unlocked
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1027 in _find_and_load
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1050 in _gcd_import
    File &quot;/usr/lib/python3.10/importlib/__init__.py&quot;, line 126 in import_module
    File &quot;/usr/lib/python3.10/importlib/metadata/__init__.py&quot;, line 171 in load
    File &quot;/home/runner/.local/lib/python3.10/site-packages/pyface/base_toolkit.py&quot;, line 218 in import_toolkit
    File &quot;/home/runner/.local/lib/python3.10/site-packages/pyface/base_toolkit.py&quot;, line 263 in find_toolkit
    File &quot;/home/runner/.local/lib/python3.10/site-packages/pyface/toolkit.py&quot;, line 23 in &lt;module&gt;
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 241 in _call_with_frames_removed
    File &quot;&lt;frozen importlib._bootstrap_external&gt;&quot;, line 883 in exec_module
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 688 in _load_unlocked
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1006 in _find_and_load_unlocked
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1027 in _find_and_load
    File &quot;/home/runner/.local/lib/python3.10/site-packages/traitsui/qt4/toolkit.py&quot;, line 33 in &lt;module&gt;
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 241 in _call_with_frames_removed
    File &quot;&lt;frozen importlib._bootstrap_external&gt;&quot;, line 883 in exec_module
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 688 in _load_unlocked
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1006 in _find_and_load_unlocked
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1027 in _find_and_load
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 241 in _call_with_frames_removed
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1078 in _handle_fromlist
    File &quot;/home/runner/.local/lib/python3.10/site-packages/traitsui/qt4/__init__.py&quot;, line 35 in &lt;module&gt;
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 241 in _call_with_frames_removed
    File &quot;&lt;frozen importlib._bootstrap_external&gt;&quot;, line 883 in exec_module
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 688 in _load_unlocked
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1006 in _find_and_load_unlocked
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1027 in _find_and_load
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1050 in _gcd_import
    File &quot;/usr/lib/python3.10/importlib/__init__.py&quot;, line 126 in import_module
    File &quot;/usr/lib/python3.10/importlib/metadata/__init__.py&quot;, line 171 in load
    File &quot;/home/runner/.local/lib/python3.10/site-packages/pyface/base_toolkit.py&quot;, line 282 in find_toolkit
    File &quot;/home/runner/.local/lib/python3.10/site-packages/traitsui/toolkit.py&quot;, line 110 in toolkit
    File &quot;/home/runner/.local/lib/python3.10/site-packages/traitsui/toolkit_traits.py&quot;, line 43 in ColorTrait
    File &quot;/home/runner/.local/lib/python3.10/site-packages/traits/trait_factory.py&quot;, line 40 in __call__
    File &quot;/home/runner/.local/lib/python3.10/site-packages/traitsui/editors/code_editor.py&quot;, line 32 in CodeEditor
    File &quot;/home/runner/.local/lib/python3.10/site-packages/traitsui/editors/code_editor.py&quot;, line 21 in &lt;module&gt;
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 241 in _call_with_frames_removed
    File &quot;&lt;frozen importlib._bootstrap_external&gt;&quot;, line 883 in exec_module
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 688 in _load_unlocked
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1006 in _find_and_load_unlocked
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1027 in _find_and_load
    File &quot;/home/runner/.local/lib/python3.10/site-packages/traitsui/editors/api.py&quot;, line 96 in &lt;module&gt;
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 241 in _call_with_frames_removed
    File &quot;&lt;frozen importlib._bootstrap_external&gt;&quot;, line 883 in exec_module
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 688 in _load_unlocked
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1006 in _find_and_load_unlocked
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1027 in _find_and_load
    File &quot;/home/runner/.local/lib/python3.10/site-packages/traitsui/editors/__init__.py&quot;, line 16 in &lt;module&gt;
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 241 in _call_with_frames_removed
    File &quot;&lt;frozen importlib._bootstrap_external&gt;&quot;, line 883 in exec_module
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 688 in _load_unlocked
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1006 in _find_and_load_unlocked
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1027 in _find_and_load
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 241 in _call_with_frames_removed
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 992 in _find_and_load_unlocked
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1027 in _find_and_load
    File &quot;/home/runner/.local/lib/python3.10/site-packages/traitsui/api.py&quot;, line 257 in &lt;module&gt;
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 241 in _call_with_frames_removed
    File &quot;&lt;frozen importlib._bootstrap_external&gt;&quot;, line 883 in exec_module
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 688 in _load_unlocked
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1006 in _find_and_load_unlocked
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1027 in _find_and_load
    File &quot;/home/runner/.local/lib/python3.10/site-packages/mayavi/preferences/preference_manager.py&quot;, line 29 in &lt;module&gt;
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 241 in _call_with_frames_removed
    File &quot;&lt;frozen importlib._bootstrap_external&gt;&quot;, line 883 in exec_module
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 688 in _load_unlocked
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1006 in _find_and_load_unlocked
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1027 in _find_and_load
    File &quot;/home/runner/.local/lib/python3.10/site-packages/mayavi/preferences/api.py&quot;, line 4 in &lt;module&gt;
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 241 in _call_with_frames_removed
    File &quot;&lt;frozen importlib._bootstrap_external&gt;&quot;, line 883 in exec_module
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 688 in _load_unlocked
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1006 in _find_and_load_unlocked
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1027 in _find_and_load
    File &quot;/home/runner/.local/lib/python3.10/site-packages/mayavi/tools/engine_manager.py&quot;, line 12 in &lt;module&gt;
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 241 in _call_with_frames_removed
    File &quot;&lt;frozen importlib._bootstrap_external&gt;&quot;, line 883 in exec_module
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 688 in _load_unlocked
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1006 in _find_and_load_unlocked
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1027 in _find_and_load
    File &quot;/home/runner/.local/lib/python3.10/site-packages/mayavi/tools/camera.py&quot;, line 24 in &lt;module&gt;
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 241 in _call_with_frames_removed
    File &quot;&lt;frozen importlib._bootstrap_external&gt;&quot;, line 883 in exec_module
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 688 in _load_unlocked
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1006 in _find_and_load_unlocked
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1027 in _find_and_load
    File &quot;/home/runner/.local/lib/python3.10/site-packages/mayavi/mlab.py&quot;, line 16 in &lt;module&gt;
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 241 in _call_with_frames_removed
    File &quot;&lt;frozen importlib._bootstrap_external&gt;&quot;, line 883 in exec_module
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 688 in _load_unlocked
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1006 in _find_and_load_unlocked
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1027 in _find_and_load
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 241 in _call_with_frames_removed
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1078 in _handle_fromlist
    File &quot;/home/runner/work/pyvirtualdisplay-bug/pyvirtualdisplay-bug/tests/test_animate.py&quot;, line 8 in &lt;module&gt;
    File &quot;/home/runner/.local/lib/python3.10/site-packages/_pytest/assertion/rewrite.py&quot;, line 168 in exec_module
    ...
  Extension modules: numpy.core._multiarray_umath, numpy.core._multiarray_tests, numpy.linalg.lapack_lite, 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, traits.ctraits, PyQt5.QtCore, PyQt5.QtGui, PyQt5.QtWidgets, PyQt5.QtPrintSupport, PyQt5.QtNetwork, PyQt5.QtQml, PyQt5.QtBluetooth, PyQt5.QtDBus, PyQt5.QtDesigner, PyQt5.QtHelp, PyQt5.QtNfc, PyQt5.QtOpenGL, PyQt5.QtPositioning, PyQt5.QtLocation, PyQt5.QtQuick, PyQt5.QtQuick3D, PyQt5.QtQuickWidgets, PyQt5.QtRemoteObjects, PyQt5.QtSensors, PyQt5.QtSerialPort, PyQt5.QtSql, PyQt5.QtSvg, PyQt5.QtTest, PyQt5.QtTextToSpeech, PyQt5.QtWebChannel, PyQt5.QtWebSockets, PyQt5.QtX11Extras, PyQt5.QtXml, PyQt5.QtXmlPatterns (total: 44)
  /home/runner/work/_temp/0585cdff-a041-431e-b28d-a33e621d22b2.sh: line 3:  6351 Aborted                 (core dumped) python3 -m pytest
  </code></pre>
  <h3>Bug reproduction</h3>
  <p>I created <a href="https://github.com/Becheler/pyvirtualdisplay-bug" rel="nofollow noreferrer">a small repo</a> to reproduce the issue. I created a bunch of branches where I cut some python dependencies off until I could isolate pyqt5 as the one breaking the working state: the changes are documented in the README. I know using external repos is not ideal, but since in that case it is a Github Action problem (it works on my local Ubuntu 22.04), maybe it makes sense?</p>