Skip to content
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

Fix SEGFAULT from calling FT_New_Face/FT_Done_Face in multiple threads #8496

Merged

Conversation

lysnikolaou
Copy link
Contributor

Fixes #8454.

Changes proposed in this pull request:

  • Introduce a mutex that needs to be held every time FT_New_Face or FT_Done_Face are called.
  • Upgrade pythoncapi_compat.h to the latest version.

@hugovk hugovk added the Free-threading PEP 703 support label Oct 24, 2024
Copy link
Member

@hugovk hugovk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Copy link
Contributor

@nulano nulano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is anything here actually using the new changes in pythoncapi_compat.h?

There's no reason to stick with an old version, but I'm curious if there is a reason for updating it in what looks like an unrelated PR?

src/thirdparty/pythoncapi_compat.h Show resolved Hide resolved
@lysnikolaou
Copy link
Contributor Author

Is anything here actually using the new changes in pythoncapi_compat.h?

There's no reason to stick with an old version, but I'm curious if there is a reason for updating it in what looks like an unrelated PR?

No, upgrading pythoncapi_compat was actually needed in an earlier version of my patch, but I actually ended up not needing the new stuff.

However, I thought that it might be okay for the header to be upgraded anyway, that's why I left it in.

src/_imagingft.c Outdated Show resolved Hide resolved
@radarhere radarhere merged commit 9a4b3e0 into python-pillow:main Oct 26, 2024
47 of 48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Free-threading PEP 703 support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Segfault under free-threaded build
4 participants