Issue 30057: signal.signal should check tripped signals - Python tracker

This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: jdemeyer, pitrou
Priority: normal Keywords: patch

Created on 2017-04-12 15:52 by jdemeyer, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
fix30057-py2.patch jdemeyer, 2017-04-12 16:54 Patch for Python 2
fix30057-py3.patch jdemeyer, 2017-04-12 16:54 Patch for Python 3
Pull Requests
URL Status Linked Edit
PR 4258 merged pitrou, 2017-11-03 18:14
PR 4261 merged python-dev, 2017-11-03 18:59
PR 4263 merged pitrou, 2017-11-03 19:09
Messages (5)
msg291561 - (view) Author: Jeroen Demeyer (jdemeyer) * (Python triager) Date: 2017-04-12 15:52
There is a race condition in calling signal.signal() if the signal arrives while (or right before) signal.signal() is being executed: the function signal.signal(sig, action) marks the signal "sig" as not tripped. Because of this, signals can get lost. Instead, it would be better to call PyErr_CheckSignals() to check for pending signals.
msg305494 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2017-11-03 18:13
Thanks for the report! I will push your patch soon.
msg305497 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2017-11-03 18:58
New changeset f6f90ff079a22b79a58d47b6117cc8a8c7d366f3 by Antoine Pitrou in branch 'master':
bpo-30057: Fix potential missed signal in signal.signal(). (#4258)
https://github.com/python/cpython/commit/f6f90ff079a22b79a58d47b6117cc8a8c7d366f3
msg305499 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2017-11-03 19:23
New changeset ea80ae04e2ec68c7e289048d3224a24b3c3fb107 by Antoine Pitrou (Miss Islington (bot)) in branch '3.6':
bpo-30057: Fix potential missed signal in signal.signal(). (GH-4258) (#4261)
https://github.com/python/cpython/commit/ea80ae04e2ec68c7e289048d3224a24b3c3fb107
msg305501 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2017-11-03 19:36
New changeset c713837e91f39dc18740c74729cb7cebcf54fe6e by Antoine Pitrou in branch '2.7':
[2.7] bpo-30057: Fix potential missed signal in signal.signal(). (GH-4258) (#4263)
https://github.com/python/cpython/commit/c713837e91f39dc18740c74729cb7cebcf54fe6e