[MPlayer-dev-eng] [patch] cache2.c: when fork() fails, mplayer can kill every user process
Reimar.Doeffinger at gmx.de
Sat Jan 23 13:29:17 CET 2010
On Sat, Jan 23, 2010 at 12:53:32PM +0100, Reimar Döffinger wrote:
> On Sat, Jan 23, 2010 at 02:39:39PM +0300, Yuriy Kaminskiy wrote:
> > On 23.01.2010 14:19, Reimar Döffinger wrote:
> > > On Wed, Jan 20, 2010 at 03:43:49AM +0300, Yuriy Kaminskiy wrote:
> > >> On 19.01.2010 23:55, Reimar Döffinger wrote:
> > >> Anyway, your patch clearly did not fixed this bug.
> > > Sorry about that, I applied some mixture of different things.
> > > I you know of something that still doesn't work please report it.
> > Yep ;-) cache_uninit won't be called at all when cache_pid == 0
> > (stream.c:453:free_stream()). I've called cache_uninit directly from
> > stream_enable_cache failure path for a reason ;-) [well, maybe free_stream
> > should be fixed instead; but there were also another reason: don't leave
> > half-initialized and unusable stream->cache*, even temporarily].
> Oh, sorry, I forgot to mention that.
> I didn't think did it without a reason, but I wanted to
> a) check if the whole init/uninit could easily be organized to make more sens
> b) if fork failures are actually handled gracefully at all and if maybe even
> more memory is leaked.
Strangely I failed to observe a memleak in any case, I suspect valgrind does not
detect leaked shared memory...
Anyway, except for _beginthread failure not being detected, I hope now all cases
are handled properly.
More information about the MPlayer-dev-eng