an app of mine, using two threads, dead locks as follows:
thread 1 0 0x40057b1b (RtlpWaitForCriticalSection+0x147(crit=0x40652d48, crit=0x40652d48) [critsection.c:185] in libntdll.so) (ebp=40a96a74) 1 0x40057bf6 (RtlEnterCriticalSection+0x3e(crit=0x40652d48) [critsection.c:241] in libntdll.so) (ebp=40a96a88) 2 0x400ca883 (_EnterSysLevel+0xf7(lock=0x40652d48) [syslevel.c:80] in libntdll.so) (ebp=40a96ab4) 3 0x40639a5f (GDI_AllocObject+0x2f(size=0x34, magic=0x4f4b, handle=0x40a96afc, handle=0x40a96afc) [gdiobj.c:427] in libgdi32.so) (ebp=40a96ad8) 4 0x4062c668 (CreateBitmap+0x78(width=0x20, height=0x20, planes=0x1, bpp=0x18, bits=0x4039fe1c) [bitmap.c:124] in libgdi32.so) (ebp=40a96b00) 5 0x40770f66 (GetIconInfo+0xca(hIcon=0x24e, iconinfo=0x40a96b50) [cursoricon.c:1816] in libuser32.so) (ebp=40a96b30) 6 0x40805a4a (set_icon_hints+0xe6(display=0x8082898, wndPtr=0x4037fe00, hints=0x8083da0, display=0x8082898, win=0x4037fe00, display=0x8082898, win=0x4037fe00) [window.c:263] in libx11drv.so) (ebp=40a96b8c) 7 0x40805ccb (set_wm_hints+0xf3(display=0x8082898, win=0x4037fe00) [window.c:370] in libx11drv.so) (ebp=40a96bbc) 8 0x4080691e (create_whole_window+0x1aa(display=0x8082898, win=0x4037fe00, win=0x4037fe00) [window.c:699] in libx11drv.so) (ebp=40a96c50) 9 0x40806ead (X11DRV_CreateWindow+0xb5(hwnd=0x4ac, cs=0x40a96e2c, unicode=0x0) [window.c:856] in libx11drv.so) (ebp=40a96c90) 10 0x40797831 (WIN_CreateWindowEx+0x6c9(cs=0x40a96e2c, classAtom=0xc014, type=0x2) [win.c:865] in libuser32.so) (ebp=40a96d08) 11 0x40797cca (CreateWindowExA+0x15a(exStyle=0x0, className=0x404c86ce, windowName=0x4049ef3c, style=0xcf0000, x=0x366, y=0x14, width=0x19a, height=0x16f, parent=0x0, menu=0x0, instance=0x4049d000, data=0x0) [win.c:1030] in libuser32.so) (ebp=40a96e5c) 12 0x4049be85 (SInitInstance+0x169(hInstance=0x4049d000, nCmdShow=0x1) [sinit.c:247] in a.so) (ebp=40a96ecc) 13 0x4049911b (ServerThread+0x4b(p=0x405e6e14) [a.c:19] in a.so) (ebp=40a96f1c) 14 0x400cb1ac (THREAD_Start+0x98 [thread.c:273] in libntdll.so) (ebp=40a96f38) 15 0x400ca44e (SYSDEPS_StartThread+0x36(teb=0x40aa7000) [sysdeps.c:73] in libntdll.so) (ebp=40a96ff4) 16 0x4030531a (NTDLL.DLL.memcpy+0x494aa in libc.so.6) (ebp=00000000)
thread 2 0 0x40057b1b (RtlpWaitForCriticalSection+0x147(crit=0x40841d10, crit=0x40841d10) [critsection.c:185] in libntdll.so) (ebp=405e6ac0) 1 0x40057bf6 (RtlEnterCriticalSection+0x3e(crit=0x40841d10) [critsection.c:241] in libntdll.so) (ebp=405e6ad4) 2 0x4080b668 (lock_tsx11+0x1c [x11drv_main.c:109] in libx11drv.so) (ebp=405e6ae4) 3 0x4080f595 (X11DRV_StretchBlt+0x39(dcDst=0x4039f710, xDst=0x0, yDst=0x0, widthDst=0xa0, heightDst=0x80, dcSrc=0x4039f4e8, xSrc=0x0, ySrc=0x0, widthSrc=0x190, heightSrc=0x140, rop=0xcc0020) [bitblt.c:1555] in libx11drv.so) (ebp=405e6b10) 4 0x4061bbf2 (StretchBlt+0x102(hdcDst=0xf4, xDst=0x0, yDst=0x0, widthDst=0xa0, heightDst=0x80, hdcSrc=0xf0, xSrc=0x0, ySrc=0x0, widthSrc=0x190, heightSrc=0x140, rop=0xcc0020) [bitblt.c:120] in libgdi32.so) (ebp=405e6b54) 5 0x40499b84 (CInitializeCoolBitmaps+0x36c [cinit.c:229] in a.so) (ebp=405e6bd4) 6 0x4049a265 (CMainWndProc+0x205(hWnd=0x13c, msg=0x590, wParam=0x0, lParam=0x0) [client.c:131] in a.so) (ebp=405e6d24) 7 0x4079e197 (WINPROC_wrapper+0x17 in libuser32.so) (ebp=405e6d48) 8 0x4079e216 (WINPROC_CallWndProc+0x76(proc=0x4049a060, hwnd=0x13c, msg=0x590, wParam=0x0, lParam=0x0) [winproc.c:171] in libuser32.so) (ebp=405e6d74) 9 0x407a3da8 (CallWindowProcA+0x88(func=0x4096054c, hwnd=0x13c, msg=0x590, wParam=0x0, lParam=0x0) [winproc.c:2589] in libuser32.so) (ebp=405e6d9c) 10 0x40785fcc (DispatchMessageA+0xd8(msg=0x405e6e24) [message.c:2359] in libuser32.so) (ebp=405e6de0) 11 0x404991ff (WinMain+0x9b(hInstance=0x4049d000, hPrevInstance=0x0, lpCmdLine=0x40360747, nCmdShow=0x1) [a.c:78] in a.so) (ebp=405e6e40) 12 0x4049e082 (__wine_exe_main+0x82 [a.spec.c:5838] in <Debugged process>) (ebp=405e6ecc) 13 0x400c6d52 (start_process+0x1a6 [process.c:391] in libntdll.so) (ebp=405e6f30) 14 0x400ca559 (SYSDEPS_DoCallOnStack+0x25(func=0x400c6bac, arg=0x0) [sysdeps.c:173] in libntdll.so) (ebp=405e6ff0) 15 0x400ca603 (SYSDEPS_CallOnStack+0x2f in libntdll.so) (ebp=bffff660) 16 0x400ca6ad (SYSDEPS_SwitchToThreadStack+0x95(func=0x400c6bac) [sysdeps.c:236] in libntdll.so) (ebp=bffff69c) 17 0x400c70de (PROCESS_InitWine+0x1ce(argc=0x1, argv=0xbffff734, win16_exe_name=0x804c620, win16_exe_file=0x804c724) [process.c:519] in libntdll.so) (ebp=bffff6b4) 18 0x0804b1ee (Letext [main.c] in wine) (ebp=bffff6cc) 19 0x4027bcbe (NTDLL.DLL.sqrt+0x3262e in libc.so.6) (ebp=bffff708) 20 0x08049021 (_start+0x21 in wine) (ebp=00000000)
it (simply) deadlocks because the new window management code (written by Alexandre), (rev 1.5 of dlls/x11drv/window.c, change log entry Create an X window for every window, including children. Fixed non-client rectangle calculations in managed mode. Added support for icon window in managed mode. ) does call GDI functions (here GetIconInfo) while the x11drv critical section is held, which shouldn't be the case
let's assume fixing it is now on Alexandre's TODO list ;-)
A+