https://bugs.winehq.org/show_bug.cgi?id=36630
Bug ID: 36630 Summary: Wizards Event Reporter fails on startup with .NET runtime reporting: 'Strong name validation failed. Exception from HRESULT: 0x8013141A' Product: Wine Version: 1.7.19 Hardware: x86 OS: Linux Status: NEW Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: focht@gmx.net
Hello folks,
reported in WineHQ user forums here: http://forum.winehq.org/viewtopic.php?f=8&t=22329
Prerequisite: 'winetricks -q dotnet20sp1 jet40'
--- snip --- $ pwd /home/focht/.wine/drive_c/Program Files/Wizards of the Coast/Event Reporter
$ wine ./Reporter.exe
fixme:advapi:RegisterEventSourceW ((null),L".NET Runtime 2.0 Error Reporting"): stub fixme:advapi:ReportEventW (0xcafe4242,0x0001,0x0000,0x000003e8,(nil),0x0008,0x000000f4,0x3009a1b4,0x69c610): stub err:eventlog:ReportEventW L"reporter.exe" err:eventlog:ReportEventW L"4.1.14.439" err:eventlog:ReportEventW L"537a1f52" err:eventlog:ReportEventW L"kernel32.dll" err:eventlog:ReportEventW L"5.1.2600.2180" err:eventlog:ReportEventW L"00000000" err:eventlog:ReportEventW L"0" err:eventlog:ReportEventW L"0002ac57" fixme:advapi:DeregisterEventSource (0xcafe4242) stub ...
Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'Reporter, Version=4.1.14.439, Culture=neutral, PublicKeyToken=f6187a2321850a68' or one of its dependencies. Strong name validation failed. (Exception from HRESULT: 0x8013141A) File name: 'Reporter, Version=4.1.14.439, Culture=neutral, PublicKeyToken=f6187a2321850a68' ---> System.Security.SecurityException: Strong name validation failed. (Exception from HRESULT: 0x8013141A) The Zone of the assembly that failed was: MyComputer
wine: Unhandled exception 0xe0434f4d in thread 9 at address 0x7b83ac57 (thread 0009), starting debugger... --- snip ---
Running 'sn.exe' (Strong Name-Tool) from .NET Framework 2.0 SDK ('winetricks -q dotnet20sdk') on the assembly also reports failure:
--- snip --- $ wine "C:\Program Files\Microsoft.NET\SDK\v2.0\bin\sn.exe" -vf ./Reporter.exe
Microsoft (R) .NET Framework Strong Name Utility Version 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved.
fixme:msvcrt:__clean_type_info_names_internal (0x60345090) stub Failed to verify assembly -- Strong name validation failed for assembly './Reporter.exe'. fixme:msvcrt:__clean_type_info_names_internal (0x7a38d5c8) stub --- snip ---
Interestingly, registering the assembly for verification skipping is reported successful but verification is still done and fails in the end.
--- snip --- $ wine "C:\Program Files\Microsoft.NET\SDK\v2.0\bin\sn.exe" -Vr ./Reporter.exe
Microsoft (R) .NET Framework Strong Name Utility Version 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved.
Verification entry added for assembly 'Reporter,F6187A2321850A68' fixme:msvcrt:__clean_type_info_names_internal (0x7a38d5c8) stub --- snip ---
$ sha1sum ReporterSetup.exe 36a15e8bf2c9d1a1501fe3fd0844f695750e198c ReporterSetup.exe
$ du -sh ReporterSetup.exe 14M ReporterSetup.exe
$ wine --version wine-1.7.19-70-gd6a59f7
Regards
https://bugs.winehq.org/show_bug.cgi?id=36630
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |dotnet, download URL| |http://webapp.wizards.com/D | |CIRUpdate/ReporterSetup.exe
https://bugs.winehq.org/show_bug.cgi?id=36630
lizhenbo litimetal@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |litimetal@gmail.com
https://bugs.winehq.org/show_bug.cgi?id=36630
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |austinenglish@gmail.com
--- Comment #1 from Austin English austinenglish@gmail.com --- Hi Focht,
Stumbled on this while looking for dotnet stuff; seems the download URL is dead. Do you have a new one? Is it still in current wine (3.9)?
https://bugs.winehq.org/show_bug.cgi?id=36630
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|Wizards Event Reporter |Wizards Event Reporter |fails on startup with .NET |v4.1.x (.NET 2.0 SP1 app) |runtime reporting: 'Strong |fails on startup with .NET |name validation failed. |runtime reporting: 'Strong |Exception from HRESULT: |name validation failed. |0x8013141A' |Exception from HRESULT: | |0x8013141A'
--- Comment #2 from Anastasius Focht focht@gmx.net --- Hello Austin,
--- quote --- Stumbled on this while looking for dotnet stuff; seems the download URL is dead. Do you have a new one? Is it still in current wine (3.9)? --- quote ---
indeed, the original download link is broken:
http://webapp.wizards.com/DCIRUpdate/ReporterSetup.exe -> 4.1.14.439
There is a new one, but it seems the vendor developed "v2" of the app:
http://webapp.wizards.com/DCIRUpdater/v2/ReporterSetup.exe -> 4.4.7.639
The v2 installer says it requires .NET Framework 3.5
Running 'ReporterSetup.exe' after 'winetricks -q dotnet35' leads to:
--- snip --- ... 0053:fixme:d3d:wined3d_check_device_format_conversion wined3d 0x1f8348, adapter_idx 0, device_type WINED3D_DEVICE_TYPE_HAL, src_format WINED3DFMT_B8G8R8X8_UNORM, dst_format WINED3DFMT_B8G8R8X8_UNORM stub! 0053:fixme:ntdll:RtlEnumerateGenericTableWithoutSplaying (0x1d4bc4,0x50afe5c) stub! 0052:fixme:shell:URL_ParseUrl failed to parse L"PresentationFramework.resources"
Unhandled Exception: System.Windows.Markup.XamlParseException: Cannot find DependencyProperty or PropertyInfo for property named 'StringFormat'. Property names are case sensitive. Error at object 'System.Windows.Data.MultiBinding' in markup file 'LanguageSelectorSetup;component/view/mainwindowview.xaml'. at System.Windows.Markup.XamlParseException.ThrowException(String message, Exception innerException, Int32 lineNumber, Int32 linePosition, Uri baseUri, XamlObjectIds currentXamlObjectIds, XamlObjectIds contextXamlObjectIds, Type objectType) at System.Windows.Markup.XamlParseException.ThrowException(ParserContext parserContext, Int32 lineNumber, Int32 linePosition, String message, Exception innerException) at System.Windows.Markup.BamlRecordReader.ThrowException(SRID id, String parameter) at System.Windows.Markup.BamlRecordReader.ReadPropertyRecordBase(String attribValue, Int16 attributeId, Int16 converterTypeId) at System.Windows.Markup.BamlRecordReader.ReadPropertyConverterRecord(BamlPropertyWithConverterRecord bamlPropertyRecord) at System.Windows.Markup.BamlRecordReader.ReadRecord(BamlRecord bamlRecord) at System.Windows.Markup.BamlRecordReader.Read(Boolean singleRecord) at System.Windows.Markup.TreeBuilderBamlTranslator.ParseFragment() at System.Windows.Markup.TreeBuilder.Parse() at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream) at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator) at LanguageSelectorSetup.View.MainWindowView.InitializeComponent() at LanguageSelectorSetup.BootstrapperApp.Run() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart() 0052:fixme:shell:URL_ParseUrl failed to parse L"PresentationFramework" wine: Unhandled exception 0xe0434f4d in thread 52 at address 0x7b447117 (thread 0052), starting debugger... Unhandled exception: 0xe0434f4d in 32-bit code (0x7b447117). --- snip ---
http://faithlife.codes/blog/2010/02/cannot_find_property_named_stringformat/
--- quote --- Cannot find property named 'StringFormat'
A few of our users have had Logos 4 crash on startup with the following exception:
System.Windows.Markup.XamlParseException: 'pack://application:Name.xaml' value cannot be assigned to property 'Source' of object 'System.Windows.ResourceDictionary'. Cannot find DependencyProperty or PropertyInfo for property named 'StringFormat'. Property names are case sensitive. Error at object 'System.Windows.Data.Binding' in markup file 'Name.xaml'.
StringFormat is a new feature in .NET 3.5 SP1; this error indicates that 3.5 SP1 is not installed properly. One should first try to download and install .NET 3.5 SP1 normally; then repair the current installation (through Control Panel, Add/Remove Programs); if all that fails, use the .NET Framework Cleanup Tool to uninstall and reinstall the framework. --- quote ---
So it really needs .NET Framework 3.5 SP1 -> 'winetricks -q dotnet35sp1'
--- snip --- ... 003e:fixme:d3d:wined3d_check_device_format_conversion wined3d 0x1fd4a0, adapter_idx 0, device_type WINED3D_DEVICE_TYPE_HAL, src_format WINED3DFMT_B8G8R8X8_UNORM, dst_format WINED3DFMT_B8G8R8X8_UNORM stub! 003d:fixme:shell:URL_ParseUrl failed to parse L"PresentationFramework.classic" 003d:fixme:msg:ChangeWindowMessageFilter c04d 00000001 003d:fixme:msg:ChangeWindowMessageFilter c04f 00000001 003e:fixme:d3d:wined3d_check_device_format_conversion wined3d 0x1fd4a0, adapter_idx 0, device_type WINED3D_DEVICE_TYPE_HAL, src_format WINED3DFMT_B8G8R8X8_UNORM, dst_format WINED3DFMT_B8G8R8X8_UNORM stub! 003f:fixme:d3d:state_linepattern_w Setting line patterns is not supported in OpenGL core contexts. 003f:fixme:d3d:state_lastpixel Last Pixel Drawing Disabled, not handled yet 003d:fixme:shell:URL_ParseUrl failed to parse L"UIAutomationProvider" 003d:fixme:shell:URL_ParseUrl failed to parse L"UIAutomationTypes" 003e:fixme:d3d9:Direct3DShaderValidatorCreate9 stub 003e:fixme:wincodecs:IMILUnknown2Impl_UnknownMethod1 (0x20c9f8,0x1,0x522ee58): stub 003e:fixme:wer:WerRegisterMemoryBlock (0x5418ebf0 6144) stub 003e:fixme:wer:WerRegisterMemoryBlock (0x5418ebe8 4) stub 003e:fixme:wincodecs:IMILUnknown2Impl_UnknownMethod1 (0x20c9f8,0x1,0x522edb0): stub 003e:fixme:wincodecs:IMILUnknown2Impl_UnknownMethod1 (0x20c9f8,0x1,0x522ed7c): stub 0042:fixme:ntdll:RtlGetUnloadEventTrace stub! 0042:fixme:thread:NtQueryInformationThread Cannot get kerneltime or usertime of other threads 0042:fixme:advapi:RegisterEventSourceW ((null),L".NET Runtime 2.0 Error Reporting"): stub 0042:fixme:advapi:ReportEventW (0xcafe4242,0x0001,0x0000,0x000003e8,(nil),0x0008,0x000000e6,0x3009b09c,0x6cda94): stub 0042:err:eventlog:ReportEventW L"reportersetup.exe" 0042:err:eventlog:ReportEventW L"4.4.7.639" 0042:err:eventlog:ReportEventW L"55e86c74" 0042:err:eventlog:ReportEventW L"unknown" 0042:err:eventlog:ReportEventW L"0.0.0.0" 0042:err:eventlog:ReportEventW L"00000000" 0042:err:eventlog:ReportEventW L"0" 0042:err:eventlog:ReportEventW L"7b94f390" 0042:fixme:advapi:DeregisterEventSource (0xcafe4242) stub --- snip ---
This is bug 34764 (".NET Framework 3.5 SP1 based WPF applications crash on direct access of MIL (Media Integration Layer) to internal bitmap struct/class impl (depends on exact layout)")
-> 'winetricks -q windowscodecs'
The WPF 3.x based installer also suffers from bug 34978 ("Many applications need a EnumDisplayDevicesW implementation for multi-monitor environment support (DisplayFusion, Turbo Tax 2012, WPF 4.x .NET apps, CEFv3 apps)")
Running the actual app after installation:
--- snip --- $ pwd /home/focht/.wine/drive_c/Program Files/Wizards of the Coast/Wizards Event Reporter
$ wine ./Reporter.exe ... 09:err:oledb:get_data_source provider L"Microsoft.Jet.OLEDB.4.0" not registered 0041:err:module:import_dll Library msjet40.dll (which is needed by L"C:\Program Files\Wizards of the Coast\Wizards Event Reporter\JETCOMP.exe") not found 0041:err:module:import_dll Library VBAJET32.dll (which is needed by L"C:\Program Files\Wizards of the Coast\Wizards Event Reporter\JETCOMP.exe") not found 0041:err:module:attach_dlls Importing dlls for L"C:\Program Files\Wizards of the Coast\Wizards Event Reporter\JETCOMP.exe" failed, status c0000135 0009:err:oledb:get_data_source provider L"Microsoft.Jet.OLEDB.4.0" not registered --- snip ---
-> 'winetricks -q jet40'
After this recipe the app still reports an error on startup: 'Parameter is not valid'. Fortunately I remembered this problem ... mentioned in https://bugs.winehq.org/show_bug.cgi?id=43408#c4
--- snip --- ... 004d:Call gdiplus.GdipLoadImageFromStream(05c00030,0033e460) ret=05c1b73b ... 004d:trace:gdiplus:initialize_decoder_wic 0x5c00030,{1b7cfaf4-713f-473c-bbcd-6137425faeaf} 004d:Call KERNEL32.LoadLibraryA(7d8fee10 "windowscodecs.dll") ret=7d8da1af ... 004d:Ret rpcrt4.NdrDllGetClassObject() retval=80040111 ret=530144f6 004d:err:ole:apartment_getclassobject DllGetClassObject returned error 0x80040154 ... 004d:err:ole:CoGetClassObject no class object {3692ca39-e082-4350-9e1f-3704cb083cd5} could be created for context 0x1 004d:Ret ole32.CoCreateInstance() retval=80040154 ret=5302d97b ... 004d:Ret gdiplus.GdipLoadImageFromStream() retval=00000001 ret=05c1b73b ... 004d:Call KERNEL32.GetProcAddress(7d880000,03c7cc32 "GdipGetImageRawFormat") ret=79171e1e 004d:Ret KERNEL32.GetProcAddress() retval=7d88d9b0 ret=79171e1e ... 004d:Call gdiplus.GdipGetImageRawFormat(00000000,0033eac4) ret=05c1d2b3 004d:trace:gdiplus:GdipGetImageRawFormat ((nil), 0x33eac4) 004d:Ret gdiplus.GdipGetImageRawFormat() retval=00000002 ret=05c1d2b3 --- snip ---
Native Windows Imaging Component (WIC) for Windows XP installed by 'winetricks' doesn't implement PNG gAMA metadata reader hence 'gdiplus' must be here native too.
https://msdn.microsoft.com/en-us/library/windows/desktop/dn280986(v=vs.85).a...
-> 'winetricks -q gdiplus'
After that the app finally starts successfully.
---
Coming back to the original problem ...
Unfortunately the original .NET 2.0 SP1 based version 4.1.x disappeared from the Internet. Fortunately I maintain a git-annex repository for all software/installers I investigate in bug reports for this exact reason. I still have the original version, fetched it from backup repo:
--- snip --- $ git annex get ReporterSetup.exe get ReporterSetup.exe (from backup...) SHA1E-s13692968--36a15e8bf2c9d1a1501fe3fd0844f695750e198c.exe 13,692,968 100% 96.50MB/s 0:00:00 (xfr#1, to-chk=0/1) (checksum...) ok (recording state in git...)
$ ll lrwxrwxrwx. 1 focht focht 151 Jun 1 2014 ReporterSetup.exe -> ../.git/annex/objects/Qw/GF/SHA1E-s13692968--36a15e8bf2c9d1a1501fe3fd0844f695750e198c.exe/SHA1E-s13692968--36a15e8bf2c9d1a1501fe3fd0844f695750e198c.exe --- snip ---
Still reproducible with Wine 3.13 and Wine-Staging 3.13 (same backtrace as initial report). I might look later at this again, low priority though.
$ wine --version wine-3.13
Regards
https://bugs.winehq.org/show_bug.cgi?id=36630
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |INVALID
--- Comment #3 from Anastasius Focht focht@gmx.net --- Hello folks,
after spending some more hours I came to conclusion this problem is actually an application bug (mistake in assembly signing process/obfuscator post-processing), exhibited with certain .NET Frameworks/service packs installed.
* .NET Framework 2.0 -> System.Security.SecurityException: Strong name validation failed. (Exception from HRESULT: 0x8013141A) * .NET Framework 2.0 SP1 -> System.Security.SecurityException: Strong name validation failed. (Exception from HRESULT: 0x8013141A) * .NET Framework 2.0 SP2 -> OK, application loads successfully * .NET Framework 3.0 -> System.Security.SecurityException: Strong name validation failed. (Exception from HRESULT: 0x8013141A) * .NET Framework 3.5 -> System.Security.SecurityException: Strong name validation failed. (Exception from HRESULT: 0x8013141A) * .NET Framework 3.5 SP1 -> OK, application loads successfully
The trace log/debugging doesn't show any suspicious behaviour when the public key/hash validation (advapi32/crypt32) is done, so the hash mismatch is indeed there.
https://www.codeguru.com/csharp/.net/net_general/article.php/c4643/Giving-a-...
http://www.grimes.nildram.co.uk/workshops/secWSThree.htm
The 2.0/3.0 CLR calls 'StrongNameSignatureVerification()' which fails, causing last error 0x8013141A being set, leading to C++/exception.
https://docs.microsoft.com/en-us/dotnet/framework/unmanaged-api/hosting/iclr...
(NOTE: this is doc for .NET 4.0 but it should be still applicable for old CLRs)
--- snip --- HRESULT StrongNameSignatureVerification ( [in] LPCWSTR wszFilePath, [in] DWORD dwInFlags, [out] DWORD *pdwOutFlags ); --- snip ---
The main exe is obfuscated using SmartAssembly 6.x. This likely has contributed here. I suspect a tooling problem with post-processing/delay-sign of assemblies.
Finally I found a hint for the inconsistent behaviour with different .NET CLRs here:
https://blogs.msdn.microsoft.com/shawnfa/2008/05/14/strong-name-bypass/
--- quote --- Many managed applications start up slower than they really need to because of time spent verifying their strong name signatures. For most of these applications, the strong name verification isn't buying the application anything - especially fully trusted desktop applications that are using C# as a better C++.
Since these applications were paying the cost of verifying their assemblies at load time, but were not receiving any benefit from that cost, we've made a change in .NET 3.5 SP1 which lets these applications bypass strong name signature verification.
Specifically, for any assembly which is:
Fully signed (delay signed assemblies still require a skip verification entry) Fully trusted (without considering its strong name evidence) Loaded into a Fully trusted AppDomain Loaded from a location under the AppDomain's ApplicationBase
The CLR will no longer verify the assembly's strong name when it is loaded. ... Also, if a machine administrator wants to disable strong name bypass for all assemblies loaded on a particular computer, they can set the DWORD registry value named AllowStrongNameBypass to 0 under the HKLM\Software\Microsoft.NETFramework key: --- quote ---
Indeed, if I disable the bypass using registry, the strong name validation error appears with newer .NET Frameworks/CLR versions too.
--- snip --- [HKEY_LOCAL_MACHINE\Software\Microsoft.NETFramework] "AllowStrongNameBypass"=dword:00000000 --- snip ---
IMHO the vendor never tested the app with older .NET Frameworks hence the StrongName mismatch was not caught. It seems the released version was very short lived/silently replaced by some newer fixed version.
Pity it took some efforts to figure that out. Resolving 'INVALID' here.
Regards
https://bugs.winehq.org/show_bug.cgi?id=36630
André H. nerv@dawncrow.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED CC| |nerv@dawncrow.de
--- Comment #4 from André H. nerv@dawncrow.de --- closing invalid
https://bugs.winehq.org/show_bug.cgi?id=36630
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- URL|http://webapp.wizards.com/D |https://web.archive.org/web |CIRUpdate/ReporterSetup.exe |/20120119001333/https://web | |app.wizards.com/DCIRUpdate/ | |ReporterSetup.exe