* Help on <defunct> (zombie) handling
@ 1998-05-22 4:00 yalcin.yildirim
1998-05-22 4:00 ` Jeff Denham
0 siblings, 1 reply; 3+ messages in thread
From: yalcin.yildirim @ 1998-05-22 4:00 UTC (permalink / raw)
Dear All,
My program generates child processes without waiting them to terminate.
Therefore the terminating child create <defunct> (zombie). To handle this
situation I use SA_NOCLDWAIT macro, but this action changes the way the
program runs. This program segment first written on Solaris 2.5.1 and run
without any problems, however when ported to Digital Unix 4.0, this part
fails. I would appreciate any help on this case.
Thanks,
Yalcin
struct sigaction act, oact;
act.sa_flags = SA_NOCLDWAIT;
if ( sigaction( SIGCHLD, &act, &oact ) == -1 )
{
perror( "sigaction failed\n" );
exit (1);
}
if ( ( pid = fork() ) == 0 )
{
execlp( "/bin/a_function", "a_function", (char *) 0 );
}
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: Help on <defunct> (zombie) handling 1998-05-22 4:00 Help on <defunct> (zombie) handling yalcin.yildirim @ 1998-05-22 4:00 ` Jeff Denham 1998-05-22 4:00 ` yalcin.yildirim 0 siblings, 1 reply; 3+ messages in thread From: Jeff Denham @ 1998-05-22 4:00 UTC (permalink / raw) Could you be a little more specific about what's different between the execution with and w/o SA_NOCLDWAIT, and what exactly fails in the code fragment? All I can guess is that the exec fails for some reason?? yalcin.yildirim@turkcell.com.tr wrote: > Dear All, > > My program generates child processes without waiting them to terminate. > Therefore the terminating child create <defunct> (zombie). To handle this > situation I use SA_NOCLDWAIT macro, but this action changes the way the > program runs. This program segment first written on Solaris 2.5.1 and run > without any problems, however when ported to Digital Unix 4.0, this part > fails. I would appreciate any help on this case. > > Thanks, > Yalcin > > struct sigaction act, oact; > > act.sa_flags = SA_NOCLDWAIT; > > if ( sigaction( SIGCHLD, &act, &oact ) == -1 ) > { > perror( "sigaction failed\n" ); > exit (1); > } > > if ( ( pid = fork() ) == 0 ) > { > execlp( "/bin/a_function", "a_function", (char *) 0 ); > } > > -----== Posted via Deja News, The Leader in Internet Discussion ==----- > http://www.dejanews.com/ Now offering spam-free web-based newsreading -- __________________________________________________ Jeff Denham (jdenham@brighttiger.com) Bright Tiger Technologies SmartCluster� Software for Distributed Web Servers http://www.brighttiger.com 125 Nagog Park Acton, MA 01720 Phone: (978) 263-5455 x177 Fax: (978) 263-5547 ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Help on <defunct> (zombie) handling 1998-05-22 4:00 ` Jeff Denham @ 1998-05-22 4:00 ` yalcin.yildirim 0 siblings, 0 replies; 3+ messages in thread From: yalcin.yildirim @ 1998-05-22 4:00 UTC (permalink / raw) [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #1: Type: text/plain, Size: 2359 bytes --] Without excution of the SA_NOCLDWAIT, the child processes perform their task pretty well, however while they are terminating, they turn out to be zombie. With execution of SA_NOCLDWAIT, with the first execution of the exec function, the parent exits without any error messages. I modify the exec part to control errors as below, but it didn' t yield any error messages from the exec function if ( ( pid = fork() ) == 0 ) { if ( execlp( "/bin/a_function", "a_function", (char *) 0 ) == -1 ) { perror( "exec error" ); exit( 1 ); } } In article <35657375.9C0688B4@brighttiger.com>, Jeff Denham <jdenham@brighttiger.com> wrote: > > Could you be a little more specific about what's different between the > execution with and w/o SA_NOCLDWAIT, and what exactly > fails in the code fragment? All I can guess is that the exec fails for > some reason?? > > yalcin.yildirim@turkcell.com.tr wrote: > > > Dear All, > > > > My program generates child processes without waiting them to terminate. > > Therefore the terminating child create <defunct> (zombie). To handle this > > situation I use SA_NOCLDWAIT macro, but this action changes the way the > > program runs. This program segment first written on Solaris 2.5.1 and run > > without any problems, however when ported to Digital Unix 4.0, this part > > fails. I would appreciate any help on this case. > > > > Thanks, > > Yalcin > > > > struct sigaction act, oact; > > > > act.sa_flags = SA_NOCLDWAIT; > > > > if ( sigaction( SIGCHLD, &act, &oact ) == -1 ) > > { > > perror( "sigaction failed\n" ); > > exit (1); > > } > > > > if ( ( pid = fork() ) == 0 ) > > { > > execlp( "/bin/a_function", "a_function", (char *) 0 ); > > } > > > > -----== Posted via Deja News, The Leader in Internet Discussion ==----- > > http://www.dejanews.com/ Now offering spam-free web-based newsreading > > -- > __________________________________________________ > Jeff Denham (jdenham@brighttiger.com) > > Bright Tiger Technologies > SmartCluster� Software for Distributed Web Servers > http://www.brighttiger.com > > 125 Nagog Park > Acton, MA 01720 > Phone: (978) 263-5455 x177 > Fax: (978) 263-5547 > > -----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/ Now offering spam-free web-based newsreading ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~1998-05-22 4:00 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 1998-05-22 4:00 Help on <defunct> (zombie) handling yalcin.yildirim 1998-05-22 4:00 ` Jeff Denham 1998-05-22 4:00 ` yalcin.yildirim
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox