Project

General

Profile

Actions

Bug #2349

closed

fork() after signal(SIGCHLD, SIG_IGN) produces zombies

Added by matthiasr almost 12 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
04/17/2012
Due date:
% Done:

100%

Estimated time:

Description

The code in the attached zombifier.c makes every exiting child into a zombie on master1. This doesn't happen on any non-DragonFly system I could test it on, and from what I gather from this discussion2 and what Wikipedia says about SUSv3/POSIX-1.2001 the correct behaviour is not to keep them around if the SIGCHLD handler is explicitly set to SIG_IGN.

This has realworldly bitten me because the FCGI-to-CGI-wrapper I use4 relies on this behaviour and I couldn't SSH into my server as a non-root user due to PID exhaustion.

[1] DragonFly zz.2pktfkt.net 3.1-DEVELOPMENT DragonFly v3.1.0.545.g4c42b-DEVELOPMENT #6: Tue Apr 17 21:24:31 CEST 2012 :/usr/obj/usr/src/sys/X86_64_GENERIC x86_64
[2] http://markmail.org/message/3s4jj7dpgw34yvmh
[3] http://en.wikipedia.org/wiki/Zombie_process
[4] http://pkgsrc.se/wip/fcgiwrap


Files

zombifier.c (401 Bytes) zombifier.c test case – run and check "ps axl | fgrep zombifier" matthiasr, 04/17/2012 01:11 PM
dragonfly-SIGCHLD.patch (2.84 KB) dragonfly-SIGCHLD.patch proposed patch matthiasr, 04/17/2012 02:42 PM

Related issues 1 (0 open1 closed)

Related to Bug #2336: 3.0.3 catchall Resolved03/26/2012

Actions
Actions #1

Updated by herrgard almost 12 years ago

On Tue, Apr 17, 2012 at 01:11:09PM -0700, Matthias Rampke via Redmine wrote:

The code in the attached zombifier.c makes every exiting child into a zombie on master1. This doesn't happen on any non-DragonFly system I could test it on, and from what I gather from this discussion2 and what Wikipedia says about SUSv3/POSIX-1.2001 the correct behaviour is not to keep them around if the SIGCHLD handler is explicitly set to SIG_IGN.

This has realworldly bitten me because the FCGI-to-CGI-wrapper I use4 relies on this behaviour and I couldn't SSH into my server as a non-root user due to PID exhaustion.

Hm, maybe this could be the same reason why I keep getting zombies with firefox, thunderbird and xpdf all the time.

Max

Actions #2

Updated by matthiasr almost 12 years ago

Here's a patch against master I cargoculted from FreeBSD-current, taking the patches in that old thread as pointers. The kernel boots and works for me and the test case no longer generates zombie processes.

Actions #3

Updated by ftigeot almost 12 years ago

  • Status changed from New to Resolved
  • % Done changed from 50 to 100

Patch committed, thanks!

Actions #4

Updated by tuxillo over 11 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF