[vlc-devel] [PATCH 2/2] win32: fix use-after-free at thread end

Steve Lhomme robux4 at ycbcr.xyz
Tue Sep 8 08:05:30 CEST 2020


On 2020-09-07 16:55, Rémi Denis-Courmont wrote:
> 	Hi,
> 
> Le maanantaina 7. syyskuuta 2020, 12.54.49 EEST Steve Lhomme a écrit :
>>> Thanks for the review. I don't think the potential bug applies to
>>> plugins: Plugin module instances must already join their threads before
>>> they are destroyed. This should ensure that the thread code is already
>>> back from plugin code to LibVLC's vlc_entry(). So it is safe to unload
>>> plugins already now. If not, then I'd say that's a separate bug that
>>> I'll look at separately.
>>>
>>> I have however noticed that this patch is wrong because it mismatches
>>> _beginthreadex() with ExitThread().
>>>
>>> We have two alternatives, I think:
>>> 1) Switch to CreateThread() like you already did on Windows Store.
>>
>> The documentation for CreateThread says otherwise:
> (...)
> 
> I know what it says. We have already quoted that paragraph previously, and the
> TC already *voted* that calling LibVLC C code from a thread *not* created by
> _beginthreadex() was safe and supported.

How am I supposed to know that ?

> If you have material evidence that this decision was ill-informed, you are
> most welcome to solicit a revision However in the mean time, this is not an
> admissible argument.

How can I know what argument I can make or not if there's no way to know 
the list of admissible argument or not ?



More information about the vlc-devel mailing list