[Bug 915158] Re: Process is not closing

Jilles Tjoelker 915158 at bugs.launchpad.net
Fri Jan 20 17:46:33 UTC 2012


You can see the same problem with any shell with a command like

(sleep 3 & exec /bin/sleep 6)

because most versions of /bin/sleep do not clean up zombies (here, a
zombie from an inherited child process).

Dash does not consider the existence of a background process a reason to
fork for an external command (that needs to be execve()'ed). Therefore
you may see zombies if you start some background jobs and the final
command is external and does not clean up zombies it did not start
itself. As a workaround you can add a builtin at the end, for example

(sleep 3 & sleep 6; exit $?)

With bash, this does not happen because bash appears to fork always for
an external command unless it is the only thing to be run in the process
at all. However, this policy results in more process creations than
necessary and therefore poorer performance.

POSIX does not appear to say much about whether the shell should allow
commands to inherit child processes in this manner. However, a shell is
definitely not required to fork as much as bash does.

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

Title:
  Process is not closing

Status in “dash” package in Ubuntu:
  New

Bug description:
  I'm using Ubuntu 12.04 dev and sometimes I'm seeing zombie processes
  which are using no virtual memory and not closing. They will only
  close if their parent process closes. For example if I start
  lxterminal and opening htop I will see that there are 2 lxterminal
  processes. One normal process and one forked process which is a
  zombie. The same happens sometimes with lxdm-binary if I login into my
  desktop. In the attachments is a screenshot from such processes.

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




More information about the foundations-bugs mailing list