[Bug 44587] TradeStation 10.0 Setup Wizard ends prematurely ( custom action dll instance data not reset due to pinning of dll during execution of multiple custom actions )

wine-bugs at winehq.org wine-bugs at winehq.org
Sat Feb 24 07:57:20 CST 2018


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

Anastasius Focht <focht at gmx.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |download, Installer
                URL|                            |http://update.tradestation.
                   |                            |com/Installs/TradeStation/1
                   |                            |0.00.00.567/TradeStation%20
                   |                            |Setup.exe
          Component|-unknown                    |msi
             Status|UNCONFIRMED                 |RESOLVED
            Summary|TradeStation Setup Wizard   |TradeStation 10.0 Setup
                   |ended prematurely           |Wizard ends prematurely
                   |                            |(custom action dll instance
                   |                            |data not reset due to
                   |                            |pinning of dll during
                   |                            |execution of multiple
                   |                            |custom actions)
         Resolution|---                         |DUPLICATE
                 CC|                            |focht at gmx.net

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

confirming.

After some hours of debugging I figured out this is a dupe of bug 10365

The main installer bundles multiple prerequisites:

--- snip ---
$ pwd
/home/focht/.wine/drive_c/users/focht/Temp/TRADESTATION20180224

$ ls -1sh
total 206M
 67M dotnetfx452.exe
113M install.msi
4.0K patching.ini
2.5M SSCERuntime_x64-ENU.exe
2.3M SSCERuntime_x86-ENU.exe
196K TSPreRequisiteInstaller.exe
4.0K TSPreRequisiteInstaller.ini
 14M vc_redist.x86.exe
1.7M Windows6.0-KB942288-v2-x86.msu
3.0M WindowsServer2003-KB942288-v4-x86.exe
3.2M WindowsXP-KB942288-v3-x86.exe
--- snip ---

and runs their installers prior to the main installer.

Microsoft Visual C++ 2015 Runtime x86:

--- snip ---
0040:fixme:advapi:CreateProcessAsUserW 0x78 (null)
L"C:\\users\\focht\\Temp\\TRADESTATION20180224\\vc_redist.x86.exe /passive
/showfinalerror /norestart /repair" (nil) (nil) 0 0x08000000 (nil) (null)
0x53ea00 0x53ea48 - semi-stub
--- snip ---

SQL Server Compact 4.0 x86:

--- snip ---
0040:fixme:advapi:CreateProcessAsUserW 0x7c (null)
L"C:\\users\\focht\\Temp\\TRADESTATION20180224\\SSCERuntime_x86-ENU.exe /i
/passive /norestart" (nil) (nil) 0 0x08000000 (nil) (null) 0x53ea00 0x53ea48 -
semi-stub
--- snip ---

Microsoft .NET Framework 4.5.2 x86 (NOTE: I have Wine-Mono disabled at compile
time by default hence any .NET Frameworks will always be installed if
requested):

--- snip ---
0040:fixme:advapi:CreateProcessAsUserW 0x80 (null)
L"C:\\users\\focht\\Temp\\TRADESTATION20180224\\dotnetfx452.exe /passive
/showfinalerror /norestart" (nil) (nil) 0 0x08000000 (nil) (null) 0x53ea00
0x53ea48 - semi-stub
--- snip ---

Finally the main installer for TradeStation 10.0:

--- snip ---
0040:fixme:advapi:CreateProcessAsUserW 0x88 (null) L"msiexec /i
\"C:\\users\\focht\\Temp\\TRADESTATION20180224\\install.msi\"
ProductLanguage=\"1033\"  /lv*x \"C:\\users\\Public\\Application
Data\\TradeStation
Technologies\\TradeStation\\Common\\Logs\\TSInstall2241248.log\"" (nil) (nil) 0
0x08000000 (nil) (null) 0x53dd60 0x53dda8 - semi-stub
...
0170:err:msi:ITERATE_Actions Execution halted, action
L"TS_CA_BeforeInstallFilesParam" returned 1603
0170:err:msi:ITERATE_Actions Execution halted, action L"ExecuteAction" returned
1603
--- snip ---

Trace log:

--- snip ---
$ pwd
/home/focht/.wine/drive_c/users/focht/Temp/TRADESTATION20180224

