runtime icon indicating copy to clipboard operation
runtime copied to clipboard

[RyuJIT/arm32][JitStressRegs=8] Assertion failed '(candidates & allRegs(regType)) != RBM_NONE'

Open BruceForstall opened this issue 9 years ago • 5 comments

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)

BruceForstall avatar Sep 01 '17 23:09 BruceForstall

@dotnet/arm32-contrib

BruceForstall avatar Sep 01 '17 23:09 BruceForstall

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

hseok-oh avatar Sep 20 '17 10:09 hseok-oh

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.

hqueue avatar Sep 20 '17 11:09 hqueue

  1. This RefPosition is created from STOREIND using below function. And when created, it has assignment to r0, i.e. RefPosition->registerAssignment is 0x01. However minRegCandidateCount is 0, because both consume and produce are 0.
RefPosition* LinearScan::newRefPosition(Interval*    theInterval,
                                        LsraLocation theLocation,
                                        RefType      theRefType,
                                        GenTree*     theTreeNode,
                                        regMaskTP    mask,
                                        unsigned     multiRegIdx /* = 0 */
                                        DEBUGARG(unsigned minRegCandidateCount /* = 1 */))
  1. During the inialization of RefPosition in above function, function invokes void LinearScan::applyCalleeSaveHeuristics(RefPosition* rp) through void 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.

  1. Later, above assertion is observed, because this RefPosition has 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.

hqueue avatar Sep 22 '17 08:09 hqueue

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.

hqueue avatar Sep 22 '17 08:09 hqueue