- Notifications
You must be signed in to change notification settings - Fork13
Description
Matplotlib is experiencing some strange behaviour (segmentation faults) in wheels using some but not all versions of delvewheel, and we'd appreciate some help understanding what is going on and hopefully fixing it.
The Matplotlib 3.9.1 release was yanked because although Matplotlib-only tests worked fine, using it on Windows with some downstream libraries was causing segmentation faults. I believe the original issue isactions/runner-images#10055, a change in use of C++std::mutex
by MSVC that can be worked around with a#define
, but the shipping and use of MSVC DLLs (which I don't think any of us on Matplotlib fully understand) is not letting the problem go away.
The related Matplotlib issue is quite long, the most relevant comment ismatplotlib/matplotlib#28551 (comment).
I think the original Matplotlib 3.9.1 used delvewheel 1.7.1. There was a period of about a week when the problem was magically solved for us which I think corresponds to delvewheel 1.7.2. Based on that we made a 3.9.1.post1 release, but unfortunately that used delvewheel 1.7.3 and we are back to experiencing some segmentation faults although only in a subset of situations that were problematic before.
The wheels we were happy with are athttps://github.com/matplotlib/matplotlib/actions/runs/10227059586/job/28298087600, and wheels that are now problematic are athttps://github.com/matplotlib/matplotlib/actions/runs/10272282149/job/28424163560. I have made a simple github repository to reproduce the problem athttps://github.com/ianthomas23/mpl-test. The workflow to reproduce the failure is, from
https://github.com/ianthomas23/mpl-test/blob/cc04a4efbaa68a7aeda35303de6ad74792b2c6f7/.github/workflows/test.yml#L119
this:
<create new python environment>python -m pip install -v --no-binary=contourpy contourpypython -m pip install --only-binary=:all: --pre --upgrade --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple matplotlibpython test_with.py
wheretest_with.py
is
# Test with import of matplotlibfromcontourpyimportcontour_generatorimportmatplotlib.pyplotaspltprint("START test_with.py")cont_gen=contour_generator(z=[[0,1], [2,3]])try:cont_gen.filled(2.0,1.0)exceptExceptionase:print("EXCEPTION HANDLER",e)print("END test_with.py")
One can download the good and bad wheels from the above links andpip install
those to confirm good/bad behaviour.