Skip to content

[3.9] bpo-43406: Fix possible race condition where PyErr_CheckSignals tries to execute a non-Python signal handler (GH-24756) #24761

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

Merged
merged 1 commit into from
Mar 6, 2021

Conversation

miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Mar 5, 2021

We can receive signals (at the C level, in trip_signal() in signalmodule.c) while signal.signal is being called to modify the corresponding handler. Later when PyErr_CheckSignals() is called to handle the given signal, the handler may be a non-callable object and would raise a cryptic asynchronous exception.
(cherry picked from commit 68245b7)

Co-authored-by: Antoine Pitrou [email protected]

https://bugs.python.org/issue43406

Automerge-Triggered-By: GH:pitrou

…ries to execute a non-Python signal handler (pythonGH-24756)

We can receive signals (at the C level, in `trip_signal()` in signalmodule.c) while `signal.signal` is being called to modify the corresponding handler.  Later when `PyErr_CheckSignals()` is called to handle the given signal, the handler may be a non-callable object and would raise a cryptic asynchronous exception.
(cherry picked from commit 68245b7)

Co-authored-by: Antoine Pitrou <[email protected]>
@miss-islington
Copy link
Contributor Author

@pitrou: Status check is done, and it's a success ✅ .

@miss-islington
Copy link
Contributor Author

@pitrou: Status check is done, and it's a success ✅ .

1 similar comment
@miss-islington
Copy link
Contributor Author

@pitrou: Status check is done, and it's a success ✅ .

@pitrou
Copy link
Member

pitrou commented Mar 5, 2021

@pablogsal Is this backport ok to you?

@miss-islington
Copy link
Contributor Author

@pitrou: Status check is done, and it's a success ✅ .

@miss-islington
Copy link
Contributor Author

Sorry, I can't merge this PR. Reason: Pull Request is not mergeable.

@miss-islington miss-islington merged commit 1385f83 into python:3.9 Mar 6, 2021
@miss-islington miss-islington deleted the backport-68245b7-3.9 branch March 6, 2021 15:07
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.

4 participants