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
{{ message }}
Repository navigation
ARM64 CG2 compilation of System.Text.Json crashes on JIT assert 'block->bbWeight > BB_ZERO_WEIGHT' #52785
FWIW, on OSX ARM64 there's another non-deterministic issue, the CG2 compiler sometimes crashes on a nullref when internally sorting dependency nodes; that is demonstrated in the OSX arm64 leg of the same run as quoted in the title:
Unhandled exception. 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 ILCompiler.Sorting.Implementation.MergeSortCore`5.ParallelSort(TDataStructure arrayToSort, Int32 index, Int32 length, TComparer comparer)
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at ILCompiler.Sorting.Implementation.MergeSortCore`5.ParallelSortApi(TDataStructure arrayToSort, TComparer comparer)
at ILCompiler.MetadataManager.GetCompiledMethods(EcmaModule moduleToEnumerate, CompiledMethodCategory methodCategory)
at ILCompiler.DependencyAnalysis.NodeFactory.EnumerateCompiledMethods(EcmaModule moduleToEnumerate, CompiledMethodCategory methodCategory)+MoveNext()
at ILCompiler.DependencyAnalysis.ReadyToRun.ExceptionInfoLookupTableNode.LayoutMethodsWithEHInfo()
at ILCompiler.DependencyAnalysis.ReadyToRun.ExceptionInfoLookupTableNode.ShouldSkipEmittingObjectNode(NodeFactory factory)
at ILCompiler.DependencyAnalysis.ReadyToRun.HeaderNode.GetData(NodeFactory factory, Boolean relocsOnly)
at ILCompiler.DependencyAnalysis.ReadyToRunObjectWriter.EmitPortableExecutable()
at ILCompiler.ReadyToRunCodegenCompilation.Compile(String outputFile)
at ILCompiler.Program.RunSingleCompilation(Dictionary`2 inFilePaths, InstructionSetSupport instructionSetSupport, String compositeRootPath, Dictionary`2 unrootedInputFilePaths, HashSet`1 versionBubbleModulesHash, CompilerTypeSystemContext typeSystemContext)
at ILCompiler.Program.Run(String[] args)
at ILCompiler.Program.Main(String[] args)
Root cause seems to be upstream, when we compute edge weights we're willing to set a min edge weight to something below zero (and root cause of that is inconsistent profile data, which we have to tolerate).
Activity
mangod9 commentedon May 14, 2021
assume this is a recent regression?
trylek commentedon May 14, 2021
FWIW, on OSX ARM64 there's another non-deterministic issue, the CG2 compiler sometimes crashes on a nullref when internally sorting dependency nodes; that is demonstrated in the OSX arm64 leg of the same run as quoted in the title:
Unhandled exception. 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 ILCompiler.Sorting.Implementation.MergeSortCore`5.ParallelSort(TDataStructure arrayToSort, Int32 index, Int32 length, TComparer comparer) --- End of inner exception stack trace --- at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) at ILCompiler.Sorting.Implementation.MergeSortCore`5.ParallelSortApi(TDataStructure arrayToSort, TComparer comparer) at ILCompiler.MetadataManager.GetCompiledMethods(EcmaModule moduleToEnumerate, CompiledMethodCategory methodCategory) at ILCompiler.DependencyAnalysis.NodeFactory.EnumerateCompiledMethods(EcmaModule moduleToEnumerate, CompiledMethodCategory methodCategory)+MoveNext() at ILCompiler.DependencyAnalysis.ReadyToRun.ExceptionInfoLookupTableNode.LayoutMethodsWithEHInfo() at ILCompiler.DependencyAnalysis.ReadyToRun.ExceptionInfoLookupTableNode.ShouldSkipEmittingObjectNode(NodeFactory factory) at ILCompiler.DependencyAnalysis.ReadyToRun.HeaderNode.GetData(NodeFactory factory, Boolean relocsOnly) at ILCompiler.DependencyAnalysis.ReadyToRunObjectWriter.EmitPortableExecutable() at ILCompiler.ReadyToRunCodegenCompilation.Compile(String outputFile) at ILCompiler.Program.RunSingleCompilation(Dictionary`2 inFilePaths, InstructionSetSupport instructionSetSupport, String compositeRootPath, Dictionary`2 unrootedInputFilePaths, HashSet`1 versionBubbleModulesHash, CompilerTypeSystemContext typeSystemContext) at ILCompiler.Program.Run(String[] args) at ILCompiler.Program.Main(String[] args)mangod9 commentedon May 14, 2021
I think the osx arm64
NREfailure is a known issue with the runtime, not specifically related to cg2 itself.trylek commentedon May 14, 2021
I see the first repro of the OSX arm64 bug in Steve MacLean's run from May 5 (last Wednesday):
https://dev.azure.com/dnceng/public/_build/results?buildId=1124050&view=ms.vss-test-web.build-test-results-tab&runId=34195084&resultId=100691&paneView=debug
I'm looking for the first occurrence of the Windows bug.
trylek commentedon May 14, 2021
OK, so I see the first occurrence of the Windows bug in @BruceForstall's run from May 6:
https://dev.azure.com/dnceng/public/_build/results?buildId=1127214&view=results
davidwrighton commentedon May 14, 2021
@AndyAyersMS is the expert for issues with basic block weight.
AndyAyersMS commentedon May 17, 2021
I'll take a look at the windows arm64 failure.
AndyAyersMS commentedon May 18, 2021
We end up with a negative block count and that leads to the assert. Suspect the issue is in
fgConnectFallThrough.AndyAyersMS commentedon May 18, 2021
Root cause seems to be upstream, when we compute edge weights we're willing to set a min edge weight to something below zero (and root cause of that is inconsistent profile data, which we have to tolerate).
JIT: don't allow negative edge weights (#52884)
AndyAyersMS commentedon May 21, 2021
@trylek can you verify this is now fixed?
trylek commentedon May 21, 2021
Sorry for the late response. Thank you for fixing the failure in System.Text.Json, I confirm we're no longer hitting it, e.g. in this recent CG2 run:
https://dev.azure.com/dnceng/public/_build/results?buildId=1147260&view=logs&j=438f2a33-0bac-577f-c1e5-b7956f9ac284&t=437a67a3-60d6-56bd-4640-6cece310571b
Instead of the original failure, all arm64 builds and Windows x64 builds are now failing in System.IO.Compression with another JIT assert:
This seems to be the tracking bug for the remaining issue: #33091
AndyAyersMS commentedon May 21, 2021
Let me see what's up with that new failure... I have a hunch it may be related to #52524.
AndyAyersMS commentedon May 21, 2021
Nope, the problem is caused by my change #52827. Seems like it should be easy to fix.
JIT: fix relop flags for peeled switch compare
trylek commentedon May 21, 2021
Awesome, thanks for the quick investigation!
JIT: fix relop flags for peeled switch compare (#53096)