<html><head></head><body>This does not remove any class of bug. If there is a use-after-free, it still fails or hides the bug (depending if the use checks for NULL or not). If there is a double free race, it hides the bug in most cases making it very hard to reproduce, all the while not actually fixing it.<br><br><div class="gmail_quote">Le 19 février 2019 09:13:36 GMT+02:00, Steve Lhomme <robux4@ycbcr.xyz> a écrit :<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">On 19/02/2019 08:03, Jean-Baptiste Kempf wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"> Hello,<br><br> On Tue, 19 Feb 2019, at 08:01, Steve Lhomme wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ad7fa8; padding-left: 1ex;"><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #8ae234; padding-left: 1ex;">I really prefer having a crash (via assert/ASAN) when a client is<br></blockquote> misusing an API (calling Destroy with a freed pointer) instead of<br> ignoring it.<br><br> This is true when calling Destroy twice is a bug. It isn't with this<br></blockquote>Then assert() it.<br></blockquote><br>I'm not sure I'm following. Would you assert when calling <br>decoder_Destroy() with a NULL decoder (meaning it doesn't exist at all, <br>not even been through decoder_Init) ? Or in the solution I removed where <br>you'd call decoder_Destroy() with a holder than has been emptied, which <br>is not a bug at all.<br><br>Or you mean assert when decoder_Destroy() is passed an already freed <br>pointer ? In which case no assert will help detect a double free.<br><br>As a more general remark, I think it's odd that rather than removing a <br>class of bugs, we prefer to keep it and rely on tools to find them for <br>us, when they eventually occur.<br><br>><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"> This is not a libVLC API, where you need to deal with invalid input, and where assert is not enough.<br><br><br> -- <br> Jean-Baptiste Kempf -  President<br> +33 672 704 734<hr> vlc-devel mailing list<br> To unsubscribe or modify your subscription options:<br> <a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a><br></blockquote><hr>vlc-devel mailing list<br>To unsubscribe or modify your subscription options:<br><a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a></pre></blockquote></div><br>-- <br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.</body></html>