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
Title: C signal handler doesn't save/restore errno
Type: Stage:
Components: Versions: Python 3.4, Python 3.5, Python 2.7
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: neologix, pitrou, vstinner
Priority: normal Keywords: patch

Created on 2014-07-20 09:37 by vstinner, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
signal_errno.patch vstinner, 2014-07-20 09:37 review
Messages (2)
msg223504 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2014-07-20 09:37
The signal module has a wakefd feature which calls write(fd) in a signal handler, but the signal handler replaces errno without saving/restoring it.

See "Practice 4" in this article:
http://www.ibm.com/developerworks/linux/library/l-reent/index.html

Attached patch fixes the issue for Python 3.5. The bug should be fixed in Python 2.7, 3.4 and 3.5.
msg223505 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2014-07-20 10:13
Ooops, I looked at the wrong function. signal_handler() saves/restores errno. trip_signal() is a function called by signal_handler(). The code is correct.
History
Date User Action Args
2022-04-11 14:58:06adminsetgithub: 66214
2014-07-20 10:13:38vstinnersetstatus: open -> closed
resolution: not a bug
messages: + msg223505
2014-07-20 09:37:48vstinnercreate