`dotnet test` fails to launch `DumpMinitool*.exe` because it is a DLL - doesn't produce dump for process of different architecture
See original GitHub issueDescribe the bug
Running dotnet test
with hang dumps enabled does not create a dump for (child) processes that do not match the current architecture (for example, 64-bit testhost, test launches a 32-bit process).
To Reproduce
On Windows x64:
dotnet new xunit
- Add a test that launches a 32-bit process that will stay running:
[Fact]
public void LaunchX86()
{
using (Process p = Process.Start(@"C:\Windows\SysWOW64\notepad.exe"))
{
p.WaitForExit();
}
}
dotnet test --blame-hang-timeout 10s --diag:log.txt;tracelevel=verbose
Expected
Dump to be produced for both testhost
and notepad
Actual
No dump for notepad
From log.datacollector:
TpTrace Error: 0 : 19220, 12, 2022/05/13, 15:45:21.877, 2157168736492, datacollector.dll, WindowsHangDumper.Dump: Error dumping process 21596 - notepad: System.ComponentModel.Win32Exception (193): An error occurred trying to start process 'C:\Program Files\dotnet\sdk\7.0.100-preview.3.22179.4\Extensions\DumpMinitool.x86.exe' with working directory 'C:\Users\elfung\AppData\Local\Temp\dd4a4675-188b-417e-9a1d-5c4dc0bf6729'. The specified executable is not a valid application for this OS platform.
at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
at Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.ProcessHelper.<>c__DisplayClass1_0.<LaunchProcess>g__InitializeAndStart|0()
at Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.ProcessHelper.LaunchProcess(String processPath, String arguments, String workingDirectory, IDictionary`2 envVariables, Action`2 errorCallback, Action`1 exitCallBack, Action`2 outputCallBack)
at Microsoft.TestPlatform.Extensions.BlameDataCollector.WindowsHangDumper.CollectDump(Process process, String outputFile, DumpTypeOption type)
at Microsoft.TestPlatform.Extensions.BlameDataCollector.WindowsHangDumper.Dump(Int32 processId, String outputDirectory, DumpTypeOption type).
Further technical details
.NET SDK (reflecting any global.json):
Version: 7.0.100-preview.3.22179.4
Commit: c48f2c30ee
Runtime Environment:
OS Name: Windows
OS Version: 10.0.19044
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\7.0.100-preview.3.22179.4\
Apparently the DumpMinitool.x86.exe
that is installed is not an executable?
>dumpbin "C:\Program Files\dotnet\sdk\7.0.100-preview.3.22179.4\Extensions\DumpMinitool.x86.exe"
Microsoft (R) COFF/PE Dumper Version 14.33.31424.0
Copyright (C) Microsoft Corporation. All rights reserved.
Dump of file C:\Program Files\dotnet\sdk\7.0.100-preview.3.22179.4\Extensions\DumpMinitool.x86.exe
File Type: DLL
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:9 (9 by maintainers)
Top Results From Across the Web
Visual Studio unable to run .NET Core tests
This fixed it for me. I don't know why, but the Processor Architecture setting must have been reset when I reinstalled or upgraded...
Read more >dotnet-dump diagnostic tool - .NET CLI
The dotnet-dump global tool is a way to collect and analyze dumps on Windows, Linux, and macOS without any native debugger involved.
Read more >Self-Contained Single-File does not produce a single file
I have set it up to publish as a self-contained single-file. However, in the publish directory is the EXE file and four DLLs....
Read more >Use dump files in the debugger - Visual Studio (Windows)
A dump file is a snapshot that shows the process that was executing and modules that were loaded for an app at a...
Read more >Capture core crash dumps with createdump tool - ASP.NET ...
In this part, you'll learn how to capture a crash dump file by using createdump, and open the file in lldb to diagnose...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I believe @elinor-fung considered this but opted to report it here because when pulling down the assets from microsoft/vstest the binary is correct. Mentioned in https://github.com/dotnet/sdk/issues/25421#issuecomment-1126565424.
Fixed in both net7 and net6.0.400.