Issue 22015: C signal handler doesn't save/restore errno (original) (raw)

Issue22015

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:06 admin set github: 66214
2014-07-20 10:13:38 vstinner set status: open -> closedresolution: not a bugmessages: +
2014-07-20 09:37:48 vstinner create