http://bugs.winehq.org/show_bug.cgi?id=27282
Summary: wine cannot execute TDRABCSetup.exe Product: Wine Version: 1.3.20 Platform: x86 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown AssignedTo: wine-bugs@winehq.org ReportedBy: fracting@gmail.com
1. Download the installer $ wget http://www.95599.cn/update/down/TDRABCSetup.exe
2. start with wine: $ wine TDRABCSetup.exe
there is no any output, also no any window display.
Typing Ctrl+C can not stop the program, the output is like below:
^Cfixme:console:CONSOLE_DefaultHandler Terminating process 8 on event 0 err:ntdll:RtlpWaitForCriticalSection section 0x338198 "?" wait timed out in thread 0020, blocked by 0009, retrying (60 sec)
Only wineserver -k can stop the program.
http://bugs.winehq.org/show_bug.cgi?id=27282
fracting fracting@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download URL| |http://www.95599.cn/update/ | |down/TDRABCSetup.exe
http://bugs.winehq.org/show_bug.cgi?id=27282
--- Comment #1 from fracting fracting@gmail.com 2011-09-26 04:33:49 CDT --- Created attachment 36569 --> http://bugs.winehq.org/attachment.cgi?id=36569 Log: winedbg backtrace all
Still in wine1.3.28
Adding winedbg backtrace all log.
http://bugs.winehq.org/show_bug.cgi?id=27282
fracting fracting@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|wine cannot execute |TDRABCSetup.exe hang on |TDRABCSetup.exe |start up
--- Comment #2 from fracting fracting@gmail.com 2011-09-26 04:34:38 CDT --- Update summary
http://bugs.winehq.org/show_bug.cgi?id=27282
--- Comment #3 from fracting fracting@gmail.com 2012-01-14 04:15:58 CST --- Created attachment 38347 --> http://bugs.winehq.org/attachment.cgi?id=38347 Log: +relay trace, TDRABCSetup of abchina bank hang on start up
http://bugs.winehq.org/show_bug.cgi?id=27282
--- Comment #4 from fracting fracting@gmail.com 2012-01-14 04:17:19 CST --- Still in wine-1.3.36-223-gc7cc9a1
http://bugs.winehq.org/show_bug.cgi?id=27282
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW CC| |focht@gmx.net Component|-unknown |user32 Summary|TDRABCSetup.exe hang on |TDRABCSetup.exe hang on |start up |start up (GetWindowText | |uses SendMessage to query | |for process' local window | |title text, leading to | |potential deadlock) Ever Confirmed|0 |1
--- Comment #5 from Anastasius Focht focht@gmx.net 2012-01-14 05:03:58 CST --- Hello,
confirming.
It seems the installer looks for specific processes using window title match.
A second worker thread is spawned that calls FindWindow() and while the main thread waits for the worker to finish (without pumping messages).
Although the installer doesn't explicitly create a window up to this point, a hidden window has already been created as part of OLE init.
Wine's current FindWindow -> window list -> GetWindowText() logic uses SendMessage() if the window is created in same process. This deadlocks here because the main thread is blocked, not pumping messages.
Relevant part of trace log:
--- snip --- 0024:Starting process L"Z:\home\focht\Downloads\TDRABCSetup.exe" (entryproc=0x403542) 0024:Call comctl32.InitCommonControls() ret=00403567 0024:Ret comctl32.InitCommonControls() retval=68754b05 ret=00403567 0024:Call KERNEL32.SetErrorMode(00008001) ret=00403572 0024:Ret KERNEL32.SetErrorMode() retval=00000000 ret=00403572 0024:Call ole32.OleInitialize(00000000) ret=00403579 ... 0024:Call user32.CreateWindowExW(00000000,7062df00 L"OleMainThreadWndClass 0x######## ",00000000,00000000,00000000,00000000,00000000,00000000,fffffffd,00000000,70540000,00000000) ret=7055e6f6 ... 0024:Ret user32.CreateWindowExW() retval=00060052 ret=7055e6f6 ... 0024:Call KERNEL32.LoadLibraryExW(0040e0b0 L"C:\users\focht\Temp\nsm3ed0.tmp\Plugin_ABC.dll",00000000,00000008) ret=0040218b ... 0024:Ret KERNEL32.LoadLibraryExW() retval=00370000 ret=0040218b ... 0024:CALL Plugin_ABC.CloseGarbageWindows(00000000,00002004,00471000,0040a0a0,0040a000) ret=004021d8 ... 0024:Call KERNEL32.CreateThread(00000000,00000000,00372160,00000000,00000000,00000000) ret=00372222 0024:Ret KERNEL32.CreateThread() retval=00000044 ret=00372222 0024:Call KERNEL32.WaitForSingleObject(00000044,ffffffff) ret=0037222b ... 0025:Starting thread proc 0x372160 (arg=(nil)) 0025:Call KERNEL32.GetSystemDefaultLangID() ret=00372167 0025:Ret KERNEL32.GetSystemDefaultLangID() retval=00000409 ret=00372167 0025:Call user32.FindWindowW(00000000,00376438 L"Internet Banking of Agricultural Bank of China") ret=003721ae
<deadlock here> --- snip ---
Nice how they call their own stuff "garbage windows" ;-)
Debugger, creation of hidden window:
--- snip --- Wine-dbg>bt Backtrace: =>0 0x682755cf WIN_CreateWindowEx+0x719(cs=0x33f98c, className="OleMainThreadWndClass 0x######## ", module=0x68850000, unicode=0x1) [/home/focht/projects/wine/wine-git/include/winbase.h:2540] in user32 (0x0033f974) 1 0x68276413 CreateWindowExW+0x7d(exStyle=0, className="OleMainThreadWndClass 0x######## ", windowName=0x0(nil), style=0, x=0, y=0, width=0, height=0, parent=0xfffffffd, menu=(nil), instance=0x68850000, data=0x0(nil)) [/home/focht/projects/wine/wine-git/dlls/user32/win.c:1583] in user32 (0x0033f9c4) 2 0x688696f6 apartment_createwindowifneeded+0x9c(apt=0x12a750) [/home/focht/projects/wine/wine-git/dlls/ole32/compobj.c:1195] in ole32 (0x0033fa34) 3 0x68867760 apartment_get_or_create+0xff(model=0x2) [/home/focht/projects/wine/wine-git/dlls/ole32/compobj.c:391] in ole32 (0x0033fa84) 4 0x68869ea8 CoInitializeEx+0x19d(lpReserved=0x0(nil), dwCoInit=0x2) [/home/focht/projects/wine/wine-git/dlls/ole32/compobj.c:1443] in ole32 (0x0033faf4) 5 0x68894fdc OleInitialize+0x76(reserved=0x0(nil)) [/home/focht/projects/wine/wine-git/dlls/ole32/ole2.c:185] in ole32 (0x0033fb54) Wine-dbg>info locals 0x682755cf WIN_CreateWindowEx+0x719: (0033f974) CREATESTRUCTW* cs=0x33f98c (parameterEBP) LPCWSTR className="OleMainThreadWndClass 0x######## " (parameterEBP) HINSTANCE module=0x68850000 (parameterEBP) ... HWND hwnd=0x2002c (localEBP) HWND parent=0x20034 (localEBP) HWND owner=(nil) (localEBP) HWND top_child=(nil) (localEBP) MDICREATESTRUCTW mdi_cs={szClass=0x0(nil), szTitle=0x0(nil), hOwner=(nil), x=0, y=0, cx=0, cy=0, style=0, lParam=0} (localEBP) CBT_CREATEWNDW cbtc={lpcs=(nil), hwndInsertAfter=(nil)} (localEBP) CREATESTRUCTW cbcs={lpCreateParams=0x0(nil), hInstance=(nil), hMenu=(nil), hwndParent=(nil), cy=0, cx=0, y=0, x=0, style=0, lpszName=0x0(nil), lpszClass=0x0(nil), dwExStyle=0} (localEBP) DWORD ret=0x24 (localEBP) --- snip ---
Debugger, synchronous send message call to blocked main thread:
--- snip --- Wine-dbg>bt Backtrace: =>0 0x68284ec3 send_message(info=0xe1e940, res_ptr=0xe1e96c, unicode=0x1) [/home/focht/projects/wine/wine-git/dlls/user32/message.c:3064] in user32 (0x00e1e978) 1 0x682b685d GetWindowTextW+0x4e(hwnd=0x2002c, lpString="", nMaxCount=0x30) [/home/focht/projects/wine/wine-git/dlls/user32/win.c:2552] in user32 (0x00e1e998) 2 0x682b4b1b FindWindowExW+0x15f(parent=(nil), child=(nil), className=0x0(nil), title="Internet Banking of Agricultural Bank of China") [/home/focht/projects/wine/wine-git/dlls/user32/win.c:1775] in user32 (0x00e1e9d8) 3 0x682b4e05 FindWindowW+0x33(className=0x0(nil), title="Internet Banking of Agricultural Bank of China") [/home/focht/projects/wine/wine-git/dlls/user32/win.c:1843] in user32 (0x00e1e9f8) 4 0x003421ae in plugin_abc (+0x21ad) (0x682b4dd1) --- snip ---
Source: http://source.winehq.org/git/wine.git/blob/8f565eb6ae2663e2ef11342e85ce1cada...
--- snip --- 2547 INT WINAPI GetWindowTextW( HWND hwnd, LPWSTR lpString, INT nMaxCount ) 2548 { 2549 if (!lpString) return 0; 2550 2551 if (WIN_IsCurrentProcess( hwnd )) 2552 return (INT)SendMessageW( hwnd, WM_GETTEXT, nMaxCount, (LPARAM)lpString ); 2553 2554 /* when window belongs to other process, don't send a message */ 2555 if (nMaxCount <= 0) return 0; 2556 get_server_window_text( hwnd, lpString, nMaxCount ); 2557 return strlenW(lpString); 2558 } --- snip ---
$ sha1sum TDRABCSetup.exe 07f5d29a22ac01ab4eebf6779001dc6794028066 TDRABCSetup.exe
$ wine --version wine-1.3.37
Regards
http://bugs.winehq.org/show_bug.cgi?id=27282
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |gyebro69@gmail.com
--- Comment #6 from Anastasius Focht focht@gmx.net 2013-12-05 09:17:26 CST --- *** Bug 30902 has been marked as a duplicate of this bug. ***
http://bugs.winehq.org/show_bug.cgi?id=27282
Qian Hong fracting@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|wine-bugs@winehq.org |fracting@gmail.com
http://bugs.winehq.org/show_bug.cgi?id=27282
--- Comment #7 from Qian Hong fracting@gmail.com 2013-12-06 07:13:24 CST --- (In reply to comment #6)
*** Bug 30902 has been marked as a duplicate of this bug. ***
Hi, could someone test http://source.winehq.org/patches/data/100929 with bug 30902? My motivation to test by myself was killed by 1 GB of downloading...
Thanks :p
http://bugs.winehq.org/show_bug.cgi?id=27282
--- Comment #8 from GyB gyebro69@gmail.com 2013-12-06 08:42:15 CST --- (In reply to comment #7)
(In reply to comment #6)
*** Bug 30902 has been marked as a duplicate of this bug. ***
Hi, could someone test http://source.winehq.org/patches/data/100929 with bug 30902? My motivation to test by myself was killed by 1 GB of downloading...
Thanks :p
Your patch indeed fixes the startup issue in Arcania:Gothic 4.
http://bugs.winehq.org/show_bug.cgi?id=27282
--- Comment #9 from GyB gyebro69@gmail.com 2013-12-07 12:17:01 CST --- (In reply to comment #7)
(In reply to comment #6)
*** Bug 30902 has been marked as a duplicate of this bug. ***
Hi, could someone test http://source.winehq.org/patches/data/100929 with bug 30902? My motivation to test by myself was killed by 1 GB of downloading...
Thanks :p
I came across a problem with your patch: you can't change the size of the virtual desktop in winecfg's graphics tab. When you enter a different resolution and click on <Apply>, resolution reverts to the default 800x600.
http://bugs.winehq.org/show_bug.cgi?id=27282
--- Comment #10 from Qian Hong fracting@gmail.com 2013-12-07 12:27:05 CST --- (In reply to comment #9)
(In reply to comment #7)
(In reply to comment #6)
*** Bug 30902 has been marked as a duplicate of this bug. ***
Hi, could someone test http://source.winehq.org/patches/data/100929 with bug 30902? My motivation to test by myself was killed by 1 GB of downloading...
Thanks :p
I came across a problem with your patch: you can't change the size of the virtual desktop in winecfg's graphics tab. When you enter a different resolution and click on <Apply>, resolution reverts to the default 800x600.
Nice test... Thanks GyB, I can confirm that, will investigate more.
https://bugs.winehq.org/show_bug.cgi?id=27282
--- Comment #11 from Béla Gyebrószki gyebro69@gmail.com --- Still an issue in 1.7.25
https://bugs.winehq.org/show_bug.cgi?id=27282
mrdeathjr28@yahoo.es changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |mrdeathjr28@yahoo.es
https://bugs.winehq.org/show_bug.cgi?id=27282
--- Comment #12 from Qian Hong fracting@gmail.com --- Created attachment 49956 --> https://bugs.winehq.org/attachment.cgi?id=49956 Patch: user32: Call WM_GETTEXT message procedure directly in GetWindowText.
Hi, could someone help to test the new attached patch?
Thanks!
https://bugs.winehq.org/show_bug.cgi?id=27282
Sebastian Lackner sebastian@fds-team.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |sebastian@fds-team.de
https://bugs.winehq.org/show_bug.cgi?id=27282
--- Comment #13 from Bruno Jesus 00cpxxx@gmail.com --- (In reply to Qian Hong from comment #12)
Created attachment 49956 [details] Patch: user32: Call WM_GETTEXT message procedure directly in GetWindowText.
Hi, could someone help to test the new attached patch?
Thanks!
The patch works and the application starts as expected.
https://bugs.winehq.org/show_bug.cgi?id=27282
Alistair Leslie-Hughes leslie_alistair@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #49956|0 |1 is patch| |
https://bugs.winehq.org/show_bug.cgi?id=27282
--- Comment #14 from Sebastian Lackner sebastian@fds-team.de --- Even if the patch probably works, I don't think its the right solution to solve the issue. This patch has the disadvantage that now theoretically WM_GETTEXT messages can cause race-conditions with other WM_{SET,GET}TEXT messages on the main thread where the window was created.
Thats not a big problem for the default message handler, but other applications which install their own handler will crash then. Based on the information available online its perfectly fine that GetWindowText(...) sends a WM_GETTEXT message, so I would guess that the conclusion from Fochts analysis is actually wrong. Just search for "GetWindowText deadlock" and you'll find lots of people on Windows having the same problem.
I would assume that either:
* Windows only uses this behaviour if the wndproc procedure is really the default one, where Windows know that its threadsafe. Not sure if that fixes the issue for both affected apps though.
* The Ole window shouldn't be created so early
* FindWindowExW shouldn't use WM_GETTEXT <-- Thats what I would guess. Best way would be to write some tests where WM_GETTEXT doesn't match the window title that is known to the wineserver.
https://bugs.winehq.org/show_bug.cgi?id=27282
--- Comment #15 from Sebastian Lackner sebastian@fds-team.de --- I have written a patchset including tests which seems to confirm my theory:
Patches: https://github.com/wine-compholio/wine-staging/tree/master/patches/user32-Fi...
Testbot: https://newtestbot.winehq.org/JobDetails.pl?Key=10210
Could you guys please give it a try?
Please note that patch 2 also contains some tests for GetWindowText, and these tests seem to confirm that everything is right with the Wine implementation. Applying the patch from comment 12 or http://source.winehq.org/patches/data/100929 breaks the tests.
https://bugs.winehq.org/show_bug.cgi?id=27282
--- Comment #16 from Qian Hong fracting@gmail.com --- (In reply to Sebastian Lackner from comment #15)
I have written a patchset including tests which seems to confirm my theory:
Patches: https://github.com/wine-compholio/wine-staging/tree/master/patches/user32- FindWindowEx
Testbot: https://newtestbot.winehq.org/JobDetails.pl?Key=10210
Could you guys please give it a try?
Please note that patch 2 also contains some tests for GetWindowText, and these tests seem to confirm that everything is right with the Wine implementation. Applying the patch from comment 12 or http://source.winehq.org/patches/data/100929 breaks the tests.
Works for me, thanks Sebastina, good job!
Test with: $ sha1sum TDRABCSetup.exe fd83dfa2c0240d8dd581ce304ba0eeb96f2bf103 TDRABCSetup.exe (Newer version of TDRABCSetup doesn't trigger this bug)
https://bugs.winehq.org/show_bug.cgi?id=27282
Qian Hong fracting@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |d5ba7451a34bcdd1af5734cfc32 | |0f52abc957258 Status|NEW |RESOLVED Resolution|--- |FIXED
--- Comment #17 from Qian Hong fracting@gmail.com --- Fixed by http://source.winehq.org/git/wine.git/?a=commit;h=d5ba7451a34bcdd1af5734cfc3...
Thanks Sebastian, great work :)
https://bugs.winehq.org/show_bug.cgi?id=27282
Qian Hong fracting@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|TDRABCSetup.exe hang on |TDRABCSetup.exe hang on |start up (GetWindowText |start up (FindWindowExW |uses SendMessage to query |uses WM_GETTEXT to query |for process' local window |for process' local window |title text, leading to |title text, leading to |potential deadlock) |potential deadlock)
https://bugs.winehq.org/show_bug.cgi?id=27282
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #18 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 1.7.32.
https://bugs.winehq.org/show_bug.cgi?id=27282
--- Comment #19 from mrdeathjr28@yahoo.es --- confirmed arcania gothic 4 begins to work
https://www.youtube.com/watch?v=SrbCMe9Svf8
however in cinematics only works sound