[PATCH] winex11.drv: Protect XOpenIM with a critical section.

Dmitry Timoshkov dmitry at baikal.ru
Wed Sep 11 10:32:26 CDT 2019


Bernhard Übelacker <bernhardu at mailbox.org> wrote:

> Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47366
> 
> I could reproduce for "Far Manager v2.0 build 1807 x86"
> that "double free or corruption (!prev)" bug.
> 
> After some debugging and additional logging I guess this is a race
> between two threads living in Far.exe.
> Both run through XOpenIM at the same time, the main process by calling
> ToUnicodeEx, the other thread by CreateWindowExW.
> Therefore sometimes freeing the same memory. Sometimes just freezing.
> 
> Because of this being timing related, I cannot say if this is really
> a regression.
> 
> A comment above open_xim reads:
> "Should always be called with the x11 lock held"
> Got this "x11 lock" removed in 2012?

There's no point in adding workarounds for X11 bugs:
https://bugs.winehq.org/show_bug.cgi?id=31882
https://bugs.winehq.org/show_bug.cgi?id=35041

It would be much better to fix X11 side instead.

-- 
Dmitry.



More information about the wine-devel mailing list