http://bugs.winehq.org/show_bug.cgi?id=16725
Summary: Intermittent deadlock in GDI32 between freetype_cs and GDI_Level Product: Wine Version: 1.1.11 Platform: Other OS/Version: other Status: UNCONFIRMED Severity: enhancement Priority: P2 Component: gdi32 AssignedTo: wine-bugs@winehq.org ReportedBy: Paul.Hampson@Pobox.com
Running the Warhammer Online patch client (warpatcher.bin) I occasionally see a deadlock between freetype_cs and GDI_Level critical sections between two of the threads.
It appears that one thread is in WineEngGetCharWidth holding freetype_cs, and then calls GDI_AllocObject, descended from GetCharacterPlacementW called by Gecko.
The other thread is in FONT_SelectObject, and then calls WineEngCreateFontInstance, descended from a SelectObject call by libpatchui.dll from warpatcher.bin.
This code in FONT_SelectObject is marked FIXME so I guess this is known as a potential issue, but I can't see any bugs that specify this as a problem.
On the other hand, it looks to me like WineEngGetCharWidth should probably somehow have tried to lock the GDI_Level critical section before entering the freetype_cs critical section, if it is going to call things that might need to lock GDI_Level.
In this case, the program is trying to display a HTML-skinned interface of some kind. I'm not sure exactly what it's trying to do, but I can see how it'd have gecko and GDI running on the same thing.
Bug 16310 comment 9 suggests that it might be being caused by the same thing, but that's not confirmed there.