Open danmoseley opened 3 years ago
Tagging subscribers to this area: See info in area-owners.md if you want to be subscribed.
Author: | danmoseley |
---|---|
Assignees: | - |
Labels: | `area-VM-meta-mono`, `os-maccatalyst` |
Milestone: | - |
cc @dotnet/ncl but there's really no way to know if it's networking code.
I see Environment.FailFast("Exception thrown from SocketAsyncEngine event loop: " + e.ToString(), e);
but that's on a thread, not threadpool.
also unclear, perhaps @mdh1418 can help, why the dump wasn't uploaded here. it seems to find dumps (a lot actually)
@danmoseley I don't think this has anything to do w/ managed code. System.Net.Requests.Tests is part of a handful of suites that are crashing for us on CI only. We're still trying to figure out why.
@steveisok could you clarify what you mean - do you mean, there was indeed FailFast from managed, but a subsequent unrelated issue in the native side prevented the nice message from showing up?
Or that the FailFast shown in the managed frame is not real? I assume the former as there is a real FailFast in that method IIRC.
Yeah, I suspect it's probably an unrelated issue on the native side.
Hey folks, regardless of where the issue comes from, I think the question is: When there is a FailFast, can we include the managed message in the output that is emitted along with the stack traces etc.
The complication is that the output is not, I think, controlled by the runtime - it's macOS that is printing out all this stuff:
Crashed Thread: 21 .NET ThreadPool Worker
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Application Specific Information:
...
I don't know of a way to modify the information that is printed out. Does CoreCLR do something? Maybe there is some syscall we need to use?
As far as the managed FailFast message we can certainly capture it - we used to do it for Mono MERP. I just don't know if we can display it inline with the OS crash output.
@janvorli maybe you know?
CoreCLR doesn't do anything to get a message into the system crashlog. We just print it to stderr. I haven't tried to look at the possibility of adding own message into the crashlog, but it would be really nice to have that. I'll try to check if there is any way to do so.
@tommcdon this is the case I was mentioning, where Mono writes out a crash file with basic diagnostics that does not need any tooling to look at. I believe it's aggregating info from macOS in this case.
I wonder whether there is value in CoreCLR doing something like this. (I'll suggest it in your OneNote)
@janvorli did you get a chance to look into whether we can get the failfast string into it? But, as @lambdageek mentions, maybe that doesn't matter, if Mono puts it in the crash file by some other means. (I do'nt know where else macOS puts these -- in the system log?)
@tommcdon this is the case I was mentioning, where Mono writes out a crash file with basic diagnostics that does not need any tooling to look at. I believe it's aggregating info from macOS in this case.
@mikem8361 recently added support for JSON file output on Mac. I believe it is enabled with the COMPlus_EnableCrashReport env variable. It seems like we should enable this in CI if not already doing so. cc @hoyosjs
If you have any questions about the crash report json support in createdump, let me know. Like Tom said it is enabled with the above env var and writes the json file with the coredump name + ".crashreport.json". It does contain the signal name for the faulting thread and the managed exception type name for any unhandled managed exception.
@lambdageek, @danmoseley I have believed there is no way to include a custom message in the crash log, but today I looked again and found this on stackoverflow (https://stackoverflow.com/questions/36827239/xcode-exception-reason-of-crash-report-from-apples-crash-report-service)
On OSX developers can provide an annotation before an app (possibly) crashes using the global
__crashreporter_info__
declared like this to be accessible.const char *__crashreporter_info__ = NULL; asm(".desc ___crashreporter_info__, 0x10");
It should appear in the Application Specific Information:
section of the log.
This look actually quite ancient and it doesn't seem to work. There is a more modern version that can log stack trace separately: https://alastairs-place.net/blog/2013/01/10/interesting-os-x-crash-report-tidbits/ There is an example at the end that worked.
The downside though is that this is an undocumented feature.
This is excellent detective work @janvorli, it's great to see that this works on ios, too.
@steveisok I think this will help with CI, but also possibly it will be useful for customers
Tagging subscribers to 'os-ios': @steveisok, @akoeplinger, @kotlarmilos See info in area-owners.md if you want to be subscribed.
Author: | danmoseley |
---|---|
Assignees: | janvorli |
Labels: | `area-VM-meta-mono`, `os-ios`, `os-maccatalyst` |
Milestone: | 9.0.0 |
The downside though is that this is an undocumented feature.
Swift also defines this struct so it should be quite safe to use:
net6.0-MacCatalyst-Release-x64-Mono_Release-OSX.1015.Amd64.Open System.Net.Requests.Tests work item
Probably non actionable as is, but what does the managed code look like here? did someone queue FailFast onto the threadpool?
More importantly, can Mono folks detect abort() and include the raw string message in the ".crash" file? that would help a lot.
https://dev.azure.com/dnceng/public/_build/results?buildId=1313534&view=ms.vss-test-web.build-test-results-tab&runId=38657398&paneView=debug
@lambdageek ?