<html><head></head><body>You are doing the exact same mistake as Jean-Paul Saman when he sprinkled defensive programming over the code base: incorrectly assuming that VLC is single-threaded.<br><br><div class="gmail_quote">Le 19 février 2019 10:44:38 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">There cannot be any double-free occurring in my implementation. That's <br>the class of bugs it removes.<br><br>It will of course not solve use after free issues. And I don't see how <br>it makes it easier/harder to track such issues.<br><br>On 19/02/2019 09:02, Rémi Denis-Courmont wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"> This does not remove any class of bug. If there is a use-after-free, <br> it still fails or hides the bug (depending if the use checks for NULL <br> or not). If there is a double free race, it hides the bug in most <br> cases making it very hard to reproduce, all the while not actually <br> fixing it.<br><br> Le 19 février 2019 09:13:36 GMT+02:00, Steve Lhomme <robux4@ycbcr.xyz> <br> a écrit :<br><br> On 19/02/2019 08:03, Jean-Baptiste Kempf wrote:<br><br> Hello, On Tue, 19 Feb 2019, at 08:01, Steve Lhomme wrote:<br><br> I really prefer having a crash (via assert/ASAN) when<br> a client is <br><br> misusing an API (calling Destroy with a freed pointer)<br> instead of ignoring it. This is true when calling Destroy<br> twice is a bug. It isn't with this <br><br> Then assert() it. <br><br><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> This is not a libVLC API, where you need to deal with invalid<br> input, and where assert is not enough. -- Jean-Baptiste Kempf<br> - President +33 672 704 734<hr> vlc-devel mailing list To unsubscribe or modify your<br> subscription options:<br> <a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a> <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><br><br> -- <br> Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez <br> excuser ma brièveté.<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>