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: Signal fixes for BSD systems
Type: Stage:
Components: None Versions:
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: anthonybaxter Nosy List: anthonybaxter, kbk, lukem, mwh
Priority: normal Keywords: patch

Created on 2004-06-18 00:05 by lukem, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
pythonsig.diff lukem, 2004-06-18 00:05 SA_RESTART-signal-fix
pythonsigs2.diff mwh, 2004-09-14 17:25 mwh's updated version
Messages (6)
msg46190 - (view) Author: Luke Mewburn (lukem) Date: 2004-06-18 00:05
As documented in bug 969574, restartable signals are
not correctly disabled on BSD systems (e.g, NetBSD 2.0,
FreeBSD 4.8).

The attached patch is a more complete version of the
one I provided in that bug report, and it more closely
follows the patch submission guidelines (context
instead of unified diff, against python CVS instead of
python 2.3.4, ...).  It also fixes:
* A few sections of the tree that weren't converted
from signal() to PyOS_setsig().
* There's no need to call siginterrupt() before
PyOS_setsig() in Module/signalmodule.c because
PyOS_setsig() handles that, and calling siginterrupt()
before changing a signal's handler (via
signal/sigaction) doesn't work correctly anyway; it
should have been called after.

I have compiled the source with and without
"--without-signal-module" and successfully run "make
test" on both cases.

Suggested NEWS entry:
===
Bug #969574: Restartable signals were not correctly
disabled on BSD systems. Consistently use PyOS_setsig()
instead of signal().
===

Cheers,
Luke.
msg46191 - (view) Author: Michael Hudson (mwh) (Python committer) Date: 2004-09-14 17:25
Logged In: YES 
user_id=6656

The patch has bitrotted slightly.  I'm attaching an updated
version.

It looks reasonable to me, though I'm officially leery of
checking in patches that affect platforms I can't test...
msg46192 - (view) Author: Luke Mewburn (lukem) Date: 2004-09-16 13:47
Logged In: YES 
user_id=135998

Whilst NetBSD isn't the world's most common UNIX operating
system, FreeBSD 4.x is fairly widespread _and_ is affected
by the bug as well... :)
msg46193 - (view) Author: Anthony Baxter (anthonybaxter) (Python triager) Date: 2004-10-13 14:56
Logged In: YES 
user_id=29957

Applied. I've tried it on a bunch of systems I can get
access to - you (Luke) probably have more, so feel free to
grab CVS and try it out there.
msg46194 - (view) Author: Luke Mewburn (lukem) Date: 2004-10-15 03:53
Logged In: YES 
user_id=135998

The latest version in CVS appears to work OK on NetBSD.
msg46195 - (view) Author: Kurt B. Kaiser (kbk) * (Python committer) Date: 2004-10-15 05:05
Logged In: YES 
user_id=149084

OpenBSD 3.3 didn't exhibit the bug before the change.
It appears to be fine after the change, passes make test.
History
Date User Action Args
2022-04-11 14:56:04adminsetgithub: 40413
2004-06-18 00:05:35lukemcreate