Skip to content

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

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