[vlc-devel] [PATCH] video_output: explicit vlc_testcancel

Quentin Chateau quentin.chateau at deepskycorp.com
Thu Feb 27 11:00:03 CET 2020


Ok, good news, I'm back on the faulty machine and after a complete 
cleanup and recompilation it seems like the bug was related to a dirty 
build system. My bad...

At least Rémi fixed another bug thanks to this ...

On 26/02/2020 23:59, Quentin Chateau wrote:
>
> Le mer. 26 févr. 2020 à 20:47, Rémi Denis-Courmont <remi at remlab.net 
> <mailto:remi at remlab.net>> a écrit :
>
>     Le keskiviikkona 26. helmikuuta 2020, 16.34.09 EET Quentin Chateau
>     a écrit :
>     > Thanks for the hindsight, I dug further:
>     >
>     > vlc_cond_timedwait is called, and so is pthread_cond_timedwait. The
>     > issue happens when the deadline parameter is in the past: when this
>     > happens, pthread_cond_timedwait does not act as a cancellation point
>     > anymore...
>
>     pthread_cond_timedwait() and pthread_cond_wait() are *always*
>     cancellation
>     points. The deadline does not matter.
>
>
> That's what I though as well. Though it seemed that it did not act as 
> a cancellation point. I am not able to reproduce on a different 
> machine right now. I'll have to double check tomorrow on the machine 
> that I had the bug on.
>
>
>     vlc_cond_timedwait() and vlc_cond_wait() are likewise supposed to
>     always be
>     cancellation points. By my count, there are 21 outstanding
>     vlc_cancel() call
>     sites still depending on that behaviour.
>
>     Right now, there is a bug for which I just sent a patch
>
>
>     > In my case deadline happens to be in the past because
>     > ThreadDisplayPicture keeps failing (due to one of my video filters
>     > failing on the last frame)
>     >
>     > I could not find this behavior in the pthread documentation, but it
>     > seems to be the case anyway. Do you think that we need to:
>     >
>     >  1. Fix vlc_cond_timedwait so it will check for cancellation if the
>     >     deadline is in the past
>
>     I don't think that that's a feasible option.
>
>     For a start, I couldn't find that bug in those circumstances. I
>     did find a bug
>     with the same symptions in different circumstances though, see patch.
>
>     And then, even if the bug were there where I could not see it,
>     there are no
>     ways to determine that the deadline is in the past, as that changes
>     asynchronously.
>
>     >  2. Acknowledge the fact that vlc_cond_timedwait is not always a
>     >     cancellation point and fix the issue higher in the stack,
>     either in
>     >     vout_control_Pop, or similarly to the patch I sent, directly
>     in Thread
>
>     You can't do that either, or at least not yet. Not when we still
>     have 21 or so
>     code paths depending on it.
>
>     -- 
>     Rémi Denis-Courmont
>     http://www.remlab.net/
>
>
>
>     _______________________________________________
>     vlc-devel mailing list
>     To unsubscribe or modify your subscription options:
>     https://mailman.videolan.org/listinfo/vlc-devel
>
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20200227/8e434430/attachment.html>


More information about the vlc-devel mailing list