Mail Archives: cygwin-developers/1998/08/05/05:28:31
I have written a test program (below) that shows the problem sometimes. The
test program is run with a parameter specifying the number of processes to
spawn. I have been running it with 10 or 20. Only about one run in 10 shows
the problem. I have the strace output from one of the runs where the
problem occurred.
I have tried the cygwinb19.dll.gz from ftp.cygnus.com/private/home/cgf and
could not get the problem to occur. I did get an access violation reported
several times. I have the strace output from one of the runs where the
access violation was reported.
Each of the strace output files are just under 40k when gzipped, so I will
not send them to the mailing list.
btw after running my test program about 10 times with the new dll, the
following message was output each time the bash prompt was redisplayed:
Couldn't decommit stack memory 0xE5E0000(33583104) for read of /dev/conin,
err 0
------ test program ------
#include <stdio.h>
#include <stdlib.h>
#include <process.h>
#include <sys/wait.h>
#include <signal.h>
typedef void SigHandler ();
static void
set_signal_handler (sig, handler)
int sig;
SigHandler *handler;
{
struct sigaction act, oact;
act.sa_handler = handler;
act.sa_flags = 0;
sigemptyset (&act.sa_mask);
sigemptyset (&oact.sa_mask);
sigaction (sig, &act, &oact);
return;
}
/* sigchld_handler () flushes at least one of the children that we are
waiting for. It gets run when we have gotten a SIGCHLD signal. */
static void
sigchld_handler (sig)
int sig;
{
int status;
pid_t pid;
pid = waitpid ((pid_t)-1, &status, WUNTRACED | WNOHANG);
}
/* Set the handler to run when the shell receives a SIGCHLD signal. */
static void
set_sigchld_handler ()
{
set_signal_handler (SIGCHLD, sigchld_handler);
}
int main(int argc, char** argv)
{
int count = argc > 1 ? atoi(argv[1]) : 0;
/* if there is a non-zero count, then spawn some processes,
otherwise exit immediately */
if (count > 0)
{
int i;
pid_t last_pid;
set_sigchld_handler ();
for (i = 0; i < count; i++)
{
last_pid = spawnl(_P_NOWAIT, argv[0], argv[0], NULL);
}
}
return 0;
}
- Raw text -