Re: Deadlock in mplayerplug-in 3.50, when 2 embeds want to swap their "src" content.

Bill Lear <[email protected]> Wed, 28 May 2008 07:40:31 -0500
Newsgroups gmane.comp.mozilla.mplayerplug-in
Message-ID <[email protected]>
On Wednesday, May 28, 2008 at 08:44:51 (+0200) =?ISO-8859-2?Q?Zbigniew_Ho=B3dys?= writes:
>Hi Kevin!
>
>Thank you for your prompt help...
>but this time i've got another problem ;)
>
> > > I've got serious problem, when I am trying to change contents of 2 
>embeds
> > > by switching src or using Open(filename),SetFileName()) (in 
>parallel of 2
> > > different movies).
> > > In the attachments there is "test.html" which contain reproducable 
>code..
> > > (it doesn't include sample1.avi and sample2.avi, please apply your own
> > > sample movies, it doesn't matter)
> > > [...]
> > Fixed it in CVS... turns out this is a pretty old bug and nobody has
> > ever hit it. (I'm guessing it is at least 2-3 years old).
> > Just a flag was not being set properly.
>
>Yeap, it works...
>but my mplayer leaves [zombie] and i have no idea what to do.
>After half an hour Mozilla is crashing anyway (to much zombie... so 
>probably to much undetached processes. On my test, the switch time was 5 
>seconds)
>I don't know if it is Mplayer or Mplayerplug-in problem. ?
>
>Could you help me in this area? (I promise it is my last problem ;) )

I found the reaping of children in mplayerplugin to be broken.  The signal
handler that was disabled should not be turned back on, and instead, this
should be added to the code, for example, in mypopen():

    // Reap any unreaped children...
    int r = 0;
    while ((r = waitpid(-1, NULL, WNOHANG)) > 0) {
           ;
    }


Bill

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/