#14639: Handling of SIGCHLD within sage
--------------------------------+-------------------------------------------
Reporter: Snark | Owner: mvngu
Type: defect | Status: new
Priority: major | Milestone: sage-5.10
Component: doctest coverage | Keywords:
Work issues: | Report Upstream: N/A
Reviewers: | Authors:
Merged in: | Dependencies:
Stopgaps: |
--------------------------------+-------------------------------------------
It has been noted at #14636 that sage's handling of the SIGCHLD signal is
prone to breakage. To doctest whether things are correct, Jeroen Demeyer
proposed to add the following to sage/tests/interrupt.pyx:
{{{
"""
Show that `SIGCHLD` is completely ignored by default. If the process
`p` finishes, there should be no `SIGCHLD` signal, so ``select()`` will
simply time out::
sage: from select import select
sage: import subprocess
sage: p = subprocess.Popen(["sleep", "1"]) # long time
sage: select([], [], [], 1.5) # long time
([], [], [])
sage: p.poll() # long time
0
We now do the same but after installing a dummy `SIGCHLD`
handler::
sage: import signal
sage: def dummy_handler(a,b):
....: pass
sage: signal.signal(signal.SIGCHLD, dummy_handler) # random
sage: p = subprocess.Popen(["sleep", "1"]) # long time
sage: select([], [], [], 1.5) # long time
Traceback (most recent call last):
...
error: (4, 'Interrupted system call')
sage: p.poll() # long time
0
Reset the `SIGCHLD` handler::
sage: signal.signal(signal.SIGCHLD, signal.SIG_IGN) # random
"""
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14639>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.