delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/1998/06/03/15:52:25

From: newsham AT lava DOT net (Tim Newsham)
Subject: error when maxing out processes
3 Jun 1998 15:52:25 -0700 :
Message-ID: <m0yhMCi-0011gIC.cygnus.cygwin32.developers@malasada.lava.net>
Mime-Version: 1.0
To: cygwin32-developers AT cygnus DOT com

Hi,

     I notice an internal cygwin error being displayed when I max
out the process table.  The error:

    wait_subproc: wait failed.  nchildren 64, wait -1, err 87

The test program that reproduces it is below.  To reproduce run the
forker.  I get the error message after about 64 forks.  The process
table maxes out after about 100 forks (process table size is 128 in
cygwin I believe -- does it have to be static, btw?  Can we have
a dynamic process table size?).  After running, you will have to
kill the processes off before being able to reproduce again.

I havent tried to debug this at all (we're working like crazy to
debug other cygwin and non-cygwin problems at the moment).

                                             Tim N.

---- sleeper.c : compile as sleeper.exe ----
main() { sleep(60 * 2); }
---- end sleeper.c ----


---- forker.c ----
#include <signal.h>
#include <sys/types.h>

main()
{
    int pid, count;

    signal(SIGCLD, SIG_IGN);

    for(count = 0; ; count++) {
        pid = fork();
        if(pid == -1) {
            perror("fork");
            printf("count %d\n", count);
            return 0;
        }
        if(pid == 0) {
            execl("./sleeper.exe", "sleeper", 0);
            perror("execl");
            exit(1);
        }
        printf("%d\n", count);
    }
}
---- end forker.c ----

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019