[RyuJIT/arm32][JitStressRegs=8] Assertion failed '(candidates & allRegs(regType)) != RBM_NONE'
From a Windows RyuJIT/arm32 run with COMPlus_JitStressRegs=8:
Assert failure(PID 7608 [0x00001db8], Thread: 5472 [0x1560]): Assertion failed '(candidates & allRegs(regType)) != RBM_NONE' in 'Gen`1[__Canon][System.__Canon]:PassAsParameter(ref,ref):this' (IL size 146)
File: e:\gh\coreclr2\src\jit\lsra.cpp Line: 5257
Image: c:\brucefo\core_root\Windows_NT.arm.Checked.2017-09-01\CoreRun.exe
Tests (incomplete list):
readytorun\tests\mainv1\mainv1.cmd
JIT\Generics\Fields\static_passing_struct01\static_passing_struct01.cmd (TEST_IDENTIFIER = Tests.lst=static_passing_struct01.cmd_511)
@dotnet/arm32-contrib
On my environment, test JIT\Generics\Fields\static_passing_struct01 passed.
And readytorun\tests\mainv1 failed with different assertion
Assert failure(PID 2598 [0x00000a26], Thread: 2598 [0x0a26]): pImportSection == pModule->GetImportSectionForRVA(rva)
File: /home/nfs/git/coreclr/src/vm/prestub.cpp Line: 2090
Image: /home/nfs/test/coreoverlay_checked_arm/corerun
./mainv1.sh: line 250: 2598 Aborted (core dumped) $_DebuggerFullPath "$CORE_ROOT/corerun" $ExePath $CLRTestExecutionArguments
I've repro this failuser as follows.
Assert failure(PID 2413 [0x0000096d], Thread: 2413 [0x096d]): Assertion failed '(candidates & allRegs(regType)) != RBM_NONE' in 'Gen`1[__Canon][System.__Canon]:PassAsParameter(ref,ref):this' (IL size 146)
File: /opt/code/github/hqueue/coreclr/src/jit/lsra.cpp Line: 5304
Image: /mnt/albireo/mywork/device/rpi3/unittests/coreoverlays/coreoverlay.test20170918.Checked/corerun
./run_one.sh: line 12: 2413 Aborted (core dumped) env ${COMPLUS_OPTIONS} ${CORERUN} ${APP}
I will take a look at this.
- This RefPosition is created from
STOREINDusing below function. And when created, it has assignment tor0, i.e.RefPosition->registerAssignmentis0x01. HoweverminRegCandidateCountis 0, because bothconsumeandproduceare0.
RefPosition* LinearScan::newRefPosition(Interval* theInterval,
LsraLocation theLocation,
RefType theRefType,
GenTree* theTreeNode,
regMaskTP mask,
unsigned multiRegIdx /* = 0 */
DEBUGARG(unsigned minRegCandidateCount /* = 1 */))
- During the inialization of
RefPositionin above function, function invokesvoid LinearScan::applyCalleeSaveHeuristics(RefPosition* rp)throughvoid LinearScan::associateRefPosWithInterval(RefPosition* rp).
And RefPosition->registerAssignment is set to 0 at
https://github.com/dotnet/coreclr/blob/42309c858a742e2ec93c34fa4392a9a097d3d816/src/jit/lsra.cpp#L723-L731, because rp->minRegCandidateCount is 0 and JitStressRegs is 8.
- Later, above assertion is observed, because this
RefPositionhas no assignment at all.
Therefore we can expect https://github.com/dotnet/coreclr/pull/14059 can fix this too, because it update srcCount for STOREIND correctly.
I will test this and update the issue.
Above assertion is fixed by PR dotnet/coreclr#14059.
And for readytorun/tests/mainv1/, another assertion is observed but it's being addressed at different issue dotnet/runtime#8826 and PR dotnet/coreclr#13933.
Assert failure(PID 20242 [0x00004f12], Thread: 20242 [0x4f12]): pLookup->indirections == CORINFO_USEHELPER
File: /opt/code/github/hqueue/coreclr/src/vm/arm/stubs.cpp Line: 3786
Image: /mnt/albireo/mywork/device/rpi3/unittests/coreoverlays/coreoverlay.test20170918.Checked.issue_13761/corerun
Therefore I think we can close this now.