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

pull PyCapsule_New() into the PYLOCK() section in poll_func() #83

Merged
merged 2 commits into from
Nov 14, 2024

Conversation

brgl
Copy link

@brgl brgl commented Nov 13, 2024

If we call PyCapsule_New() from a thread created by libfuse before ensuring the python interpreter is initialized, the thread state will be NULL and the program will crash with SEGFAULT.

As suggested by David Lechner: pull the call to PyCapsule_New() into the PYLOCK() section and open-code the rest of what was previously in the PROLOGUE() macro.

Closes: #82

@dlech

fuseparts/_fusemodule.c Outdated Show resolved Hide resolved
Bartosz Golaszewski added 2 commits November 13, 2024 16:19
PyCapsule_New() can fail and return NULL. Check the return value and go
right to OUT on failure.
If we call PyCapsule_New() from a thread created by libfuse before
ensuring the python interpreter is initialized, the thread state will be
NULL and the program will crash with SEGFAULT.

As suggested by David Lechner: pull the call to PyCapsule_New() into the
PYLOCK() section and open-code the rest of what was previously in the
PROLOGUE() macro.

Closes: libfuse#82
@sdelafond sdelafond merged commit 5e54c0c into libfuse:master Nov 14, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

poll() segfaults in PyCapsule_New()
3 participants