Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling of SIGCHLD within sage #14639

Open
SnarkBoojum mannequin opened this issue May 25, 2013 · 0 comments
Open

Handling of SIGCHLD within sage #14639

SnarkBoojum mannequin opened this issue May 25, 2013 · 0 comments

Comments

@SnarkBoojum
Copy link
Mannequin

SnarkBoojum mannequin commented May 25, 2013

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
"""

Component: doctest coverage

Issue created by migration from https://trac.sagemath.org/ticket/14639

@SnarkBoojum SnarkBoojum mannequin added this to the sage-5.11 milestone May 25, 2013
@SnarkBoojum SnarkBoojum mannequin added t: tests labels May 25, 2013
@jdemeyer jdemeyer modified the milestones: sage-5.11, sage-5.12 Aug 13, 2013
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.1, sage-6.2 Jan 30, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.2, sage-6.3 May 6, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.3, sage-6.4 Aug 10, 2014
@mkoeppe mkoeppe removed this from the sage-6.4 milestone Dec 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants