[vlc-devel] [RFC] Deadlock situation in input.c in create( ... ), with playlist

Andre Weber WeberAndre at gmx.de
Sat Mar 15 23:32:12 CET 2008


Hello,

we have a deadlock situation in the function

input.c - in the method

   static input_thread_t *Create( vlc_object_t *p_parent, input_item_t *p_item,
                                   const char *psz_header, vlc_bool_t b_quick, sout_instance_t *p_sout )

the deadlock occurs durring the /* Parse input options */ code, for normal files it couldn't happen
but if you try to open a avi with subtitles, or open the Direct Show streaming on windows f.e.
(just checking the subtitles options without haveing them is sufficent to get the deadlock)

and you have the "security policy" set to "ask" - we are stuck in this code block:

    /* Parse input options */
    vlc_mutex_lock( &p_item->lock );
    for( i = 0; i < p_item->i_options; i++ )
        var_OptionParse( VLC_OBJECT(p_input), p_item->ppsz_options[i] );
    vlc_mutex_unlock( &p_item->lock );

because var_OptionParse( ... ) calls the function intf_UserYesNo( ... ) this function tries to show a dialog
the event to do this is passed through the thread loop of the playlist thread.c function RunControlThread( ... )
but at this time - the thread is still in the function playlist_MainLoop( .. )  and is waiting for the completion
of the method playlist_PlayItem( ... )  --> and this functions waits for the return of var_OptionParse( ... )
and so long this is running the thread loop couldn't process the call to intf_InteractionManage( ... )

We (Atmo & Ivoire) tried to move the var_OptionParse( ... ) into the input thread - from the logic
that shouldn't make any difference - but this also didn't work - because inside the thread we failed
on the locked playlist mutex inside the function  interaction.c : InteractionGet( ... ) ... that was the
point where I gave up ... without any idea - which wouldn't be a hack or kludge.
(I tried to unlock the playlist durring thread creation but that didn't helped ...)


Any ideas are welcome? funman whats about you?


with best regards

André Weber

--
atmo




More information about the vlc-devel mailing list