[vlc-devel] [PATCH] chromecast: Work around protobuf library unload bug

Rémi Denis-Courmont remi at remlab.net
Fri Sep 8 17:52:58 CEST 2017


Le perjantaina 8. syyskuuta 2017, 17.33.38 EEST Hugo Beauzée-Luyssen a écrit :
> fix #18329
> ---
>  modules/stream_out/chromecast/cast.cpp | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/modules/stream_out/chromecast/cast.cpp
> b/modules/stream_out/chromecast/cast.cpp index b4b1fd9a84..e6784c1588
> 100644
> --- a/modules/stream_out/chromecast/cast.cpp
> +++ b/modules/stream_out/chromecast/cast.cpp
> @@ -132,6 +132,9 @@ vlc_module_begin ()
>      add_string(SOUT_CFG_PREFIX "mux", DEFAULT_MUXER, MUX_TEXT,
> MUX_LONGTEXT, false) add_string(SOUT_CFG_PREFIX "mime", "video/x-matroska",
> MIME_TEXT, MIME_LONGTEXT, false)
> 
> +    // libprotobuf cannot be unloaded multiple time by the same program.

AFAIK, the problem is not libprotobuf being unloaded. The problem is 
Chromecast being unloaded while it is still registered to libprotobuf.

The better solution is of course to not depend on this shitty library, or to 
fix its broken-by-design registration/unregistration. But short of that, the 
only way to fix this is to link statically and add any likely necessary static 
locking.

> +    cannot_unload_broken_library()

This ensures that the Chromecast protocol is not unloaded, but it won´t 
protect it from being "cleaned up" by Mir, still leading to UB. (And it 
probably does not solve reentrancy problem either.) So I strongly suspect that 
this merely moves the problem.

> +
>  vlc_module_end ()

-- 
雷米‧德尼-库尔蒙
https://www.remlab.net/



More information about the vlc-devel mailing list