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: test_signal hangs -- signal broken on OpenBSD?
Type: Stage:
Components: Installation Versions: Python 2.2
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: facundobatista, frallan, mwh, noah
Priority: normal Keywords:

Created on 2002-04-26 13:54 by noah, last changed 2022-04-10 16:05 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
config_stuff.tar noah, 2002-04-26 13:54 My config.log and config.cache after running './configure'
Messages (7)
msg10545 - (view) Author: Noah Spurrier (noah) Date: 2002-04-26 13:54
This appears to be similar to bug as PR#288,
    [ 210635 ] test_signal hangs when running 
    as part of testall (PR#288)

except that I have this problem on a fresh install of
OpenBSD 3.0 while trying to build Python-2.2.1.
I did a generic build running as root:
    ./configure
    ./make
    ./make test

Yours,
Noah

msg10546 - (view) Author: Noah Spurrier (noah) Date: 2002-04-27 15:40
Logged In: YES 
user_id=59261

Below is the output of test_signal.py. I ran it manually. I 
modified it slightly to print out the pid; the return 
values from the signal calls; and to print a count of the 
loop iteration (starting at 1). You can see that after 
Count 4 it just sits there. After about a minute I hit Ctrl-
Z. I have uploaded the modified version of test_signal.py.
...
bash-2.05# python test_signal.py 
pid: 8606
signal.alarm(20): 0
signal.signal(5, handlerA): 0
signal.signal(2, handlerB): <built-in function 
default_int_handler>
signal.signal(3, signal.SIG_IGN): 0
signal.signal(signal.SIGALRM, signal.default_int_handler): 0
starting pause() loop...
+ sleep 2
count: 1
call pause()...
+ kill -5 8606
pause() returned
+ sleep 2
count: 2
call pause()...
+ kill -2 8606
pause() returned
+ sleep 2
count: 3
call pause()...
+ kill -3 8606
pause() returned
count: 4
call pause()...
^Z
[1]+  Stopped                 python test_signal.py
bash-2.05# ps -p 8606
  PID TT   STAT      TIME COMMAND
 8606 p0  T       0:00.09 python test_signal.py 
bash-2.05# uname -a
OpenBSD nobot 3.0 GENERIC#94 i386
bash-2.05# python
Python 2.2.1 (#4, Apr 26 2002, 23:06:40) 
[GCC 2.95.3 20010125 (prerelease)] on openbsd3



msg10547 - (view) Author: Frallan the master Jedi (frallan) Date: 2002-10-31 09:48
Logged In: YES 
user_id=639616

I get the exact same behavior on OpenBSD 3.1 with Python-
2.2.2. Also this simple test program from the "Python 
Standard Library" book - fails. The program terminates but 
the "got signal" message is never printed.

import signal
import time

def handler (signo, frame):
    print 'got signal', signo

signal.signal(signal.SIGALRM, handler)
# wake me up in two seconds
signal.alarm(2)
now = time.time()
time.sleep(200)
print 'slept for', time.time() - now, "seconds"
msg10548 - (view) Author: Michael Hudson (mwh) (Python committer) Date: 2002-10-31 10:49
Logged In: YES 
user_id=6656

As far as I am aware (not very) Python signals have always
been broken on OpenBSD.  None of the Python core developers
use OpenBSD, though, so it's always remained a mystery.

frallan, does the C equivalent of your Python test work?  Do
you have any idea what Python (or OpenBSD, maybe) is doing
wrong?

signals are pain.
msg10549 - (view) Author: Frallan the master Jedi (frallan) Date: 2003-12-11 12:14
Logged In: YES 
user_id=639616

My test program now works. It both terminates and prints 
the 'got signal' message. 

Current Platform is:
OpenBSD somewhere 3.3 GENERIC#44 i386
Python 2.3.2 (#1, Dec  1 2003, 11:20:01)
[GCC 2.95.3 20010125 (prerelease, propolice)] on openbsd3

I should receive my OpenBSD 3.4  CDs soon. Then I'll test 
that too.
msg10550 - (view) Author: Facundo Batista (facundobatista) * (Python committer) Date: 2004-12-26 22:02
Logged In: YES 
user_id=752496

Please, could you verify if this problem persists in Python 2.3.4
or 2.4?

If yes, in which version? Can you provide a test case?

If the problem is solved, from which version?

Note that if you fail to answer in one month, I'll close this bug
as "Won't fix".

Thank you! 

.    Facundo
msg10551 - (view) Author: Facundo Batista (facundobatista) * (Python committer) Date: 2005-05-30 18:03
Logged In: YES 
user_id=752496

Deprecated. Reopen only if still happens in 2.3 or newer. 

.    Facundo
History
Date User Action Args
2022-04-10 16:05:16adminsetgithub: 36504
2002-04-26 13:54:44noahcreate