[vlc-devel] Re: vlc: svn commit r19276 (jpsaman)

Clément Stenac zorglub at diwi.org
Sat Mar 10 22:44:49 CET 2007


> Not checking the return of p_current results in a Segmentation fault 
> because the code is then accessing an invalid pointer. What would be the 
> right solution here then according to you? Using assert(p_current)?
> 
> I disagree with always crashing, especially in releases because it would 
> give VLC a bad name as being terribly unstable. Asserts are useful in 
> testing only.
> 
I don't think there is any single good solution, anyways, unfortunately.

The fact is that this kind of bugs, that would lead this kind of asserts 
to break, must be caught during testing anyway.

Even if we put if (!p_current) return; to avoid segmentation faults, if 
that table gets corrupted by programming errors, strange things will 
happen anyway.

That's the thing if someone does something nasty. To catch this, assert 
is the best solution. The other case is malloc() failure. There are 
unfortunately many places in the code where we don't check for malloc 
failure. I personally think we should not try very hard to make vlc 
resilient to that kind of errors, but we should make it error out 
cleanly (kind of "out of ram, can't continue" dialog) rather than just 
segfaulting.

Zorglub

-- 
This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html



More information about the vlc-devel mailing list