[vlc-devel] [PATCH] Avoid deadlock on UDP stop

Romain Vimont rom at rom1v.com
Thu May 22 17:23:06 CEST 2014

Great, we advance!

Your concern is not anymore:
 - b_finishing duplicates b_eof;
 - setting b_eof in the block callback is sufficient.

Now, it is:
 - b_eof should not be set for UDP at all;
 - my patch abuses the EOF flag.

And I totally agree with that one.

By the way, if I may (even if it is irrelevant), I think my reasoning is
still valid, if you replace "EOF" by the definition I assigned to it,
that is "there is no way that a new block can be added to the fifo queue

But you're right, we should not set b_eof. And of course, this reasoning
does not prove that the patch fixes the root cause, but only that
setting b_eof when block_FifoGet() returns NULL was not a solution.

Le jeudi 22 mai 2014 à 18:27 +0800, Rémi Denis-Courmont a écrit :
> If net_Read() failed, then there should not even be no more calls to
> pf_block anyway. So either your alleged bug is non-existent or
> something is wrong *outside* the UDP access.

If pf_block is not supposed to be called after a net_Read() failure in
ThreadRead() (a fortiori after block_FifoWake()), then you're right, the
cause is that pf_block is called after…

Therefore, I acknowledge that my patch does not fix the root cause but
only a consequence: it prevents the deadlock even when pf_block is
called after (which should not happen in the first place).

And the root cause is probably the unsynchronized alive flags stuff…
which does not seem trivial to fix.


More information about the vlc-devel mailing list