[vlc-devel] [PATCH 5/7] playlist: fix deadlock on destruction while preparser adds items to playlist
filip at atch.se
Wed Mar 22 18:56:30 CET 2017
On 2017-03-22 19:44, Rémi Denis-Courmont wrote:
> Le keskiviikkona 22. maaliskuuta 2017, 17.58.45 EET Filip Roséen a écrit :
> > As we can have incoming requests to the preparser while we are
> > destroying libvlc, we can end up in a deadlock while we are removing
> > all playlist_item_t from the playlist, while an item being preparsed
> > tries to add additional items to the list.
> > These changes fixes the issue by introducing a preparser-deactivation
> > function, that will make sure that we:
> > 1) clear out any pending preparsing requests
> > 2) cancel the current item preparsing (blocking)
> > 3) prevent further requests to the preparser
> I cannot tell, at this point, if this patch actually solves one instance of
> the deadlock that is triggered through the preparser. But it cannot solve the
> deadlock in general, for the simple reason that the deadlock is entirely
> between playlist, input item and the VLC events nonsens*ahem* framework.
This patch solves the issue where a playlist_item_t is used to add
items to the playlist, while the playlist is trying to release that
playlist_item_t (and since both locks the item, we end up in a
I think the preparser is the only remaining case where the lock
inversion described by #17652 can actually occur in practice, but I
might have to do some further investigations on the matter.
> Unless this solves any other problem, this only adds complexity. No thanks.
I am unable to reproduce any other situation with the current
codebase, but testcases are more than welcome!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the vlc-devel