diff --git a/news/TEMPLATE.rst b/news/TEMPLATE.rst index ba9f854ef..1cba5ede1 100644 --- a/news/TEMPLATE.rst +++ b/news/TEMPLATE.rst @@ -6,6 +6,10 @@ **Removed:** None -**Fixed:** None +**Fixed:** + +* Fixed a bug which under very rare conditions could cause the shell + to die with PermissionError exception while sending SIGSTOP signal + to a child process. **Security:** None diff --git a/xonsh/proc.py b/xonsh/proc.py index 53891d58e..a4e8a76a1 100644 --- a/xonsh/proc.py +++ b/xonsh/proc.py @@ -2419,7 +2419,10 @@ def pause_call_resume(p, f, *args, **kwargs): hasattr(p, "send_signal") and ON_POSIX and not ON_MSYS and not ON_CYGWIN ) if can_send_signal: - p.send_signal(signal.SIGSTOP) + try: + p.send_signal(signal.SIGSTOP) + except PermissionError: + pass try: f(*args, **kwargs) except Exception: