[Bug 1987991] Re: fg in zsh sometimes fails to restore stopped job

Ubuntu Foundations Team Bug Bot 1987991 at bugs.launchpad.net
Mon Aug 29 00:23:03 UTC 2022


The attachment "zsh-fg.diff" seems to be a patch.  If it isn't, please
remove the "patch" flag from the attachment, remove the "patch" tag, and
if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by
~brian-murray, for any issues please contact him.]

** Tags added: patch

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to zsh in Ubuntu.
https://bugs.launchpad.net/bugs/1987991

Title:
  fg in zsh sometimes fails to restore stopped job

Status in zsh package in Ubuntu:
  New

Bug description:
  To reproduce the problem:

  1. Run zsh on Ubuntu 22.04 LTS (also happens on 20.04 LTS)
  2. Run vim and hit Control-Z to stop it
  3. Enter "fg" to restore the stopped job

  I expect fg to always be able to restore a stopped vim. Instead,
  sometimes vim stops itself again immediately after entering fg. The
  problem seems to be timing or scheduling related because it doesn't
  always occur.

  This is due to a known bug in zsh versions 5.7, 5.7.1, 5.8, and 5.8.1.
  It was reported to the zsh project by Erik Paulson in June 2021, who
  also provided a one-line fix. The zsh project accepted Paulson's fix,
  which is now available in zsh 5.9.

  The bug causes zsh to sometimes send two SIGCONT signals to the
  stopped job instead of only one. Certain programs behave unexpectedly
  when processing the second SIGCONT. vim stops itself. According to
  Paulson's bug report, emacsclient crashes.

  Paulson's original bug report with patch:
  https://www.zsh.org/mla/workers/2021/msg01255.html

  The git commit that introduced the bug in Sept 2018:
  https://github.com/zsh-users/zsh/commit/0a20f4e5a64106d1793dd44d2fa0113417225d0f

  The git commit of Paulson's fix:
  https://github.com/zsh-users/zsh/commit/f8ec33c453159ad848d9b1a28782c5df7f0cc944

  The test program in this Stack Overflow question is a good way to reproduce the problem. With this program it is easy to see the two SIGCONT signals being sent sometimes by zsh fg:
  https://stackoverflow.com/questions/64531411/why-do-i-receive-two-sigcont-signals

  ProblemType: Bug
  DistroRelease: Ubuntu 22.04
  Package: zsh 5.8.1-1
  ProcVersionSignature: Ubuntu 5.15.0-46.49-generic 5.15.39
  Uname: Linux 5.15.0-46-generic x86_64
  ApportVersion: 2.20.11-0ubuntu82.1
  Architecture: amd64
  CasperMD5CheckResult: unknown
  Date: Sun Aug 28 14:06:07 2022
  ProcEnviron:
   TERM=screen.xterm-256color
   PATH=(custom, no user)
   XDG_RUNTIME_DIR=<set>
   LANG=C.UTF-8
   SHELL=zsh
  SourcePackage: zsh
  UpgradeStatus: No upgrade log present (probably fresh install)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/zsh/+bug/1987991/+subscriptions




More information about the foundations-bugs mailing list