[PATCH libX11 1/3] Make _XCloseLC thread safe.

walter harms wharms at bfs.de
Sun Sep 10 17:17:52 UTC 2017



Am 14.08.2017 19:27, schrieb Jacek Caban:
> Hi,
> 
> Sure, a simple test case is attached. It replicates what Wine does when
> initializing new threads (see [1] for Wine reports).
> 
> Thanks,
> Jacek
> 
> [1] https://bugs.winehq.org/show_bug.cgi?id=35041
> 

i was able to get a double free bug. Is that what is expected ?
(the bugreport shows several backtraces, i want to make sure).

re,
 wh

> 
> On 14.08.2017 15:43, walter harms wrote:
>> hi,
>> can you provide a simple program does needs the patch to work ?
>>
>> re,
>>  wh
>>
>> Am 10.08.2017 23:04, schrieb Jacek Caban:
>>> Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=55678
>>> Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=68538
>>> Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=69088
>>> Signed-off-by: Jacek Caban <jacek at codeweavers.com>
>>> ---
>>>  src/xlibi18n/lcWrap.c | 4 ++++
>>>  1 file changed, 4 insertions(+)
>>>
>>> diff --git a/src/xlibi18n/lcWrap.c b/src/xlibi18n/lcWrap.c
>>> index 38242608..43b4d622 100644
>>> --- a/src/xlibi18n/lcWrap.c
>>> +++ b/src/xlibi18n/lcWrap.c
>>> @@ -324,6 +324,8 @@ _XCloseLC(
>>>  {
>>>      XLCdList cur, *prev;
>>>  +    _XLockMutex(_Xi18n_lock);
>>> +
>>>      for (prev = &lcd_list; (cur = *prev); prev = &cur->next) {
>>>  	if (cur->lcd == lcd) {
>>>  	    if (--cur->ref_count < 1) {
>>> @@ -339,6 +341,8 @@ _XCloseLC(
>>>  	_XlcDeInitLoader();
>>>  	loader_list = NULL;
>>>      }
>>> +
>>> +    _XUnlockMutex(_Xi18n_lock);
>>>  }
>>>   /*
> 
> 


More information about the xorg-devel mailing list