[Bug 37736] Photoshop Elements 11/ 12 installers hang when installing common shared technologies (' GetWindowTextLength' must not call 'SendMessage' for window handles belonging to other processes)

wine-bugs at winehq.org wine-bugs at winehq.org
Mon May 21 10:38:13 CDT 2018


https://bugs.winehq.org/show_bug.cgi?id=37736

Anastasius Focht <focht at gmx.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
                 CC|                            |focht at gmx.net
            Summary|Photoshop Elements 11       |Photoshop Elements 11/12
                   |Installer hangs when        |installers hang when
                   |installing common shared    |installing common shared
                   |technologies                |technologies
                   |                            |('GetWindowTextLength' must
                   |                            |not call 'SendMessage' for
                   |                            |window handles belonging to
                   |                            |other processes)
     Ever confirmed|0                           |1
          Component|-unknown                    |user32

--- Comment #2 from Anastasius Focht <focht at gmx.net> ---
Hello folks,

confirming.

The installer creates a number of sub-processes. Hierarchy:

--- snip ---
$ wine64 winedbg

Wine-dbg> info process
 pid      threads  executable (all id:s are in hex)
 0000002e 1        'Setup.exe'
 00000035 4        \_ 'msiexec.exe'
 00000130 4           \_ 'msiexec.exe'
 000001f4 2              \_ 'Set-up.exe'
 000001f9 1                 \_ 'Setup.exe'
 000000df 1           \_ 'winemenubuilder.exe'
 000000dd 1           \_ 'winemenubuilder.exe'
 00000030 4        \_ 'explorer.exe'
 0000000e 8        'services.exe'
 0000019b 12       \_ 'PhotoshopElementsFileAgent.exe'
 000000ed 3        \_ 'winedevice.exe'
 00000021 4        \_ 'winedevice.exe'
 0000001c 3        \_ 'plugplay.exe'
 00000011 4        \_ 'winedevice.exe' 

Wine-dbg>info thread
process  tid      prio (all id:s are in hex) 
...
0000002e Setup.exe
    0000002f    0 
...
00000035 msiexec.exe
    00000132    0
    0000012f    0
    00000038    0
    00000036    0 
...
00000130 msiexec.exe
    00000138    0
    00000134    0
    00000133    0
    00000131    0 
...
0000019b PhotoshopElementsFileAgent.exe
    000001aa    0
...
000001f4 Set-up.exe
    000001f6    0
    000001f5    0
000001f9 Setup.exe
    000001fa    0
--- snip ---

Bootstrapper process:

