<html><head></head><body>Some people also refuse to support building with the Java compiler. VLC is a C/C++11 copyleft project. You can't build it with a C89, or Microsoft C dialect, or Java compiler, and you can't redistribute it if you have proprietary non-OS dependencies.<br><br>I don't know who some people are, but I am not aware of anybody preventing build with another C11/C++11 toolchain than GCC or Clang.<br><br><div class="gmail_quote">Le 21 février 2019 13:55:48 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 21/02/2019 12:49, 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;"> So... You say that your debugging environment sucks.<br><br> That is an argument for you to fix your debugging environment, or use <br> another environment.<br></blockquote><br>No because some people are refusing to support building with MSVC. <br>Things will hopefully change when we can generate usable PDB files with <br>CLang.<br><br>In the mean time I am forced to use gcc and gdb.<br><br>><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;">That is not an argument for adding printf debugging to one specific <br>assertion out of many, which does not solve your problem.<br></blockquote><br>Are you saying this patch doesn't help debug leaks ?<br><br>><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"> Le 21 février 2019 13:32:04 GMT+02:00, Steve Lhomme <robux4@ycbcr.xyz> <br> a écrit :<br><br> On 21/02/2019 11:58, Rémi Denis-Courmont wrote:<br><br> It's making a special snow flake of that one specific<br> assertion. If you want to develop tooling for dumping the<br> object tree, you're much better off scripting your favorite<br> debugger than cluttering one specific VLC assertion. <br><br><br> I don't think that's possible in QtCreator (and that's not my favorite<br> debugger by far), while writing a few lines of code in C is very easy.<br><br> On Windows gdb doesn't break on asserts. It could be enabled to do it,<br> but then everytime I'd run VLC under gdb it breaks 20 times in weird Qt<br> places. So I always end up disabling it. So when a leak occurs (or any<br> assert for that matter) I have to go through this and pray I'll have the<br> leak/assert again.<br><br> Le 21 février 2019 12:44:44 GMT+02:00, Steve Lhomme<br> <robux4@ycbcr.xyz> a écrit : On 21/02/2019 11:37, Rémi<br> Denis-Courmont wrote: Hi, My GDB skills are bad so I just<br> walked the objects tree by printing memory content on the<br> abort. It would be much easier with VLC-specific GDB macros,<br> but the point is that you can debug that assertion just as<br> any. It also works after the fact for pseudorandom failures,<br> if you enable core dumps. Much better than this patch since<br> you have access to all memory, not just the objects tree.<br> Adding special snow flake debug code for assertion is a bad<br> idea that sets a very bad precedent - as opposed to improving<br> integration with proper debugging tools. What's snow flake<br> about adding debug tooling ? Le 21 février 2019 12:26:47<br> GMT+02:00, Thomas Guillem <thomas@gllm.fr> a écrit : On Thu,<br> Feb 21, 2019, at 11:18, Rémi Denis-Courmont wrote: Hi, Well I<br> did debug that assertion failure using (ASan +) gdb just fine<br> last time. The code has not changed. So this kludge is<br> definitely not necessary for its alleged purpose. Even if it<br> works with gdb (please tell us how), evelopers don't always<br> run VLC with gdb. This cause an issue if the leak is not<br> reproducible... Not only that but stderr is not universally<br> the output for debug nor is it universally where assertion<br> failures are dumped to, So if there is no stderr, you don't<br> see the error. I don't see the problem at all. so this patch<br> does not even work properly Works on Windows, Android, Linux,<br> macOS when VLC is run via command line. This is the case for<br> most developers usecase. And in most cases you can see the<br> leak by stopping all inputs and dumping the objects tree<br> before quitting, anyway. What about leaks not related to<br> playback ? Interface, service discovery, playlist that are<br> only cleaned when vlc is closed. Le 21 février 2019 11:24:57<br> GMT+02:00, Thomas Guillem <thomas@gllm.fr> a écrit : Comment:<br> A lot of developers asked me to propose this patch again. It<br> was previously refused because developers could use proper<br> debugging tools. I disagree with that assumption. Even with<br> Asan, when the leak assert fail, it will abort() without<br> prompting any leaks, so you'll have to edit libvlc.c to remove<br> this assert. If your leak was not reproducible, you'll lose a<br> precious information. And good luck finding the leak with GDB,<br> you really need to know the internal of vlc_object_t to<br> iterate through the different list to get the culprit. Commit<br> log: In case of a vlc_object_t leak, and if asserts are<br> enabled, the error output will be like the following (when<br> leaking intentionally decoder_t objects): === vlc_object LEAKS<br> detected === \ playlist | \ input | | \ decoder avcodec | | |<br> decoder faad | | | decoder stl<hr> src/libvlc.c | 30 ++++++++++++++++++++++++++++++ 1 file<br> changed, 30 insertions(+) diff --git a/src/libvlc.c<br> b/src/libvlc.c index 8e8d2ca8b2..d9ff96de84 100644 ---<br> a/src/libvlc.c +++ b/src/libvlc.c @@ -436,6 +436,24 @@ void<br> libvlc_InternalCleanup( libvlc_int_t *p_libvlc ) #endif }<br> +#ifndef NDEBUG +static void<br> DumpObjectLeaks(vlc_object_internals_t *priv, unsigned level)<br> +{ + bool first = true; + vlc_list_foreach(priv,<br> &priv->children, siblings) + { + vlc_object_t *obj =<br> vlc_externals(priv); + for (unsigned i = 0; i < level; i++) +<br> fprintf(stderr, " %s ", first && i == level -1 ? "\\" : "|");<br> + char *name = vlc_object_get_name(obj); + fprintf(stderr, "%s<br> %s\n", vlc_object_typename(obj), name ? name : ""); +<br> free(name); + DumpObjectLeaks(priv, level + 1); + first =<br> false; + } +} +#endif + /** * Destroy everything. * This<br> function requests the running threads to finish, waits for<br> their @@ -449,6 +467,18 @@ void libvlc_InternalDestroy(<br> libvlc_int_t *p_libvlc ) vlc_ExitDestroy( &priv->exit );<br> +#ifndef NDEBUG + { + vlc_object_internals_t *internal =<br> vlc_internals(p_libvlc); + if (atomic_load(&internal->refs) !=<br> 1) + { + vlc_mutex_lock(&internal->tree_lock); +<br> fprintf(stderr, "=== vlc_object LEAKS detected ===\n"); +<br> DumpObjectLeaks(internal, 1); +<br> vlc_mutex_unlock(&internal->tree_lock); + } + } +#endif<br> assert( atomic_load(&(vlc_internals(p_libvlc)->refs)) == 1 );<br> vlc_object_release( p_libvlc ); } -- Envoyé de mon appareil<br> Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.<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> -- Envoyé de<br> mon appareil Android avec Courriel K-9 Mail. Veuillez excuser<br> ma brièveté.<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 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> -- Envoyé de<br> mon appareil Android avec Courriel K-9 Mail. Veuillez excuser<br> ma brièveté.<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>