AnacondaRecipes / freetype-feedstock

A conda-smithy repository for freetype.
BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

Freetype 2.11.0 crashes matplotlib on windows #3

Open ericpre opened 2 years ago

ericpre commented 2 years ago

The packages of freetype 2.11 crashes matplotlib - see https://github.com/matplotlib/matplotlib/issues/21511; freetype 2.10 works fine.

To reproduce:

conda create -n freetype_issue
conda activate freetype_issue
conda install matplotlib notebook -c defaults

in a notebook run:

import matplotlib.pyplot as plt
plt.plot([0, 1])

which crashes the kernel - no error message.

or without the notebook, the following should save an image, print 'Done!':

python -c "import matplotlib.pyplot as plt; plt.plot([0, 1]); plt.savefig('test.png'); print('Done!)"
Output of conda list

```bash # packages in environment at C:\Users\Eric\mambaforge\envs\freetype: # # Name Version Build Channel argon2-cffi 20.1.0 py39h2bbff1b_1 async_generator 1.10 pyhd3eb1b0_0 attrs 21.2.0 pyhd3eb1b0_0 backcall 0.2.0 pyhd3eb1b0_0 blas 1.0 mkl bleach 4.0.0 pyhd3eb1b0_0 brotli 1.0.9 ha925a31_2 ca-certificates 2021.10.26 haa95532_2 certifi 2021.10.8 py39haa95532_0 cffi 1.14.6 py39h2bbff1b_0 colorama 0.4.4 pyhd3eb1b0_0 cycler 0.10.0 py39haa95532_0 debugpy 1.4.1 py39hd77b12b_0 decorator 5.1.0 pyhd3eb1b0_0 defusedxml 0.7.1 pyhd3eb1b0_0 entrypoints 0.3 py39haa95532_0 fonttools 4.25.0 pyhd3eb1b0_0 freetype 2.11.0 ha860e81_0 icu 58.2 ha925a31_3 importlib-metadata 4.8.1 py39haa95532_0 importlib_metadata 4.8.1 hd3eb1b0_0 intel-openmp 2021.3.0 haa95532_3372 ipykernel 6.4.1 py39haa95532_1 ipython 7.27.0 py39hd4e2768_0 ipython_genutils 0.2.0 pyhd3eb1b0_1 jedi 0.18.0 py39haa95532_1 jinja2 3.0.1 pyhd3eb1b0_0 jpeg 9d h2bbff1b_0 jsonschema 3.2.0 py39haa95532_0 jupyter_client 7.0.1 pyhd3eb1b0_0 jupyter_core 4.8.1 py39haa95532_0 jupyterlab_pygments 0.1.2 py_0 kiwisolver 1.3.1 py39hd77b12b_0 libpng 1.6.37 h2a8f88b_0 libtiff 4.2.0 hd0e1b90_0 libwebp 1.2.0 h2bbff1b_0 lz4-c 1.9.3 h2bbff1b_1 m2w64-gcc-libgfortran 5.3.0 6 m2w64-gcc-libs 5.3.0 7 m2w64-gcc-libs-core 5.3.0 7 m2w64-gmp 6.1.0 2 m2w64-libwinpthread-git 5.0.0.4634.697f757 2 markupsafe 2.0.1 py39h2bbff1b_0 matplotlib 3.4.3 py39haa95532_0 matplotlib-base 3.4.3 py39h49ac443_0 matplotlib-inline 0.1.2 pyhd3eb1b0_2 mistune 0.8.4 py39h2bbff1b_1000 mkl 2021.3.0 haa95532_524 mkl-service 2.4.0 py39h2bbff1b_0 mkl_fft 1.3.1 py39h277e83a_0 mkl_random 1.2.2 py39hf11a4ad_0 msys2-conda-epoch 20160418 1 munkres 1.1.4 py_0 nbclient 0.5.3 pyhd3eb1b0_0 nbconvert 6.1.0 py39haa95532_0 nbformat 5.1.3 pyhd3eb1b0_0 nest-asyncio 1.5.1 pyhd3eb1b0_0 notebook 6.4.5 py39haa95532_0 numpy 1.21.2 py39hfca59bb_0 numpy-base 1.21.2 py39h0829f74_0 olefile 0.46 pyhd3eb1b0_0 openssl 1.1.1l h2bbff1b_0 packaging 21.0 pyhd3eb1b0_0 pandocfilters 1.4.3 py39haa95532_1 parso 0.8.2 pyhd3eb1b0_0 pickleshare 0.7.5 pyhd3eb1b0_1003 pillow 8.4.0 py39hd45dc43_0 pip 21.2.4 py39haa95532_0 prometheus_client 0.11.0 pyhd3eb1b0_0 prompt-toolkit 3.0.20 pyhd3eb1b0_0 pycparser 2.20 py_2 pygments 2.10.0 pyhd3eb1b0_0 pyparsing 2.4.7 pyhd3eb1b0_0 pyqt 5.9.2 py39hd77b12b_6 pyrsistent 0.18.0 py39h2bbff1b_0 python 3.9.7 h6244533_1 python-dateutil 2.8.2 pyhd3eb1b0_0 pywin32 228 py39hbaba5e8_1 pywinpty 0.5.7 py39haa95532_0 pyzmq 22.2.1 py39hd77b12b_1 qt 5.9.7 vc14h73c81de_0 qtconsole 5.1.1 pyhd3eb1b0_0 qtpy 1.10.0 pyhd3eb1b0_0 send2trash 1.8.0 pyhd3eb1b0_1 setuptools 58.0.4 py39haa95532_0 sip 4.19.13 py39hd77b12b_0 six 1.16.0 pyhd3eb1b0_0 sqlite 3.36.0 h2bbff1b_0 terminado 0.9.4 py39haa95532_0 testpath 0.5.0 pyhd3eb1b0_0 tk 8.6.11 h2bbff1b_0 tornado 6.1 py39h2bbff1b_0 traitlets 5.1.0 pyhd3eb1b0_0 tzdata 2021e hda174b7_0 vc 14.2 h21ff451_1 vs2015_runtime 14.27.29016 h5e58377_2 wcwidth 0.2.5 pyhd3eb1b0_0 webencodings 0.5.1 py39haa95532_1 wheel 0.37.0 pyhd3eb1b0_1 wincertstore 0.2 py39haa95532_2 winpty 0.4.3 4 xz 5.2.5 h62dcd97_0 zipp 3.6.0 pyhd3eb1b0_0 zlib 1.2.11 h62dcd97_4 zstd 1.4.9 h19a0ad4_0 ```