--- snip ---
...
002f:Call
user32.CreateDialogIndirectParamW(00400000,00591530,00000000,004109a5,00000000)
ret=00411179
...
002f:Call user32.GetParent(00010052) ret=00418c17
002f:Ret  user32.GetParent() retval=00000000 ret=00418c17
002f:Call user32.SetWindowLongW(00010052,fffffffc,00416031) ret=0041726f
002f:Ret  user32.SetWindowLongW() retval=7e7f003c ret=0041726f
...
002f:Call user32.CallWindowProcW(7e7f003c,00010052,00000081,00000000,0033bc80)
ret=00412a38
002f:Call window proc 0x7e7f003c
(hwnd=0x10052,msg=WM_NCCREATE,wp=00000000,lp=0033bc80)
002f:Call winex11.drv.SetWindowText(00010052,00193a48 L"Choose Setup Language")
ret=7e7f082e
002f:Ret  winex11.drv.SetWindowText() retval=00000001 ret=7e7f082e
002f:Ret  window proc 0x7e7f003c
(hwnd=0x10052,msg=WM_NCCREATE,wp=00000000,lp=0033bc80) retval=00000001
002f:Ret  user32.CallWindowProcW() retval=00000001 ret=00412a38
002f:Ret  window proc 0x416031
(hwnd=0x10052,msg=WM_NCCREATE,wp=00000000,lp=0033bc80) retval=00000001
002f:Call imm32.__wine_register_window(00010052) ret=7e8578e2
002f:Call user32.GetClassNameW(00010052,0033b9a0,00000008) ret=7daae152
002f:Ret  user32.GetClassNameW() retval=00000006 ret=7daae152
002f:Call user32.GetClassLongW(00010052,ffffffe6) ret=7daae185
002f:Ret  user32.GetClassLongW() retval=00000808 ret=7daae185
002f:Call user32.GetWindowThreadProcessId(00010052,0033b98c) ret=7daaa512
002f:Ret  user32.GetWindowThreadProcessId() retval=0000002f ret=7daaa512
...
002f:Ret  user32.CreateDialogIndirectParamW() retval=00010052 ret=00411179
...
002f:Call user32.PostMessageW(00010052,00000000,00000000,00000000) ret=004148d6
002f:Ret  user32.PostMessageW() retval=00000001 ret=004148d6
002f:Call user32.EndDialog(00010052,00000001) ret=00410afe
...
002f:Call user32.CallWindowProcW(7e831bcd,00010058,0000001c,00000000,00000000)
ret=004170fa
002f:Call window proc 0x7e831bcd
(hwnd=0x10058,msg=WM_ACTIVATEAPP,wp=00000000,lp=00000000)
002f:Ret  window proc 0x7e831bcd
(hwnd=0x10058,msg=WM_ACTIVATEAPP,wp=00000000,lp=00000000) retval=00000000
002f:Ret  user32.CallWindowProcW() retval=00000000 ret=004170fa
002f:Ret  window proc 0x416fd6
(hwnd=0x10058,msg=WM_ACTIVATEAPP,wp=00000000,lp=00000000) retval=00000000
002f:Call window proc 0x416031
(hwnd=0x10052,msg=WM_KILLFOCUS,wp=00000000,lp=00000000)
002f:Call user32.CallWindowProcW(7e7f003c,00010052,00000008,00000000,00000000)
ret=00412a38
002f:Call window proc 0x7e7f003c
(hwnd=0x10052,msg=WM_KILLFOCUS,wp=00000000,lp=00000000)
002f:Call dialog proc 0x4109a5
(hwnd=0x10052,msg=WM_KILLFOCUS,wp=00000000,lp=00000000)
002f:Ret  dialog proc 0x4109a5
(hwnd=0x10052,msg=WM_KILLFOCUS,wp=00000000,lp=00000000) retval=00000000
result=00000000
002f:Ret  window proc 0x7e7f003c
(hwnd=0x10052,msg=WM_KILLFOCUS,wp=00000000,lp=00000000) retval=00000000
002f:Ret  user32.CallWindowProcW() retval=00000000 ret=00412a38
002f:Ret  window proc 0x416031
(hwnd=0x10052,msg=WM_KILLFOCUS,wp=00000000,lp=00000000) retval=00000000
002f:Call winex11.drv.GetKeyboardLayout(00000000) ret=7e80afe8
002f:Ret  winex11.drv.GetKeyboardLayout() retval=04090409 ret=7e80afe8
002f:Ret  user32.EndDialog() retval=00000001 ret=00410afe
...
002f:Call KERNEL32.CreateFileW(006d8ae8
L"C:\\users\\focht\\Temp\\PSE12Setup.log",c0000000,00000003,00337814,00000004,00000080,00000000)
ret=00514d0d
002f:Ret  KERNEL32.CreateFileW() retval=0000009c ret=00514d0d
002f:Call KERNEL32.GetFileType(0000009c) ret=00514d8d
002f:Ret  KERNEL32.GetFileType() retval=00000001 ret=00514d8d
002f:Call KERNEL32.CreateProcessW(00000000,0033adb0 L"msiexec /i
\"Z:\\home\\focht\\Desktop\\Adobe Photoshop Elements 12\\PSE 12\\Adobe
Photoshop Elements 12.msi\" TRANSFORMS=1033.mst ELEMENTS_EN_US=1
ORGANIZER_EN_US=1 SUPPRESSREBOOT=0 NOT_STANDALONE=1 /l*v
\"C:\\users\\focht\\Temp\\PSE12Install.log\"",00000000,00000000,00000000,08000000,00000000,00000000,003378fc,00337940)
ret=00401d2f
002f:Ret  KERNEL32.CreateProcessW() retval=00000001 ret=00401d2f
002f:Call KERNEL32.WaitForSingleObject(000000b0,ffffffff) ret=00401d42 
--- snip ---

