New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crash of _imagingft.cp39-win_amd64.pyd under Windows 10 #6374
Comments
Interesting. I presume this is the same problem as #6314. PR #6341 will help this slightly, so that importing ImageDraw should be fixed, but importing ImageFont will still fail. That will be released as part of Pillow 9.2.0, due out on July 1. In that other issue, we have determined what the change was that caused the problem, but not why it is happening. Would you be able to answer the following question (from this comment)?
|
Thanks for the feedback ! I have some libfribidi-0.dll in some application folders (Geany, Avidemux, Inkscape), but they seem unrelated I have this DLL, though, which is in the PATH : When I rename it to _fribidi.dll, the crashing of ImageDraw stops! So this seems to be the culprit, however I don't even know where one can find proper fribidi.dll, I only find source codes, online, or dubious dlls on third-party file depots. I thought that since python3.8, DLL resolution ignored the PATH ? https://docs.python.org/3/whatsnew/3.8.html#bpo-36085-whatsnew Here is the faulting fribidi, in case it helps seing what's wrong with this version ? |
I'll take a look at why it's crashing.
For now you can download fribidi.dll from https://www.lfd.uci.edu/~gohlke/pythonlibs/, but that seems to be going away by the end of this month. You can also use the scripts in https://github.com/python-pillow/Pillow/tree/main/winbuild to compile your own fribidi.dll.
When loading fribidi.dll, Pillow doesn't ignore PATH, just checks it last after all other places (as listed in the comment above). If you have a non-crashing fribidi.dll in an earlier directory (e.g. next to python.exe), it would prevent a crash. Edit: Actually, I think I was confused by a separate change to the loading mechanism. In addition to changing how DLLs are loaded in ctypes, there was also a change to which DLL search order is the default. Pillow does not use ctypes to load fribidi, so is affected only by the latter change. |
It looks like your fribidi.dll is FriBiDi 0.19.2 (likely released on 2009-03-26). For some reason, it seems to be missing This is causing a null pointer dereference in Pillow. Pillow/src/thirdparty/fribidi-shim/fribidi.c Lines 97 to 98 in 765d66c
I have created PR #6376 to correct the null check. |
If neither While the Inkscape directory is not listed in PATH, I just tested its |
Niiiice, thanks for the fixes :) They mention on lfd.uci.edu that their DLLs are most likely not compatible with OSGeo4W and the likes, so it's nice that it be solvable in Pillow directly ! |
Same issue, and @pakal's workaround worked for me. On Windows, you can use |
When I install recent Pillow versions on Windows 10, under both python3.8 or 3.9, it crashes brutally when loading ImageDraw.py
No information except in Windows logs, e.g. for Python3.9:
It checked this _imagingft.cp39-win_amd64.pyd with a dependency lister, all DLL dependencies seem ok.
The only workaround I found was installing an old version Pillow<=8.3.0
The text was updated successfully, but these errors were encountered: