Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 2 Mar 2003 15:28:33 -0800 (PST)
From:      Joel Ray Holveck <joelh@piqnet.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   bin/48856: Setting SIGCHLD to SIG_IGN still leaves zombies under threads
Message-ID:  <200303022328.h22NSXwX040923@thor.piqnet.org>

next in thread | raw e-mail | index | archive | help

>Number:         48856
>Category:       bin
>Synopsis:       Setting SIGCHLD to SIG_IGN still leaves zombies under threads
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Mar 02 15:30:17 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     Joel Ray Holveck
>Release:        FreeBSD 5.0-RELEASE i386
>Organization:
>Environment:

System: FreeBSD thor.piqnet.org 5.0-RELEASE FreeBSD 5.0-RELEASE #13: Sun Feb 9 17:11:33 PST 2003 root@thor.piqnet.org:/usr/local/src/freebsd/src/sys/i386/compile/THOR i386
Also a problem under:
FreeBSD sindri.juniper.net 4.5-RELEASE FreeBSD 4.5-RELEASE #1: Sun Jan 26 15:01:15 PST 2003     root@sindri.juniper.net:/usr/src/sys/compile/SINDRI  i386

>Description:

Using pthreads under 4.x and 5.0, setting SIGCHLD to SIG_IGN still
leaves zombies.  Some programs may create many children and count on
setting SIGCHLD to SIG_IGN to avoid waiting.

>How-To-Repeat:

thor$ cat > foo.c    
    #include <sys/types.h>
    #include <signal.h>
    #include <stdlib.h>
    #include <unistd.h>

    int
    main()
    {
      signal (SIGCHLD, SIG_IGN);
      if (fork()) {
        sleep(1000);
      }
      exit(0);
    }
thor$ gcc foo.c
thor$ ./a.out &
[1] 40860
thor$ ps ax | grep a.out
    0  p1  ZW     0:00.00  (a.out)
40860  p1  S      0:00.01 ./a.out
40869  p1  S+     0:00.01 grep a.out
thor$ 

>Fix:

I don't see a trivial fix, but it looks like adding the proper code to
uthread_sig.c wouldn't be very hard.

As a workaround, this bug does not exist in kthreads.  This isn't much
of a workaround, since a lot more bugs are suspected to be in
kthreads.
>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200303022328.h22NSXwX040923>