The 'bootstrapper' process (statically linked with MFC) creates a non-modal
dialog to let the user chose the install language (listbox).
After selecting the language and pressing 'OK' button, the app does the
following within the message handler:

* calls EndDialog() (tidbit: 'DestroyWindow' is never called in the handler.
Someone at Adobe doesn't know how to properly destroy modeless dialogs. I've
seen various brain damaged code from that company while investigating Wine bugs
in the past years - no surprise here)
* spawns 'msiexec' process
* synchronously waits for 'msiexec' process termination

As already mentioned, the installer spawns a number of sub-processes.
The "deployment" process tries find running processes to be blocked/terminated.

Essentially this after getting snapshot of processes/threads via toolhelp:

--- snip ---
$ egrep -A2 "(01fa:.*EnumThreadWindows.*)" log.txt 

01fa:Call user32.EnumThreadWindows(00000009,1001dd30,0032d184) ret=1001df01
01fa:Ret  user32.EnumThreadWindows() retval=00000001 ret=1001df01
01fa:Call msvcr100.??2 at YAPAXI@Z(0000002c) ret=1000c82e
01fa:Call ntdll.RtlAllocateHeap(004a0000,00000000,0000002c) ret=7e49024a
--
01fa:Call user32.EnumThreadWindows(000001a7,1001dd30,0032d184) ret=1001df01
01fa:Ret  user32.EnumThreadWindows() retval=00000001 ret=1001df01
01fa:Call msvcr100.??2 at YAPAXI@Z(0000002c) ret=1000c82e
01fa:Call ntdll.RtlAllocateHeap(004a0000,00000000,0000002c) ret=7e49024a
--
01fa:Call user32.EnumThreadWindows(000000ef,1001dd30,0032d184) ret=1001df01
01fa:Ret  user32.EnumThreadWindows() retval=00000001 ret=1001df01
01fa:Call msvcr100.??2 at YAPAXI@Z(00000058) ret=1000c82e
01fa:Call ntdll.RtlAllocateHeap(004a0000,00000000,00000058) ret=7e49024a
--
01fa:Call user32.EnumThreadWindows(00000023,1001dd30,0032d184) ret=1001df01
01fa:Ret  user32.EnumThreadWindows() retval=00000001 ret=1001df01
01fa:Call msvcr100.??2 at YAPAXI@Z(00000084) ret=1000c82e
01fa:Call ntdll.RtlAllocateHeap(004a0000,00000000,00000084) ret=7e49024a
--
01fa:Call user32.EnumThreadWindows(0000001e,1001dd30,0032d184) ret=1001df01
01fa:Ret  user32.EnumThreadWindows() retval=00000001 ret=1001df01
01fa:Call msvcr100.??2 at YAPAXI@Z(000000b0) ret=1000c82e
01fa:Call ntdll.RtlAllocateHeap(004a0000,00000000,000000b0) ret=7e49024a
--
01fa:Call user32.EnumThreadWindows(00000018,1001dd30,0032d184) ret=1001df01
01fa:Ret  user32.EnumThreadWindows() retval=00000001 ret=1001df01
01fa:Call msvcr100.??2 at YAPAXI@Z(00000108) ret=1000c82e
01fa:Call ntdll.RtlAllocateHeap(004a0000,00000000,00000108) ret=7e49024a
--
01fa:Call user32.EnumThreadWindows(00000013,1001dd30,0032d184) ret=1001df01
01fa:Ret  user32.EnumThreadWindows() retval=00000001 ret=1001df01
01fa:Call KERNEL32.Thread32Next(00000084,0032d1b0) ret=1001df44
01fa:Ret  KERNEL32.Thread32Next() retval=00000001 ret=1001df44
01fa:Call user32.EnumThreadWindows(00000010,1001dd30,0032d184) ret=1001df01
01fa:Ret  user32.EnumThreadWindows() retval=00000001 ret=1001df01
01fa:Call msvcr100.??2 at YAPAXI@Z(0000018c) ret=1000c82e
01fa:Call ntdll.RtlAllocateHeap(004a0000,00000000,0000018c) ret=7e49024a
--
01fa:Call user32.EnumThreadWindows(0000000f,1001dd30,0032d184) ret=1001df01
01fa:Ret  user32.EnumThreadWindows() retval=00000001 ret=1001df01
01fa:Call KERNEL32.Thread32Next(00000084,0032d1b0) ret=1001df44
01fa:Ret  KERNEL32.Thread32Next() retval=00000001 ret=1001df44
--
01fa:Call user32.EnumThreadWindows(0000001b,1001dd30,0032d184) ret=1001df01
01fa:Ret  user32.EnumThreadWindows() retval=00000001 ret=1001df01
01fa:Call msvcr100.??2 at YAPAXI@Z(0000002c) ret=1000c82e
01fa:Call ntdll.RtlAllocateHeap(004a0000,00000000,0000002c) ret=7e49024a
--
01fa:Call user32.EnumThreadWindows(00000017,1001dd30,0032d184) ret=1001df01
01fa:Ret  user32.EnumThreadWindows() retval=00000001 ret=1001df01
01fa:Call msvcr100.??2 at YAPAXI@Z(00000058) ret=1000c82e
01fa:Call ntdll.RtlAllocateHeap(004a0000,00000000,00000058) ret=7e49024a
--
01fa:Call user32.EnumThreadWindows(00000016,1001dd30,0032d184) ret=1001df01
01fa:Ret  user32.EnumThreadWindows() retval=00000001 ret=1001df01
01fa:Call msvcr100.??2 at YAPAXI@Z(00000084) ret=1000c82e
01fa:Call ntdll.RtlAllocateHeap(004a0000,00000000,00000084) ret=7e49024a
--
01fa:Call user32.EnumThreadWindows(00000012,1001dd30,0032d184) ret=1001df01
01fa:Ret  user32.EnumThreadWindows() retval=00000001 ret=1001df01
01fa:Call msvcr100.??2 at YAPAXI@Z(000000b0) ret=1000c82e
01fa:Call ntdll.RtlAllocateHeap(004a0000,00000000,000000b0) ret=7e49024a
--
01fa:Call user32.EnumThreadWindows(00000020,1001dd30,0032d184) ret=1001df01
01fa:Ret  user32.EnumThreadWindows() retval=00000001 ret=1001df01
01fa:Call msvcr100.??2 at YAPAXI@Z(0000002c) ret=1000c82e
01fa:Call ntdll.RtlAllocateHeap(004a0000,00000000,0000002c) ret=7e49024a
--
01fa:Call user32.EnumThreadWindows(0000001f,1001dd30,0032d184) ret=1001df01
01fa:Ret  user32.EnumThreadWindows() retval=00000001 ret=1001df01
01fa:Call msvcr100.??2 at YAPAXI@Z(00000058) ret=1000c82e
01fa:Call ntdll.RtlAllocateHeap(004a0000,00000000,00000058) ret=7e49024a
--
01fa:Call user32.EnumThreadWindows(0000001d,1001dd30,0032d184) ret=1001df01
01fa:Ret  user32.EnumThreadWindows() retval=00000001 ret=1001df01
01fa:Call msvcr100.??2 at YAPAXI@Z(00000084) ret=1000c82e
01fa:Call ntdll.RtlAllocateHeap(004a0000,00000000,00000084) ret=7e49024a
--
01fa:Call user32.EnumThreadWindows(0000002a,1001dd30,0032d184) ret=1001df01
01fa:Ret  user32.EnumThreadWindows() retval=00000001 ret=1001df01
01fa:Call msvcr100.??2 at YAPAXI@Z(0000002c) ret=1000c82e
01fa:Call ntdll.RtlAllocateHeap(004a0000,00000000,0000002c) ret=7e49024a
--
01fa:Call user32.EnumThreadWindows(00000025,1001dd30,0032d184) ret=1001df01
01fa:Ret  user32.EnumThreadWindows() retval=00000001 ret=1001df01
01fa:Call msvcr100.??2 at YAPAXI@Z(00000058) ret=1000c82e
01fa:Call ntdll.RtlAllocateHeap(004a0000,00000000,00000058) ret=7e49024a
--
01fa:Call user32.EnumThreadWindows(00000024,1001dd30,0032d184) ret=1001df01
01fa:Ret  user32.EnumThreadWindows() retval=00000001 ret=1001df01
01fa:Call msvcr100.??2 at YAPAXI@Z(00000084) ret=1000c82e
01fa:Call ntdll.RtlAllocateHeap(004a0000,00000000,00000084) ret=7e49024a
--
01fa:Call user32.EnumThreadWindows(00000022,1001dd30,0032d184) ret=1001df01
01fa:Ret  user32.EnumThreadWindows() retval=00000001 ret=1001df01
01fa:Call msvcr100.??2 at YAPAXI@Z(000000b0) ret=1000c82e
01fa:Call ntdll.RtlAllocateHeap(004a0000,00000000,000000b0) ret=7e49024a
--
01fa:Call user32.EnumThreadWindows(0000002f,1001dd30,0032d184) ret=1001df01
01fa:Call user32.GetWindowTextLengthW(00010052) ret=1001dd78
01fa:Call
winex11.drv.MsgWaitForMultipleObjectsEx(00000001,0032cf28,ffffffff,00008040,00000000)
ret=7e8e1632 
<hangs here>
--- snip ---