$ WINEDEBUG=+seh,+msi,+relay wine msiexec -i install.msi >>log.txt 2>&1
...
002f:trace:msi:ACTION_CustomAction Handling custom action L"TS_CA_BeginInstall"
(101 L"TradeStationCustomActions.dll" L"BeginInstall") 
...
002f:Call KERNEL32.CreateFileW(0018e500
L"C:\\users\\focht\\Temp\\msia74d.tmp",40000000,00000000,00000000,00000003,00000080,00000000)
ret=7ec72233
002f:Ret  KERNEL32.CreateFileW() retval=0000006c ret=7ec72233
...
002f:trace:msi:HANDLE_CustomType1 Calling function L"BeginInstall" from
L"C:\\users\\focht\\Temp\\msia74d.tmp" 
...
002f:trace:msi:ACTION_CustomAction Handling custom action
L"TS_CA_ExtractBinary" (101 L"TradeStationCustomActions.dll" L"ExtractBinary")
002f:trace:msi:HANDLE_CustomType1 Calling function L"ExtractBinary" from
L"C:\\users\\focht\\Temp\\msia74d.tmp"
...
<many times re-use of pinned temp binary for different CAs>
...
002f:trace:msi:ACTION_CustomAction Handling custom action
L"TS_CA_ValidateInstallFolder" (1 L"TradeStationCustomActions.dll"
L"ValidateInstallFolder")
002f:trace:msi:HANDLE_CustomType1 Calling function L"ValidateInstallFolder"
from L"C:\\users\\focht\\Temp\\msia74d.tmp" 
...
0033:trace:msi:ACTION_CallDllFunction calling L"ValidateInstallFolder"
...
0033:Call msi.MsiRecordSetStringA(00000005,00000000,101f5240
"ValidateInstallFolder:  TSLOG: Install folder path for verification is
C:\\Program Files\\TradeStation 10.0\\.") ret=10021817 
...
0033:RET  TradeStationCustomActions.ValidateInstallFolder(00000002)
retval=00000000 ret=7ec72bfa
...
0033:trace:msi:DllThread custom action (33) returned 0
...
0033:Call PE DLL (proc=0x10154e18,module=0x10000000
L"msia74d.tmp",reason=THREAD_DETACH,res=(nil))
...
002f:trace:msi:ACTION_CustomAction Handling custom action
L"TS_CA_ValidateInstallFolder" (1 L"TradeStationCustomActions.dll"
L"ValidateInstallFolder")
002f:trace:msi:HANDLE_CustomType1 Calling function L"ValidateInstallFolder"
from L"C:\\users\\focht\\Temp\\msia74d.tmp" 
...
002f:trace:msi:wait_thread_handle waiting for L"TS_CA_ValidateInstallFolder"
...
0034:Starting thread proc 0x7ec72fe7 (arg=0xf4c08c)
0034:trace:msi:DllThread custom action (34) started 
...
0034:trace:msi:ACTION_CallDllFunction calling L"ValidateInstallFolder"
0034:Call KERNEL32.GetEnvironmentVariableW(7ece0ecc
L"MsiBreak",007ffb2c,00000104) ret=7ec7299e
0034:Ret  KERNEL32.GetEnvironmentVariableW() retval=00000000 ret=7ec7299e
0034:Call msi.MsiGetActiveDatabase(00000002) ret=1002127a
0034:trace:msi:MsiGetActiveDatabase (2)
...
0034:trace:msi:MsiGetActiveDatabase (1)
...
0034:Ret  msi.MsiGetActiveDatabase() retval=00000004 ret=1002127a

...
0034:Call msi.MsiRecordSetStringA(00000005,00000000,101f5240
"ValidateInstallFolder:  Error 0x80004005: Failed to get previous size of
property data string.") ret=10021817 
...
0034:Call msi.MsiRecordSetStringA(00000005,00000000,101f5240
"ValidateInstallFolder:  Error 0x80004005: failed to get INSTALLDIR property
value") ret=10021817 
...
0034:trace:msi:DllThread custom action (34) returned 1603
...
0034:Call PE DLL (proc=0x10154e18,module=0x10000000
L"msia74d.tmp",reason=THREAD_DETACH,res=(nil)) 
...
--- snip ---

The 0x80004005 errors are internal codes, only seen when debugging.

The custom action stores multiple installer properties in internal custom
action data buffers. It appends data if needed during consecutive calls within
the same custom action function call. Due to the pinning of the custom action
dll(s), some instance data is not reset. The custom action finds non-zero
pointers and assumes this is "append" mode.
It uses HeapSize() to figure out the original buffer size and eventually will
resize if needed. Since the original heap block was freed and potentially
recycled by other heap usage, HeapSize() fails ("in-use" heap magic can't be
found), ultimately causing the whole custom action to fail.

See my analysis for the pinning problem in bug 10365 for further details:

* https://bugs.winehq.org/show_bug.cgi?id=10365#c21
* https://bugs.winehq.org/show_bug.cgi?id=10365#c23

Basically to fix the brain damage in Microsoft Office 2010 installer, other app
installers have to suffer.

I've tested this installer by unloading the temp dll after the custom action
finished and it fixes the problem as expected.

$ sha1sum TradeStation\ Setup.exe 
5dea044303fa0fb6707e15e65016cb7de63526da  TradeStation Setup.exe

$ du -sh TradeStation\ Setup.exe 
187M    TradeStation Setup.exe

$ wine --version
wine-3.2-173-gea82a00a42

Regards

*** This bug has been marked as a duplicate of bug 10365 ***

-- 
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