maximlt commented 2 years ago

Also observed that on multiple CI systems.

chenghlee commented 2 years ago

Anaconda is soft yanking the Windows freetype 2.11.0 packages on defaults until we've figured out exactly what's going on. We've confirmed the matplotlib compatibility issue is Windows-specific; we decided to yank the package because we don't know if the root cause also impacts other freetype-dependents on Windows.

chenghlee commented 2 years ago

Additional information from Windows 10 Reliability Monitor

Problem Event Name: APPCRASH
Application Name:   python.exe
Application Version:    3.9.7150.1013
Application Timestamp:  6143c160
Fault Module Name:  freetype.dll
Fault Module Version:   2.11.0.0
Fault Module Timestamp: 617a927f
Exception Code: c0000005
Exception Offset:   00000000000087f7
OS Version: 10.0.19043.2.0.0.256.48
Locale ID:  1033
Additional Information 1:   aa35
Additional Information 2:   aa35a87258c5b29cd54ba0fdf92ba034
Additional Information 3:   86ec
Additional Information 4:   86ec0c7ecee2ca51507b54e89441513d

Output from WinDbg:

(3484.2f1c): Access violation - code c0000005 (first chance)
First chance exceptions are reported before any exception handling.
This exception may be expected and handled.
freetype!FT_Trace_Set_Default_Level+0x6887:
00007ffa`f16f87f7 418b5708        mov     edx,dword ptr [r15+8] ds:00000000`00000008=????????

 # Child-SP          RetAddr               Call Site
00 00000019`9a1e71d0 00007ffa`f16f2030     freetype!FT_Trace_Set_Default_Level+0x6887
01 00000019`9a1e72b0 00007ffa`f16fc224     freetype!FT_Trace_Set_Default_Level+0xc0
02 00000019`9a1e9720 00007ffa`f17a4de2     freetype!FT_Load_Glyph+0x374
03 00000019`9a1e9790 00007ffa`f17a9db9     ft2font_cp39_win_amd64+0x4de2
04 00000019`9a1e9890 00007ffa`f3d459f2     ft2font_cp39_win_amd64!PyInit_ft2font+0x3ba9
05 00000019`9a1e9990 00007ffa`f3cddcbd     python39!cfunction_call+0x46 [\objects\methodobject.c @ 554] 
06 (Inline Function) --------`--------     python39!_PyObject_MakeTpCall+0x8c8 [\objects\call.c @ 191] 
07 (Inline Function) --------`--------     python39!_PyObject_VectorcallTstate+0xc13 [\include\cpython\abstract.h @ 116] 
08 (Inline Function) --------`--------     python39!PyObject_Vectorcall+0xc30 [\include\cpython\abstract.h @ 127] 
09 00000019`9a1e99c0 00007ffa`f3d4e049     python39!call_function+0xc9d [\python\ceval.c @ 5075] 
0a 00000019`9a1e9b30 00007ffa`f3cdfff0     python39!_PyEval_EvalFrameDefault+0xe09 [\python\ceval.c @ 3536] 
0b (Inline Function) --------`--------     python39!_PyEval_EvalFrame+0x13 [\include\internal\pycore_ceval.h @ 40] 
0c 00000019`9a1e9c80 00007ffa`f3cdb3e4     python39!_PyEval_EvalCode+0x2b0 [\python\ceval.c @ 4327] 
0d (Inline Function) --------`--------     python39!_PyFunction_Vectorcall+0x273 [\objects\call.c @ 396] 
0e (Inline Function) --------`--------     python39!_PyObject_VectorcallTstate+0x2b2 [\include\cpython\abstract.h @ 118] 
0f 00000019`9a1e9d50 00007ffa`f3cdd10f     python39!method_vectorcall+0x324 [\objects\classobject.c @ 53] 
## ... cut ....
samionb commented 2 years ago

These are the only 2 related to FT_Load_Glyph in 2.11, could be one of them? https://github.com/freetype/freetype/commit/361465dec95a969bd351df8628d2346ffeb4ba5e https://github.com/freetype/freetype/commit/bed960d9484df1a0c9547ba6855f457d6629ffb5