[Mplayer-cvslog] CVS: main mplayer.c,1.786,1.787

Torinthiel torinthiel at megapolis.pl
Fri Sep 17 00:14:23 CEST 2004


On Thu, Sep 16, 2004 at 05:29:05PM -0400, D Richard Felker III wrote:
> > > will the children get reaped when they exit, or will zombie processes
> > > hang around forever??
> > 
> > I'm not sure what you mean. The children will run as if you started them from 
> > another shell. They are completely independant from MPlayer after the start. 
> 
> no they are not! any process that spawns child processes has to wait()
> for them in the sigchld handler. otherwise they will become zombies
> and keep using a pid forever until the parent process dies. mplayer
> may already do this, but you need to check...

WTF? Yes they are. Every process that looses parent is adopted by init.
And init then takes care of freeing pid.
Oh, maybe if it's already dead by the time MPlayer finishes than
something may go wrong. Testing...
kraken:~/mplayer/mplayer-pl/DOCS/pl$ ps -l
F S   UID   PID  PPID  C PRI  NI ADDR SZ WCHAN  TTY          TIME CMD
0 S   500  4299  4297  0  75   0 -   693 wait4  pts/2    00:00:00 bash
0 S   500  4333  4299  0  68   0 -   449 wait4  pts/2    00:00:00 groff
0 S   500  4335  4333  0  69   0 -   492 pipe_w pts/2    00:00:00 pre-grohtml
0 S   500  4336  4333  0  69   0 -   460 pipe_w pts/2    00:00:00 post-grohtml
0 Z   500  4337  4335  0  68   0 -     0 exit   pts/2    00:00:00 groff <defunct>
0 R   500  4396  4299  0  77   0 -   751 -      pts/2    00:00:00 ps
[ so second groff is dead, pre-html does not handle it]
kraken:~/mplayer/mplayer-pl/DOCS/pl$ kill -9 4335
kraken:~/mplayer/mplayer-pl/DOCS/pl$ groff: pre-grohtml: Killed
ps -l
F S   UID   PID  PPID  C PRI  NI ADDR SZ WCHAN  TTY          TIME CMD
0 S   500  4299  4297  0  74   0 -   693 wait4  pts/2    00:00:00 bash
0 R   500  4746  4299  0  78   0 -   751 -      pts/2    00:00:00 ps
Well, it looks like it got handled. I don't see anything wrong here.
Oh, yes. 'until the parent process dies'. Yes, that's correct. But if
you wait too often then it's loosing time on waiting for child
processes. And if you don't everything gets handled on exit. What's the
problem?
Torinthiel

-- 
 Waclaw "Torinthiel" Schiller       GG#: 542916, 3073512
   torinthiel(at)megapolis(dot)pl
   gpg: B06901F1 fpr: FAA3 559F CAE9 34DE CDC8  7346 2B6E 39F2 B069 01F1
 "No classmates may be used during this examination"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-cvslog/attachments/20040917/bf41203a/attachment.pgp>


More information about the MPlayer-cvslog mailing list