Repository navigation
Unskip NestedCatch_DuplicateLocal_Level2 #132016
Copy link
Copy link
Labels
area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMICLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Milestone
Description
Activity
his appears to be a runtime-async bug in .NET 11 Preview 6. I reduced the test to the following file-based app:
#:property Features=runtime-async=on #:property LangVersion=preview #:property Optimize=true #:property NoWarn=SYSLIB5007;CA2252 using System; using System.Threading.Tasks; Test.Run(); class Test { public static void Run() { new Test().M().GetAwaiter().GetResult(); } static bool Filter(Exception ex, bool result) { Console.WriteLine(ex.Message); return result; } async Task M() { try { throw new Exception("outer"); } catch (Exception ex) when (Filter(ex, false)) { await Print(ex); } catch (Exception ex) when (Filter(ex, true)) { try { throw new Exception("inner"); } catch (Exception ex2) when (Filter(ex2, false)) { await Print(ex); await Print(ex2); } catch (Exception ex2) when (Filter(ex2, true)) { try { throw new Exception(); } catch { await Print(ex); await Print(ex2); } } } } static async Task Print(Exception ex) { await Task.Yield(); Console.WriteLine(ex.Message); } }
With
global.jsonpinned to SDK10.0.301, this exits successfully:$ DOTNET_RuntimeAsync=1 dotnet run 84791.cs outer outer inner inner outer inner
With
global.jsonpinned to SDK11.0.100-preview.6.26359.118, the same command fails because the second captured exception becomesnull:$ dotnet run 84791.cs outer outer inner inner outer Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object. at Test.Print(Exception ex) in 84791.cs:line 63 at Test.M() in 84791.cs:line 54
This comment was generated by AI.
- addedarea-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMICLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
on Aug 7, 2026 - addeduntriagedNew issue has not been triaged by the area ownerNew issue has not been triaged by the area owner
on Aug 7, 2026 dotnet-policy-service commented
on Aug 7, 2026 ContributorMore actionsTagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.- removeduntriagedNew issue has not been triaged by the area ownerNew issue has not been triaged by the area owner
on Aug 7, 2026 - locked and limited conversation to collaborators
on Sep 10, 2026
Metadata
Metadata
Assignees
Labels
area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMICLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
In the move from running against .NET 10 to .NET 11 preview, the following async runtime test failure was encountered:
CodeGenAsyncEHTests.NestedCatch_DuplicateLocal_Level2