Backtrace of hanging process' main thread:

--- snip ---

Backtracing for thread 01fa in process 01f9 (C:\Program Files\Common
Files\Adobe\OOBE\PDApp\DECore\Setup.exe):
Backtrace:
=>0 0xf7fb6047 __kernel_vsyscall+0x7() in [vdso].so (0x0032c9b8)
  1 0xf7d848c7 __libc_read+0x66() in libpthread.so.0 (0x0032c9b8)
  2 0x7bc8f976 wait_select_reply+0x1e(cookie=0x32ca9c)
[/home/focht/projects/wine/mainline-src/dlls/ntdll/server.c:359] in ntdll
(0x0032c9b8)
  3 0x7bc9083a server_select+0x163(select_op=0x32caf4, size=0x8, flags=0x2,
timeout=(nil)) [/home/focht/projects/wine/mainline-src/dlls/ntdll/server.c:618]
in ntdll (0x0032cac8)
  4 0x7bc9abc2 wait_objects+0xb9(count=0x1, handles=0x32cc90, wait_any=1,
alertable=0, timeout=(nil))
[/home/focht/projects/wine/mainline-src/dlls/ntdll/sync.c:1031] in ntdll
(0x0032cc08)
  5 0x7bc9ac00 NtWaitForMultipleObjects+0x38(count=<couldn't compute location>,
handles=<couldn't compute location>, wait_any=1, alertable=0, timeout=<couldn't
compute location>)
[/home/focht/projects/wine/mainline-src/dlls/ntdll/sync.c:1042] in ntdll
(0x0032cc48)
  6 0x7b47e4f8 WaitForMultipleObjectsEx+0xad(count=<couldn't compute location>,
handles=<couldn't compute location>, wait_all=<couldn't compute location>,
timeout=<couldn't compute location>, alertable=<couldn't compute location>)
[/home/focht/projects/wine/mainline-src/dlls/kernel32/sync.c:221] in kernel32
(0x0032cda8)
  7 0x7d8b2874 X11DRV_MsgWaitForMultipleObjectsEx+0xcd(count=<couldn't compute
location>, handles=<couldn't compute location>, timeout=<couldn't compute
location>, mask=<couldn't compute location>, flags=<couldn't compute location>)
[/home/focht/projects/wine/mainline-src/dlls/winex11.drv/event.c:497] in
winex11 (0x0032cdf8)
  8 0x7bc801bb relay_call+0x3e() in ntdll (0x0032ce3c)
  9 0x7d8a6930 __x86.get_pc_thunk.dx+0x276() in winex11 (0x0032ce88)
  10 0x7e8e1632 wait_message+0x21(count=0x1, handles=0x32cf28,
timeout=0xffffffff, mask=0x8040, flags=0)
[/home/focht/projects/wine/mainline-src/dlls/user32/winproc.c:1164] in user32
(0x0032ce88)
  11 0x7e8a6b03 wait_message_reply+0xf5(flags=0)
