Description
While implementing new feature for profiler I noticed a bug - DoStackSnapshot works within ELT hook for .NET 8 and .NET 9 but fails on .NET 10 with E_FAIL (0x80004005)
Reproduction Steps
- Profiler with ELT hooks that calls
DoStackSnapshot
- Run profiler with program whose
TargetFramework is set to net8.0 and net9.0 - this should work fine
- Run profiler with program whose
TargetFramework is set to net10.0 - this fails
Expected behavior
It should work on .NET 10 in the same way as for previous versions
Actual behavior
Fails for .NET 10, works for previous versions
Regression?
Yes
Known Workarounds
I made a quick test to unwind the native top frame using _Unwind_Backtrace. After that the DoStackSnapshot succeeds
Configuration
8.0.128 [/usr/lib/dotnet/sdk]
9.0.118 [/usr/lib/dotnet/sdk]
10.0.109 [/usr/lib/dotnet/sdk]
Linux version 6.17.0-40-generic (buildd@lcy02-amd64-101) (x86_64-linux-gnu-gcc (Ubuntu 15.2.0-4ubuntu4) 15.2.0, GNU ld (GNU Binutils for Ubuntu) 2.45) #40-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun 19 16:42:13 UTC 2026
- Architecture
- x64
- Though I don't think that these things are specific to my configuration / environment
Other information
I believe that this issue originates here: #107152. I am aware of the announced change that some APIs that were previously unsafe to call from hooks now return CORPROF_E_UNSUPPORTED_CALL_SEQUENCE. But I believe the issue I described here is different
Description
While implementing new feature for profiler I noticed a bug -
DoStackSnapshotworks within ELT hook for .NET 8 and .NET 9 but fails on .NET 10 withE_FAIL(0x80004005)Reproduction Steps
DoStackSnapshotTargetFrameworkis set tonet8.0andnet9.0- this should work fineTargetFrameworkis set tonet10.0- this failsExpected behavior
It should work on .NET 10 in the same way as for previous versions
Actual behavior
Fails for .NET 10, works for previous versions
Regression?
Yes
Known Workarounds
I made a quick test to unwind the native top frame using
_Unwind_Backtrace. After that theDoStackSnapshotsucceedsConfiguration
Other information
I believe that this issue originates here: #107152. I am aware of the announced change that some APIs that were previously unsafe to call from hooks now return
CORPROF_E_UNSUPPORTED_CALL_SEQUENCE. But I believe the issue I described here is different