Skip to content

Fix suspending with process groups #49

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

Merged
merged 1 commit into from
May 21, 2022
Merged

Conversation

blueyed
Copy link
Collaborator

@blueyed blueyed commented May 19, 2022

Since using raw mode via raw.lflag &= ~(… | termios.ISIG) pyrepl needs
to handle SIGSTOP itself, but before this patch would only signal its
own process.
Using 0 for the pid signals the process group instead.

Manual test:

When running the following from a shell Ctrl-z will not give you the
shell's prompt, but the process is stuck, and needs to be signaled to
continue using kill -CONT $pid:

python -c 'import os; os.system("python pyrepl/reader.py")'

I have noticed this when using pdbpp with pytest, which was wrapped in a
shell script, not using exec python ….

Since using raw mode via `raw.lflag &= ~(… | termios.ISIG)` pyrepl needs
to handle SIGSTOP itself, but before this patch would only signal its
own process.
Using `0` for the pid signals the process group instead.

Manual test:

When running the following from a shell `Ctrl-z` will not give you the
shell's prompt, but the process is stuck, and needs to be signaled to
continue using `kill -CONT $pid`:

> python -c 'import os; os.system("python pyrepl/reader.py")'

I have noticed this when using pdbpp with pytest, which was wrapped in a
shell script, not using `exec python …`.
blueyed added a commit to blueyed/pyrepl that referenced this pull request May 19, 2022
I have not seen this to be necessary, but it goes in line with handling
SIGSTOP then (pypy#49).
@mattip
Copy link
Member

mattip commented May 20, 2022

cool, I also have noticed this problem.

@blueyed blueyed merged commit ca192a8 into pypy:master May 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants