[vlc-devel] [PATCH 17/16] chromecast: the lock mutex is used recursively

Rémi Denis-Courmont remi at remlab.net
Tue May 3 13:46:21 CEST 2016


Le 2016-04-28 16:41, Steve Lhomme a écrit :
> Linux requires vlc_mutex_init_recursive() or crashes
> ---
>  modules/stream_out/chromecast/chromecast_ctrl.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/modules/stream_out/chromecast/chromecast_ctrl.cpp
> b/modules/stream_out/chromecast/chromecast_ctrl.cpp
> index eb490dc..4f45577 100644
> --- a/modules/stream_out/chromecast/chromecast_ctrl.cpp
> +++ b/modules/stream_out/chromecast/chromecast_ctrl.cpp
> @@ -112,7 +112,7 @@ intf_sys_t::intf_sys_t(vlc_object_t * const
> p_this, int port, std::string device
>   , i_requestId(0)
>   , has_input(false)
>  {
> -    vlc_mutex_init(&lock);
> +    vlc_mutex_init_recursive(&lock);

Recursive mutex is bad design at best. But most often, it's lock 
inversion and/or use-after-free bugs in hiding.

>      vlc_cond_init(&loadCommandCond);
>
>      // Start the Chromecast event thread.

-- 
Rémi Denis-Courmont
http://www.remlab.net/


More information about the vlc-devel mailing list