-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dotnet test --blame-crash
collects crash DMP even after successful test runs
#14578
Comments
@nohwnd noticed that this only happens when the tests run on runtimes before .NET 5.0. But since nearly everyone targets less than .NET 5.0 at this point, that seems like a crucial scenario to test and support. |
Just to be clear about the impact of this bug, when a pipeline is carefully written to collect crash dumps so that any test failures can be investigated, having a dump unnecessarily created ends up getting collected as an artifact, which slows down the pipeline and greatly swells the storage requirements for that cloud build account. The below screenshot shows how Windows agents (the only OS that supports dumps) collect nearly 1GB of dmp's vs. a few KB of files from the non-Windows agents where no dmp file creation bug exists: |
Thanks, @nohwnd. But it's still broken. Now instead of collecting dumps from every run (successful or not), it never collects dumps. .NET 5.0 works fine as was the case before. But <.NET 5.0 test runs now never collect crash dumps. |
This because of dotnet/sdk#14578 collecting dozens of DMP files totalling 3GB of unnecessary DMP files as pipeline artifacts.
This because of dotnet/sdk#14578 collecting dozens of DMP files totalling 3GB of unnecessary DMP files as pipeline artifacts.
This because of dotnet/sdk#14578 collecting dozens of DMP files totalling 3GB of unnecessary DMP files as pipeline artifacts.
@AArnott I tried it locally and it collected dumps even on versions that are not net5.0. Could you run the pipeline again please so I can see where it does not work? The build you linked above does not exist anymore. Thanks. |
I have a whole suite of tests, I will re-run then tomorrow on the newest version to see if I can repro. I am back after a month, so I only quickly tried it so far. Hopefully I will be able to fix this soon. |
@nohwnd the problem is not that dumps are not collected. The problem is that they are collected even when no test failure occurred. |
Here you said that it no longer collects them, so that is what I wondered about. The build is unfortunately gone. |
Well, I guess it's been too long and I don't remember the history exactly. |
I still see "Build not found" on the latest link you posted. Do I need special permissions? I've updated my tests and re-run them on Windows, Mac and Ubuntu and they show that the dumps are collected and that no dump is collected when there is no crash. According to my tests it works on 5.0.101 and 5.0.200-preview, and the tests fail on 5.0.100 which does not have the fix. https://dev.azure.com/jajares/blame/_build/results?buildId=262&view=results Looking forward to seeing your build, maybe there are more issues that my tests don't identify. |
No. I can even view it in an InPrivate window with no cookies. Are you sure you're using the link from my message I posted yesterday? I did not update the original link If you still cannot view it, you can perhaps try looking at the commit being built or even build it yourself. It's a YAML pipeline so it should be trivial to set up. |
I don't know what I did wrong. I can see your build now. The problem is that procdump is configured to only catch stack overflow and access violation, but you are killing the process via Environment.FailFast. If you force stack overflow (e.g. by calling itself in the test method: @ShreyasRmsft do you remember why you did it this way please? ( As a side note even without the filter, FailFast won't trigger dump creation in ProcDump. ) |
@nohwnd that was before my time when blame was implemented for crash dumps only. I think Environment.FailFast was simply not a scenario at that time. |
@nohwnd If you notice the artifacts collected in the pipeline, only one of the 4 test runs collected a DMP, even though they all used FailFast. Looking at the logs reveals that it was the net5.0 test run that collected the dump. Why the difference in behavior between runtimes? I ran a series of tests with each SDK version. Here are the results (all on Windows agents), where ❌ means no dump collected and ✅ means a dump was collected. SDK 3.1.404
SDK 5.0.102
Notice that new to the 5.0 SDK, the netcoreapp3.1 runtime (and net5.0 runtime) collect 3 dumps for one crash. Why is that? SDK 5.0.200-preview.20601.7
AnalysisApparently the 5.0.200-preview named above did not change behavior relevant to this bug. The regressions in the .NET 5 SDK are:
Can we get an update on when/whether these are bugs and when we can expect them to be fixed? |
This is blocking our adequate testing of CsWin32 (we don't test on net472 any more) and led to shipping a major regression. Can we please get traction on this? |
Let's see if I can revert that behavior without returning dumps that were collected on successful runs. |
I generally try to avoid preview SDKs for production repos, but I'm happy to at least try it to validate. And for this CsWin32 repo in particular I think we can take a dependency on the preview SDK. I'm a little confused as to which fixes are already in the 6.0 SDK and which ones you're still working on. Should I wait for all fixes before trying it out? |
|
was this fixed yet? |
@AArnott could you upgrade your pipeline to net6 SDK and run it again please? |
The repo has been updated to 6.0. The |
This is good to know, thanks for checking. |
Great! |
⚠ This is a regression in the .NET 5 SDK and blocks adoption of the .NET 5 SDK by this template repo and others.
When running
dotnet test --blame-crash
, a dmp file is produced at the conclusion of each test run even though no crash or timeout occurred.Repro steps
Observed output is below. Notice lines such as:
The text was updated successfully, but these errors were encountered: