Skip to content
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

Blame fixes #3028

Merged
merged 3 commits into from
Sep 8, 2021
Merged

Blame fixes #3028

merged 3 commits into from
Sep 8, 2021

Conversation

nohwnd
Copy link
Member

@nohwnd nohwnd commented Sep 1, 2021

Description

Fix few issues with Blame collector.

  1. Crash collector was catching FailFast because in the past it was done by always collecting the dump, and only sending it back when user enabled AlwaysCollect. With the new approach where crashes can produce multiple dumps, including dumps from child processes we can't really tell if the process crashed or exited normally. So I am using the test count to determine if the testhost crashed while executing tests. It would definitely be nicer to get a message with the actual exit status after testhost exits, but that would mean extending the IDataCollector interface, which needs to be done with a bit more thinking.

The native .NET Crash monitor still don't seem to catch FailFast, but there is internal option VSTEST_DUMP_FORCEPROCDUMP=1 that forces the use of ProcDump even where the built it net dump would be used.

  1. This now also applies the hang dumps, because on some systems the PInvoke I do to not need ProcDump throws AccessViolationException, so this is a way to force that to use ProcDump.

  2. There is also VSTEST_DUMP_FORCENETDUMP=1 internal option which is forcing the net dumper to be used on Windows so we can test it a bit better.

  3. I also added VSTEST_DUMP_PROCDUMPARGUMENTS and VSTEST_DUMP_PROCDUMPADDITIONALARGUMENTS internal option to fully or partially override what arguments procdump will use, because I found it quite useful when debugging crashes. And there is sadly no way to collect both "managed" and "native" dumps at the same time. So when I can't really see the crash I need to change how proc dump runs a lot.

Not sure how to fix this properly without relying on those internal env variables to set the dumpers. Maybe I could try looking if procdump can be found when on windows and try using that, otherwise try the other dumpers based on the platform.

Related issue

Workaround for #3005 by using VSTEST_DUMP_FORCEPROCDUMP=1
Workaround for dotnet/sdk#14578 (comment) also by using VSTEST_DUMP_FORCEPROCDUMP=1

Easiest way to install procdump is by using this task: https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/test/vstest?view=azure-devops

Easiest way to deploy latest version of TestPlatform is by using this task: https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/tool/vstest-platform-tool-installer?view=azure-devops

@nohwnd
Copy link
Member Author

nohwnd commented Sep 1, 2021

@AArnott This should be fast way for us to test this against your repo, once this is merged it can be installed from the nuget package and used. This will help us see if it solves the problem. Unfortunately there are no universal settings that would catch all possible exceptions reliably.

/fyi @KirillOsenkov the fight with dump collection continues.

@nohwnd
Copy link
Member Author

nohwnd commented Sep 1, 2021

The native .NET Crash monitor still don't seem to catch FailFast,

Actually it catches it when I run on net6, and net5, in a console app. Will have to test again, and codify that into my pipeline. Because there are more and more scenarios. 😁

@AArnott
Copy link
Member

AArnott commented Sep 1, 2021

I'm happy to test when you have a package for me.

@nohwnd nohwnd enabled auto-merge (squash) September 7, 2021 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants