Skip to content
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

Assertion failed '!inTry || ((unsigned)(add->acdTryIndex - 1) != XTnum)' during 'Remove empty finally 2' #110346

Closed
MichalStrehovsky opened this issue Dec 3, 2024 · 3 comments · Fixed by #110374
Assignees
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI blocking-outerloop Blocking the 'runtime-coreclr outerloop' and 'runtime-libraries-coreclr outerloop' runs in-pr There is an active PR which will close this issue when it is merged
Milestone

Comments

@MichalStrehovsky
Copy link
Member

Seeing these failures in native AOT outerloop run at #110238.

Cc @AndyAyersMS in case this is related to #110273

@MichalStrehovsky MichalStrehovsky added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Dec 3, 2024
@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Dec 3, 2024
Copy link
Contributor

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

@AndyAyersMS
Copy link
Member

It almost certainly is related.

@AndyAyersMS AndyAyersMS self-assigned this Dec 3, 2024
@AndyAyersMS
Copy link
Member

If we remove a non-enclosing region we're not getting the ACD updates right.

---------------------------------------------------------------------------------------------------------------------------------------------------------------------
BBnum BBid ref try hnd preds           weight   [IL range]   [jump]                            [EH region]        [flags]
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
BB01 [0000]  1                             1    [000..027)-> BB02(1)                 (always)                     i hascall gcsafe newobj
BB02 [0035]  1  1    BB01                  1    [027..???)-> BB03(1)                 (always) T1      try {       keep internal ACD0
BB03 [0001]  2  1    BB10,BB02             8    [027..058)-> BB13(0.5),BB11(0.5)     ( cond ) T1                  i keep loophead bwd
BB04 [0020]  1  1    BB11                 32    [029..030)-> BB05(1)                 (always) T1                  i loophead idxlen bwd
BB05 [0003]  1  0    BB04                 16    [030..03A)-> BB10(1)                 (always) T0      try { }     i keep hascall gcsafe bwd
BB06 [0004]  1  1  0                       0    [03A..04D)-> BB08(0.5),BB07(0.5)     ( cond ) T1 H0   catch {     i rare keep hascall gcsafe idxlen newobj bwd ACD1
BB07 [0023]  1  1  0 BB06                  0    [04C..04D)-> BB09(1)                 (always) T1 H0               i rare idxlen bwd
BB08 [0024]  1  1  0 BB06                  0    [04C..04D)-> BB09(1)                 (always) T1 H0               i rare hascall gcsafe bwd
BB09 [0025]  2  1  0 BB07,BB08             0    [053..053)-> BB10(1)                 ( cret ) T1 H0   }           i rare newobj bwd
BB10 [0005]  2  1    BB05,BB09            32    [053..057)-> BB03(1)                 (always) T1                  i bwd
BB11 [0027]  1  1    BB03                  8    [029..058)-> BB04(0.5),BB12(0.5)     ( cond ) T1                  i bwd
BB12 [0019]  1  1    BB11                  0    [029..02A)                           (throw ) T1                  i rare hascall gcsafe bwd
BB13 [0028]  1  1    BB03                  1    [057..05F)-> BB14(1)                 (always) T1      }           i bwd
BB14 [0014]  1       BB13                  1    [061..074)-> BB17(1),BB16(0)         ( cond )                     i nullcheck
BB15 [0008]  1     1                       0    [061..06B)                           (falret)    H1   fault { }   i rare keep nullcheck
BB16 [0012]  1       BB14                  0    [074..07C)                           (throw )                     i rare hascall gcsafe
BB17 [0013]  1       BB14                  1    [07C..07D)                           (return)                     i
---------------------------------------------------------------------------------------------------------------------------------------------------------------------

In this case we're removing EH#1 as the try can't throw.

ACD1 is enclosed in H0 and T1; when we remove T1 we need to move ACD1 to H0 and (no enclosing try).

AndyAyersMS added a commit to AndyAyersMS/runtime that referenced this issue Dec 3, 2024
When an EH region is removed, the JIT must make suitable updates to
any existing AddCodeDescs (ACDs). We were missing logic for the case
where the removed region was not the enclosing region of the ACD.

Fixes dotnet#110346.

We still need to adjust the try/handler index
@dotnet-policy-service dotnet-policy-service bot added the in-pr There is an active PR which will close this issue when it is merged label Dec 3, 2024
@amanasifkhalid amanasifkhalid added blocking-outerloop Blocking the 'runtime-coreclr outerloop' and 'runtime-libraries-coreclr outerloop' runs and removed untriaged New issue has not been triaged by the area owner labels Dec 4, 2024
@amanasifkhalid amanasifkhalid added this to the 10.0.0 milestone Dec 4, 2024
AndyAyersMS added a commit that referenced this issue Dec 4, 2024
When an EH region is removed, the JIT must make suitable updates to
any existing AddCodeDescs (ACDs). We were missing logic for the case
where the removed region was not the enclosing region of the ACD.

Fixes #110346.
eduardo-vp pushed a commit to eduardo-vp/runtime that referenced this issue Dec 5, 2024
…t#110374)

When an EH region is removed, the JIT must make suitable updates to
any existing AddCodeDescs (ACDs). We were missing logic for the case
where the removed region was not the enclosing region of the ACD.

Fixes dotnet#110346.
mikelle-rogers pushed a commit to mikelle-rogers/runtime that referenced this issue Dec 10, 2024
…t#110374)

When an EH region is removed, the JIT must make suitable updates to
any existing AddCodeDescs (ACDs). We were missing logic for the case
where the removed region was not the enclosing region of the ACD.

Fixes dotnet#110346.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI blocking-outerloop Blocking the 'runtime-coreclr outerloop' and 'runtime-libraries-coreclr outerloop' runs in-pr There is an active PR which will close this issue when it is merged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants