wxWidgets / Phoenix

wxPython's Project Phoenix. A new implementation of wxPython, better, stronger, faster than he was before.
http://wxpython.org/
2.21k stars 509 forks source link

importing wx in app run on GitHub actions will segfault on termination #2547

Open sveinse opened 1 month ago

sveinse commented 1 month ago

Operating system: Ubuntu on GitHub Action wxPython version & source: wxPython 4.2.1 source retrieved from pypi Python version & source: Ubuntu runner, Python version 3.x which is 3.12.2

Description of the problem:

If pytest is run with a test that does import wx in GitHub actions it will crash on exit. Bisecting reveals that it only needs to include wx to make it crash. Take the import away and it works fine. Moreover, changing python to 3.11 and it will pass just fine. This is most probably related to #2479

============================= test session starts ==============================
platform linux -- Python 3.12.2, pytest-8.1.1, pluggy-1.4.0
rootdir: /home/runner/work/gh-fail-wxwidgets/gh-fail-wxwidgets
configfile: pyproject.toml
testpaths: tests
plugins: cov-5.0.0
collected 2 items

tests/test_wx.py ..                                                      [100%]

---------- coverage: platform linux, python 3.12.2-final-0 -----------
Coverage XML written to file coverage.xml

============================== 2 passed in 0.63s ===============================
/home/runner/work/_temp/bc8b47c5-9781-42c2-8b9c-5383d1e7a7.sh: line 1:  2405 Segmentation fault      (core dumped)

This is demoed in repo: https://github.com/sveinse/gh-fail-wxwidgets that showcases the code and workflows that makes this fail. It sets up a very small python package that depends on wxPython and runs a very small pytest that imports wx. The master branch showcase using python 3.x which at the time is 3.12.2, while the py3.11 branch runs 3.11.8 and works fine. The repo use Actions that shows the failure and success.

swt2c commented 1 month ago

Yes, this is a duplicate of #2455. It has been fixed but not in a release yet unfortunately. Paging @RobinD42 really need a release here.