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 'block->bbCodeOffs <= succBlock->bbCodeOffs' #88348

Closed
BruceForstall opened this issue Jul 3, 2023 · 4 comments · Fixed by #89179
Closed

Assertion failed 'block->bbCodeOffs <= succBlock->bbCodeOffs' #88348

BruceForstall opened this issue Jul 3, 2023 · 4 comments · Fixed by #89179
Assignees
Labels
arch-x86 area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI blocking-clean-ci-optional Blocking optional rolling runs in-pr There is an active PR which will close this issue when it is merged JitStress CLR JIT issues involving JIT internal stress modes Known Build Error Use this to report build issues in the .NET Helix tab os-windows
Milestone

Comments

@BruceForstall
Copy link
Member

BruceForstall commented Jul 3, 2023

runtime-coreclr libraries-jitstress-random
net8.0-windows-Release-x86-CoreCLR_checked-jitstress_random_1-Windows.10.Amd64.Open

https://dev.azure.com/dnceng-public/public/_build/results?buildId=327184&view=ms.vss-test-web.build-test-results-tab&runId=6736812&paneView=debug

C:\h\w\B0A1094C\w\BA9809B2\e>set DOTNET 
DOTNET_JitStress=3e6
DOTNET_TieredCompilation=0

C:\h\w\B0A1094C\w\BA9809B2\e>call RunTests.cmd --runtime-path C:\h\w\B0A1094C\p 
----- start Sat 07/01/2023  2:09:39.45 ===============  To repro directly: =====================================================
pushd C:\h\w\B0A1094C\w\BA9809B2\e\
"C:\h\w\B0A1094C\p\dotnet.exe" exec --runtimeconfig Microsoft.Extensions.Logging.Tests.runtimeconfig.json --depsfile Microsoft.Extensions.Logging.Tests.deps.json xunit.console.dll Microsoft.Extensions.Logging.Tests.dll -xml testResults.xml -nologo -nocolor -notrait category=IgnoreForCI -notrait category=OuterLoop -notrait category=failing 
popd
===========================================================================================================

C:\h\w\B0A1094C\w\BA9809B2\e>"C:\h\w\B0A1094C\p\dotnet.exe" exec --runtimeconfig Microsoft.Extensions.Logging.Tests.runtimeconfig.json --depsfile Microsoft.Extensions.Logging.Tests.deps.json xunit.console.dll Microsoft.Extensions.Logging.Tests.dll -xml testResults.xml -nologo -nocolor -notrait category=IgnoreForCI -notrait category=OuterLoop -notrait category=failing  
  Discovering: Microsoft.Extensions.Logging.Tests (method display = ClassAndMethod, method display options = None)
  Discovered:  Microsoft.Extensions.Logging.Tests (found 136 test cases)
  Starting:    Microsoft.Extensions.Logging.Tests (parallel test collections = on, max threads = 4)
Message1
:
testKey3:testValue, testKey2:, testKey1:

Assert failure(PID 1300 [0x00000514], Thread: 1288 [0x0508]): Assertion failed 'block->bbCodeOffs <= succBlock->bbCodeOffs' in 'Microsoft.Extensions.Logging.LoggerMessage+LogValues`5+<GetEnumerator>d__14[System.__Canon,System.__Canon,System.__Canon,System.__Canon,System.__Canon]:MoveNext():bool:this' during 'Global local var liveness' (IL size 108; hash 0x7844847c; FullOpts)

    File: D:\a\_work\1\s\src\coreclr\jit\fgbasic.cpp Line: 5196
    Image: C:\h\w\B0A1094C\p\dotnet.exe

----- end Sat 07/01/2023  2:10:05.38 ----- exit code -1073740286 ----------------------------------------------------------

Known Issue Error Message

Fill the error message using step by step known issues guidance.

{
  "ErrorMessage": "Assertion failed 'block->bbCodeOffs <= succBlock->bbCodeOffs'",
  "ErrorPattern": "",
  "BuildRetry": false,
  "ExcludeConsoleLog": false
}

Known issue validation

Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=327184
Error message validated: Assertion failed 'block->bbCodeOffs <= succBlock->bbCodeOffs'
Result validation: ✅ Known issue matched with the provided build.
Validation performed at: 7/4/2023 1:24:51 AM UTC

Report

Build Definition Test Pull Request
327184 dotnet/runtime Microsoft.Extensions.Logging.Tests.WorkItemExecution

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
0 0 1
@BruceForstall BruceForstall added arch-x86 os-windows JitStress CLR JIT issues involving JIT internal stress modes area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI labels Jul 3, 2023
@BruceForstall BruceForstall added this to the 8.0.0 milestone Jul 3, 2023
@ghost
Copy link

ghost commented Jul 3, 2023

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

Issue Details

runtime-coreclr libraries-jitstress-random
net8.0-windows-Release-x86-CoreCLR_checked-jitstress_random_1-Windows.10.Amd64.Open

https://dev.azure.com/dnceng-public/public/_build/results?buildId=327184&view=ms.vss-test-web.build-test-results-tab&runId=6736812&paneView=debug

C:\h\w\B0A1094C\w\BA9809B2\e>set DOTNET 
DOTNET_JitStress=3e6
DOTNET_TieredCompilation=0

C:\h\w\B0A1094C\w\BA9809B2\e>call RunTests.cmd --runtime-path C:\h\w\B0A1094C\p 
----- start Sat 07/01/2023  2:09:39.45 ===============  To repro directly: =====================================================
pushd C:\h\w\B0A1094C\w\BA9809B2\e\
"C:\h\w\B0A1094C\p\dotnet.exe" exec --runtimeconfig Microsoft.Extensions.Logging.Tests.runtimeconfig.json --depsfile Microsoft.Extensions.Logging.Tests.deps.json xunit.console.dll Microsoft.Extensions.Logging.Tests.dll -xml testResults.xml -nologo -nocolor -notrait category=IgnoreForCI -notrait category=OuterLoop -notrait category=failing 
popd
===========================================================================================================

C:\h\w\B0A1094C\w\BA9809B2\e>"C:\h\w\B0A1094C\p\dotnet.exe" exec --runtimeconfig Microsoft.Extensions.Logging.Tests.runtimeconfig.json --depsfile Microsoft.Extensions.Logging.Tests.deps.json xunit.console.dll Microsoft.Extensions.Logging.Tests.dll -xml testResults.xml -nologo -nocolor -notrait category=IgnoreForCI -notrait category=OuterLoop -notrait category=failing  
  Discovering: Microsoft.Extensions.Logging.Tests (method display = ClassAndMethod, method display options = None)
  Discovered:  Microsoft.Extensions.Logging.Tests (found 136 test cases)
  Starting:    Microsoft.Extensions.Logging.Tests (parallel test collections = on, max threads = 4)
Message1
:
testKey3:testValue, testKey2:, testKey1:

Assert failure(PID 1300 [0x00000514], Thread: 1288 [0x0508]): Assertion failed 'block->bbCodeOffs <= succBlock->bbCodeOffs' in 'Microsoft.Extensions.Logging.LoggerMessage+LogValues`5+<GetEnumerator>d__14[System.__Canon,System.__Canon,System.__Canon,System.__Canon,System.__Canon]:MoveNext():bool:this' during 'Global local var liveness' (IL size 108; hash 0x7844847c; FullOpts)

    File: D:\a\_work\1\s\src\coreclr\jit\fgbasic.cpp Line: 5196
    Image: C:\h\w\B0A1094C\p\dotnet.exe

----- end Sat 07/01/2023  2:10:05.38 ----- exit code -1073740286 ----------------------------------------------------------
Author: BruceForstall
Assignees: -
Labels:

arch-x86, os-windows, JitStress, area-CodeGen-coreclr

Milestone: 8.0.0

@BruceForstall BruceForstall added the blocking-clean-ci-optional Blocking optional rolling runs label Jul 3, 2023
@hoyosjs hoyosjs added Known Build Error Use this to report build issues in the .NET Helix tab blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' labels Jul 4, 2023
@jakobbotsch jakobbotsch removed the blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' label Jul 18, 2023
@jakobbotsch
Copy link
Member

@hoyosjs I assume it was an oversight to mark this as blocking-clean-ci? This test only fails libraries-jitstress-random as far as I can see.

@jakobbotsch
Copy link
Member

Seems like fgSplitBlockAfterNode is able to create some odd IL ranges:

*************** Starting PHASE Expand runtime lookups
Expanding runtime lookup for [000121] in BB04:
N004 ( 18, 13) [000121] --C-GO-----CALL help int    CORINFO_HELP_RUNTIMEHANDLE_CLASS $207
N002 (  3,  2) [000122] #----O----- arg0 in ecx             ├──▌  IND       int    $205
N001 (  1,  1) [000123] !----------                         │  └──▌  LCL_VAR   ref    V00 this         u:1 $80
N003 (  1,  4) [000124] H------N--- arg1 in edx             └──▌  CNS_INT(h) int    0x11C2DF04 global ptr $182


lvaGrabTemp returning 8 (V08 rat0) called for Spilling to split statement for tree.
Splitting BB04 after statement STMT00025
New Basic Block BB08 [0010] created.

...

-----------------------------------------------------------------------------------------------------------------------------------------
BBnum BBid ref try hnd preds           weight   IBC  lp [IL range]     [jump]      [EH region]         [flags]
-----------------------------------------------------------------------------------------------------------------------------------------
...
BB08 [0010]  2       BB10,BB11             3.60  18    [057..020)                                     i hascall nullcheck IBC 
...

@jakobbotsch
Copy link
Member

Through loop inversion and FG optimizations we end up with

STMT00019 ( 0x057[E-] ... ??? )

inside BB04 that has IL ranges [010..020). fgSplitBlockAfterStatement can end up creating these meaningless IL ranges in this case. I will just add some simple clamping to fgSplitBlockAfterStatement.

jakobbotsch added a commit to jakobbotsch/runtime that referenced this issue Jul 19, 2023
In release, code motion/compaction may lead to statements ending up in
blocks that don't contain their IL offset. This can cause splitting of
blocks to create meaningless IL ranges such as [057..020). Since we
maintain these IL ranges on a best-effort basis, just clamp them when we
do the splitting.

Fix dotnet#88348
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Jul 19, 2023
jakobbotsch added a commit that referenced this issue Jul 19, 2023
In release, code motion/compaction may lead to statements ending up in
blocks that don't contain their IL offset. This can cause splitting of
blocks to create meaningless IL ranges such as [057..020). Since we
maintain these IL ranges on a best-effort basis, just clamp them when we
do the splitting.

Fix #88348
@ghost ghost locked as resolved and limited conversation to collaborators Aug 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-x86 area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI blocking-clean-ci-optional Blocking optional rolling runs in-pr There is an active PR which will close this issue when it is merged JitStress CLR JIT issues involving JIT internal stress modes Known Build Error Use this to report build issues in the .NET Helix tab os-windows
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants