[vlc-devel] [PATCH 1/2] lua: Fix deadlock when deactivating extension due to timeout.

Hugo Beauzée-Luyssen hugo at beauzee.fr
Mon Mar 27 18:36:12 CEST 2017


On Mon, Mar 27, 2017, at 06:23 PM, Rémi Denis-Courmont wrote:
> Le maanantaina 27. maaliskuuta 2017, 17.03.33 EEST Hugo Beauzée-Luyssen a 
> écrit :
> > lua_ExecuteFunctionVa is not meant to be called with the command_lock
> > held.
> > This partially reverts 7a94f2e6b22bad255ddcca6e095ed33bc4803e45
> > Fix #17565
> > ---
> >  modules/lua/extension.c        | 6 +++---
> >  modules/lua/extension_thread.c | 4 +++-
> >  2 files changed, 6 insertions(+), 4 deletions(-)
> > 
> > diff --git a/modules/lua/extension.c b/modules/lua/extension.c
> > index 92c2eb7fa7..32009cc0ba 100644
> > --- a/modules/lua/extension.c
> > +++ b/modules/lua/extension.c
> > @@ -1223,8 +1223,8 @@ static void WatchTimerCallback( void *data )
> >                  vlc_dialog_release( p_mgr, p_ext->p_sys->p_progress_id );
> >                  p_ext->p_sys->p_progress_id = NULL;
> >              }
> > -            KillExtension( p_mgr, p_ext );
> >              vlc_mutex_unlock( &p_ext->p_sys->command_lock );
> > +            KillExtension( p_mgr, p_ext );
> 
> lua_ExtensionDeactivate() can not to be called without the lock, AFAICT.
> And 
> KillExtension() calls it.
> 

Calling lua_ExtensionDeactivate with the command lock held *will*
deadlock. I can agree that fiddling with the lua_State without any kind
of lock held seems dangerous, but that seems to be a different problem.

Regards,

-- 
  Hugo Beauzée-Luyssen
  hugo at beauzee.fr


More information about the vlc-devel mailing list