You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The stack trace metadata would likely only have information about the thunk, not about the the calling method.
So doing DiagnosticMethodInfo.Create(new StackFrame()) in a runtime async method will likely return no information. We need to swap IsAsyncCall bodies for thunks when emitting stack trace information.
Also figure out what CoreCLR does for new StackFrame(1) (i.e. asking for the thunk).
From @davidwr This is also an issue for the coreclr interpreter, as it needs a helper function, which is defined in C#, and there is no way to disable that either.
@VSadov This is also an issue for the coreclr interpreter, as it needs a helper function, which is defined in C#, and there is no way to disable that either. I don't think that this test is a good idea. We can fairly easily remove the thunks from the Exception ToString, etc, by using [StackTraceHidden], and I'll do that, but the StackFrame api doesn't have that flexibility.
System.AggregateException: One or more errors occurred. (Object reference not set to an instance of an object.)
---> System.NullReferenceException: Object reference not set to an instance of an object.
at Async2Reflection.FromStackDMIAsync(Int32)
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean)
at System.Threading.Tasks.Task`1.GetResultCore(Boolean)
at Async2Reflection.FromStackDMI(Int32)
Activity
dotnet-policy-service commentedon Dec 15, 2025
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas
See info in area-owners.md if you want to be subscribed.
MihuBot commentedon Dec 15, 2025
I'm a bot. Here is a possible related and/or duplicate issue (I may be wrong):
new StackTrace()inside async methods -> Useless, Lack of frames with sync caller method (initiator) #60764VSadov commentedon Dec 15, 2025
Seems like CoreCLR skips thunks. (skips resume stubs too). #122517 (comment)
davidwrighton commentedon Jan 6, 2026
@VSadov This is also an issue for the coreclr interpreter, as it needs a helper function, which is defined in C#, and there is no way to disable that either. I don't think that this test is a good idea. We can fairly easily remove the thunks from the Exception ToString, etc, by using [StackTraceHidden], and I'll do that, but the StackFrame api doesn't have that flexibility.
jkotas commentedon Feb 8, 2026
Fixed by #122722
MichalStrehovsky commentedon Mar 11, 2026
ActiveIssue wasn't removed from the test and the test is still failing: #125423. Reopening.
MichalStrehovsky commentedon Mar 11, 2026