Skip to content

Fix JSON crashinfo exception object address#96284

Merged
mikem8361 merged 2 commits into
dotnet:mainfrom
mikem8361:fixcrashinfo
Dec 23, 2023
Merged

Fix JSON crashinfo exception object address#96284
mikem8361 merged 2 commits into
dotnet:mainfrom
mikem8361:fixcrashinfo

Conversation

@mikem8361
Copy link
Copy Markdown
Contributor

The exception object address wasn't being render correctly in the JSON crash info.

@mikem8361 mikem8361 requested a review from jkotas December 22, 2023 19:19
@mikem8361 mikem8361 self-assigned this Dec 22, 2023
@ghost
Copy link
Copy Markdown

ghost commented Dec 22, 2023

Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas
See info in area-owners.md if you want to be subscribed.

Issue Details

The exception object address wasn't being render correctly in the JSON crash info.

Author: mikem8361
Assignees: mikem8361
Labels:

area-NativeAOT-coreclr

Milestone: -

Comment thread src/coreclr/nativeaot/System.Private.CoreLib/src/System/CrashInfo.cs Outdated
return false;

if (!WriteHexValue("address"u8, (ulong)Unsafe.AsPointer(ref exception)))
ulong address = Unsafe.As<Exception, nuint>(ref exception);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can the GC move the exception object between when we write this address in crashinfo and when the actual dump is generated?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it can. IIRC, it was discussed somewhere. It is not 100% reliable pattern.

The diagnostic stack likes to use it. Tracing uses in multiple places, e.g.

public unsafe void RunningContinuation(int TaskID, object Object) { RunningContinuation(TaskID, (long)*((void**)Unsafe.AsPointer(ref Object))); }
.

@github-actions github-actions Bot locked and limited conversation to collaborators Jan 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants