-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Store unhandled exception info on stack in Native AOT #84871
Conversation
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas Issue Detailsnull
|
src/coreclr/nativeaot/System.Private.CoreLib/src/System/RuntimeExceptionHelpers.cs
Outdated
Show resolved
Hide resolved
src/coreclr/nativeaot/System.Private.CoreLib/src/System/RuntimeExceptionHelpers.cs
Show resolved
Hide resolved
src/coreclr/nativeaot/System.Private.CoreLib/src/System/RuntimeExceptionHelpers.cs
Outdated
Show resolved
Hide resolved
src/coreclr/nativeaot/System.Private.CoreLib/src/System/RuntimeExceptionHelpers.cs
Show resolved
Hide resolved
Would it make sense to also dump the ToString for the innermost InnerException? I'm just thinking how this would look like for various async goo and chances are the 1024 bytes are going to get eaten by uninteresting stuff. Alternatively, would it make sense to call |
src/coreclr/nativeaot/System.Private.CoreLib/src/System/RuntimeExceptionHelpers.cs
Show resolved
Hide resolved
src/coreclr/nativeaot/System.Private.CoreLib/src/System/RuntimeExceptionHelpers.cs
Outdated
Show resolved
Hide resolved
@MichalStrehovsky What would you suggest for the inner exception info? Trying to concat both infos? Or just only store the inner exception if one exists? |
Ideally @tommcdon or @mikem8361 could guide us to what is more important from diagnostics perspective. We could have just the inner, or we could add another pointer in CrashDumpRecord that points to it. Right now, the Exception.ToString will have both stacks and both messages (unless someone overrode the ToString since we don't seal it) - it might get truncated, we don't know. It really depends on how structured the data should be. Whether a duplication would be okay. Whether we should only do it if there was truncation. Etc. It's why I asked for a "spec" on how this should look like. |
It is hard to judge what's more important. I think the best we can do here is to try to format the complete message if there is enough space. |
We have an upcoming .NET 8 backlog item on the diagnostics team to investigate what is needed to include an a Native AOT dump so that it is actionable. So I think it is a bit too soon for the diagnostics team to have a strong opinion on specific design details. Feel free to move forward with the change as we can make changes to the algorithm as needed. |
Anything else that I should do here? Or is this ready to go? |
src/coreclr/nativeaot/System.Private.CoreLib/src/System/RuntimeExceptionHelpers.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me (modulo a few cleanup nits). We can adjust the implementation as necessary in future.
Yup, I missed the remaining GetExceptionsForCurrentThread pieces. Should be gone now. |
/azp run runtime-extra-platforms |
Azure Pipelines successfully started running 1 pipeline(s). |
Test failures look unrelated. |
Allocates a span on the stack to hold the
ToString
of the exception, as well as a CrashRecord which contains a unique cookie that can be used to find the exception info.Fixes #84636