[/home/focht/projects/wine/mainline-src/dlls/user32/message.c:3035] in user32
(0x0032cf48)
  12 0x7e8a7254 send_inter_thread_message+0xcd(info=0x32cfd0, res_ptr=0x32cf9c)
[/home/focht/projects/wine/mainline-src/dlls/user32/message.c:3213] in user32
(0x0032cf78)
  13 0x7e8a74f1 send_message+0x217(info=0x32cfd0, res_ptr=0x32cffc,
unicode=0x1)
[/home/focht/projects/wine/mainline-src/dlls/user32/message.c:3281] in user32
(0x0032cfb8)
  14 0x7e8a79ad SendMessageW+0x57(hwnd=<couldn't compute location>,
msg=<couldn't compute location>, wparam=<couldn't compute location>,
lparam=<couldn't compute location>)
[/home/focht/projects/wine/mainline-src/dlls/user32/message.c:3464] in user32
(0x0032d008)
  15 0x7e8d43f7 GetWindowTextLengthW+0x1f(hwnd=<couldn't compute location>)
[/home/focht/projects/wine/mainline-src/dlls/user32/win.c:2886] in user32
(0x0032d038)
  16 0x7bc801bb relay_call+0x3e() in ntdll (0x0032d064)
  17 0x7e848a58 in user32 (+0x8a57) (0x0032d0d8)
  18 0x1001dd78 in setup (+0x1dd77) (0x0032d0d8)
  19 0x7e8d5604 EnumThreadWindows+0x69(id=<couldn't compute location>,
func=<couldn't compute location>, lParam=<couldn't compute location>)
[/home/focht/projects/wine/mainline-src/dlls/user32/win.c:3416] in user32
(0x0032d108)
  20 0x7bc801bb relay_call+0x3e() in ntdll (0x0032d148)
  21 0x7e847a08 in user32 (+0x7a07) (0x0032d1dc)
  22 0x1001df01 in setup (+0x1df00) (0x0032d1dc)
  23 0x1001d8e4 in setup (+0x1d8e3) (0x0032d444)
  24 0x1001e742 in setup (+0x1e741) (0x00335efc)
...
--- snip ---

Since the modeless dialog/window was not destroyed (EndDialog doesn't work this
way, Adobe), the window still exists but the thread can't receive/pump messages
for it because 'WaitForSingleObject()' in the message handler prevents it from
doing so.

The solution is to have 'GetWindowTextLengthA/W()' not call 'SendMessage()'
when the window handle belongs to another process but go through wineserver.

https://source.winehq.org/git/wine.git/blob/HEAD:/dlls/user32/win.c#l2873

--- snip ----
2873 /*******************************************************************
2874  *              GetWindowTextLengthA (USER32.@)
2875  */
2876 INT WINAPI GetWindowTextLengthA( HWND hwnd )
2877 {
2878     return SendMessageA( hwnd, WM_GETTEXTLENGTH, 0, 0 );
2879 }
2880 
2881 /*******************************************************************
2882  *              GetWindowTextLengthW (USER32.@)
2883  */
2884 INT WINAPI GetWindowTextLengthW( HWND hwnd )
2885 {
2886     return SendMessageW( hwnd, WM_GETTEXTLENGTH, 0, 0 );
2887 }
--- snip ----

I've investigated a similar issue some years ago, leading to
'GetWindowTextA/W()' getting fixed (bug 27282).
You can take that approach -> 'get_server_window_text()'

The installer succeeds with that approach (already tested).
Adobe app code is still questionable at best tho.

$ sha1sum PhotoshopElements_12_LS25.*
f09f15899a689a610686c365f372a4763f373f71  PhotoshopElements_12_LS25.7z
f28205713928aa575c9e282e1c4308d10b241de4  PhotoshopElements_12_LS25.exe

$ du -sh PhotoshopElements_12_LS25.*
1.1G    PhotoshopElements_12_LS25.7z
1.5M    PhotoshopElements_12_LS25.exe

$ wine --version
wine-3.8-128-g8e9ea7a8a1

Regards

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.



More information about the wine-bugs mailing list