[vlc-devel] [VLC] #2366: realloc is generally used incorrectly

Rémi Denis-Courmont remi at remlab.net
Mon May 25 17:31:09 CEST 2009


Le lundi 25 mai 2009 15:00:47 jpd at m2x.nl, vous avez écrit :
> On Mon, May 25, 2009 at 12:24:05PM +0200, R??mi Denis-Courmont wrote:
> > Better _not_ look at it than put some partial obfuscating fixes like
> > the other Jean-Paul just did, IMHO.
>
> Sometimes it really is better not to crash.

Oh yeah...

Guess what? JPS just introduced systematic crasher bugs while claiming to fix 
realloc() use (according to folks on IRC).

> > In any case, even if the ~300 buggy of the ~400 realloc() sites in
> > the tree were fixed, we would still have OOM problems. And even if
> > OOM problems were all fixed, VLC would still crash the browsers about
> > just as often. Besides, there are underlying libraries that are not
> > OOM-safe (e.g. Qt4, though not needed by the browser, but there has to
> > be other ones).
>
> I disagree with the assessment and even then it isn't a reason to
> actively oppose all attempts to improve the code on principle.

*Improve*. I warned yesterday on Trac that fixing realloc() sites had to be 
done CAREFULLY so that 1/ the bugs are actually fixed, 2/ no new bugs are 
introduced, 3/ places that use realloc() properly already are not mistakenly 
broken.

Guess what? JPS did the exact opposite today. He broke some realloc() calls 
that were checking for errors properly, introduced new crasher bugs, and 
turned clean NULL-dereferences into silent memory leaks.

If you call that "improve the code", then I'm afraid we have very much 
incompatible standards.

> > Realistically, the only pragmatic way to not crash the browser is to
> > run the VLC plugin in a separate process.
>
> Realistically, the mozilla guys do have some importance (but as they
> themselves noticed, it cuts both ways), even if one doesn't like the way
> they do throw their weight around, so some appeasing isn't a bad thing.

Do you think they will be happy when we have "fixed" all the realloc() sites 
and they realize that VLC still crashes just as often (or even more often 
actually)? I think they will be even more pissed off with us (you know, kind 
of like me with your employer)... and our code quality will be yet worse.

> I think j-b is doing a reasonable job of negotiating with them but he
> has to have something to work with, so leaving him no cards to play just
> doesn't do.

And I think JPS does an unreasonable job, and leaving him his trunp card to 
play will just make the situation ultimately worse.

-- 
Rémi Denis-Courmont
http://www.remlab.net/




More information about the vlc-devel mailing list