runtime icon indicating copy to clipboard operation
runtime copied to clipboard

[LEGACY_BACKEND] Assertion failed '(rsMaskUsed & regMask) == regMask'

Open BruceForstall opened this issue 9 years ago • 11 comments

Tests failing in Windows arm32 legacy_backend test run.

Assert failure(PID 8604 [0x0000219c], Thread: 5248 [0x1480]): Assertion failed '(rsMaskUsed & regMask) == regMask' in 'initblk2:main():int' (IL size 864)

    File: e:\gh\coreclr2\src\jit\regset.cpp Line: 333
    Image: c:\brucefo\core_root\Windows_NT.arm.Checked.2017-06-28\CoreRun.exe

Tests with failure:

JIT\Methodical\xxblk\initblk3_il_d\initblk3_il_d.cmd
JIT\Methodical\xxblk\initblk3_il_r\initblk3_il_r.cmd
JIT\Regression\JitBlue\DevDiv_199169\DevDiv_199169\DevDiv_199169.cmd
JIT\Regression\JitBlue\DevDiv_255263\DevDiv_255263\DevDiv_255263.cmd

BruceForstall avatar Jul 07 '17 21:07 BruceForstall

@parjong I found 3 JIT asserts with arm32 LEGACY_BACKEND on Windows, running the coreclr tests. (this plus dotnet/runtime#8507, dotnet/runtime#8506). Isn't this something Samsung would have seen in testing? I'll plan to work on fixing them (for our UWP6.0 milestone), but maybe Samsung would want to fix one or more, also.

BruceForstall avatar Jul 07 '17 22:07 BruceForstall

@BruceForstall We have been running regression tests using Release build as it takes too much time to run tests using Debug/Checked build. We have not seen these issues with Release build. We recently found dotnet/runtime#8507 while working on FX issues with Checked build, but I'm not sure whether it is under investigation.

@hseok-oh @hqueue Could you share the current status?

parjong avatar Jul 09 '17 23:07 parjong

@parjong You mean System.Runtime.dll on checked coreclr build, right? Its assert failure messages are different, but seem similar. We didn't investigate these assert failures.

@BruceForstall Here is assertion message @parjong reported

$ corerun ./xunit.console.netcore.exe *.Tests.dll -notrait Benchmark=true -notrait category=nonnetco
reapptests -notrait category=OuterLoop -notrait category=failing -notrait category=nonlinuxtests
xUnit.net console test runner (32-bit .NET Core)
Copyright (C) 2014 Outercurve Foundation.

Discovering: System.Runtime.Tests
Discovered:  System.Runtime.Tests
Starting:    System.Runtime.Tests

Assert failure(PID 8422 [0x000020e6], Thread: 8431 [0x20ef]): Assertion failed 'isRegPairType(tree->gtType)' in '<Module>:.cctor()' (IL size 13)

    File: /home2/parjong/projects/dotnet/coreclr/src/jit/codegenlegacy.cpp Line: 1018
    Image: /home/dotnet/parjong/netcore-workspace/fx/arch/rpi/overlay/corerun


Assert failure(PID 8422 [0x000020e6], Thread: 8431 [0x20ef]): Assertion failed 'genActualType(tree->gtType) == TYP_LONG' in '<Module>:.cctor()' (IL size 13)

    File: /home2/parjong/projects/dotnet/coreclr/src/jit/codegenlegacy.cpp Line: 13212
    Image: /home/dotnet/parjong/netcore-workspace/fx/arch/rpi/overlay/corerun


Assert failure(PID 8422 [0x000020e6], Thread: 8431 [0x20ef]): Assertion failed 'oper == GT_CNS_LNG' in '<Module>:.cctor()' (IL size 13)

    File: /home2/parjong/projects/dotnet/coreclr/src/jit/codegenlegacy.cpp Line: 13254
    Image: /home/dotnet/parjong/netcore-workspace/fx/arch/rpi/overlay/corerun


Assert failure(PID 8422 [0x000020e6], Thread: 8431 [0x20ef]): Assertion failed 'this->gtOper == GT_CNS_LNG' in '<Module>:.cctor()' (IL size 13)

    File: /home2/parjong/projects/dotnet/coreclr/src/jit/gtstructs.h Line: 53
    Image: /home/dotnet/parjong/netcore-workspace/fx/arch/rpi/overlay/corerun


Assert failure(PID 8422 [0x000020e6], Thread: 8431 [0x20ef]): Assertion failed 'tree->gtType == TYP_LONG' in '<Module>:.cctor()' (IL size 13)

    File: /home2/parjong/projects/dotnet/coreclr/src/jit/regset.cpp Line: 978
    Image: /home/dotnet/parjong/netcore-workspace/fx/arch/rpi/overlay/corerun

hseok-oh avatar Jul 10 '17 02:07 hseok-oh

@BruceForstall I also observed one of assertions(#12685) before at (#11868) while debugging ryujit/arm32 with legacyjit fallback.

And now I just reproduced all four tests failed with this assertion on Rpi3 Ubuntu 16.04. However I didn't look into this issues yet.

hqueue avatar Jul 10 '17 10:07 hqueue

@BruceForstall Are you looking at those arm32/legacy_backend issues? Or I'd like to take a look at them.

wateret avatar Jul 11 '17 07:07 wateret

@wateret I am looking at these issues (along with @jashook and potentially others), but I'd be happy to have you look at them. Can you look at dotnet/runtime#8506?

BruceForstall avatar Jul 11 '17 17:07 BruceForstall

@wateret Actually, I've been looking at dotnet/runtime#8506. Can you look at this issue (#12686)?

BruceForstall avatar Jul 12 '17 01:07 BruceForstall

@BruceForstall OK, I'll look at this issue :D

wateret avatar Jul 12 '17 01:07 wateret

Backtrace on RPi3/Ubuntu1404

Assert failure(PID 5900 [0x0000170c], Thread: 5900 [0x170c]): Assertion failed '(rsMaskUsed & regMask) == regMask' in 'initblk2:main()[13/9537]
 size 864)

    File: /opt/code/github/hqueue/coreclr/src/jit/regset.cpp Line: 333
    Image: /work/nfs/dotnet/arm/ttc/corerun


Thread 1 "corerun" received signal SIGABRT, Aborted.
__libc_do_syscall () at ../sysdeps/unix/sysv/linux/arm/libc-do-syscall.S:47
47      ../sysdeps/unix/sysv/linux/arm/libc-do-syscall.S: No such file or directory.
(gdb) bt
#0  __libc_do_syscall () at ../sysdeps/unix/sysv/linux/arm/libc-do-syscall.S:47
dotnet/coreclr#1  0x76cfa648 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
dotnet/coreclr#2  0x76cfb34a in __GI_abort () at abort.c:89
dotnet/coreclr#3  0x769f990e in PROCAbort () at /opt/code/github/hqueue/coreclr/src/pal/src/thread/process.cpp:3027
dotnet/coreclr#4  0x769f66a8 in PROCEndProcess (hProcess=0xffffff01, uExitCode=123456789, bTerminateUnconditionally=1)
    at /opt/code/github/hqueue/coreclr/src/pal/src/thread/process.cpp:1391
dotnet/coreclr#5  0x769f67e6 in TerminateProcess (hProcess=0xffffff01, uExitCode=123456789)
    at /opt/code/github/hqueue/coreclr/src/pal/src/thread/process.cpp:1307
dotnet/coreclr#6  0x763b245a in TerminateOnAssert () at /opt/code/github/hqueue/coreclr/src/utilcode/debug.cpp:183
dotnet/coreclr#7  0x763b2c92 in _DbgBreakCheck (szFile=0x70596322 "/opt/code/github/hqueue/coreclr/src/jit/regset.cpp", iLine=333,
    szExpr=0x7eff9960 "Assertion failed '(rsMaskUsed & regMask) == regMask' in 'initblk2:main():int' (IL size 864)\n", fConstrained=0)
    at /opt/code/github/hqueue/coreclr/src/utilcode/debug.cpp:436
dotnet/coreclr#8  0x76426988 in CEEInfo::doAssert (this=0x7effce40, szFile=0x70596322 "/opt/code/github/hqueue/coreclr/src/jit/regset.cpp", iLine=333,
    szExpr=0x7eff9960 "Assertion failed '(rsMaskUsed & regMask) == regMask' in 'initblk2:main():int' (IL size 864)\n")
    at /opt/code/github/hqueue/coreclr/src/vm/jitinterface.cpp:10396
dotnet/coreclr#9  0x702ce940 in assertAbort (why=0x70596422 "(rsMaskUsed & regMask) == regMask",
    file=0x70596322 "/opt/code/github/hqueue/coreclr/src/jit/regset.cpp", line=333) at /opt/code/github/hqueue/coreclr/src/jit/error.cpp:287
dotnet/coreclr#10 0x703d5b1a in RegSet::rsLockUsedReg (this=0x87bdc, regMask=7) at /opt/code/github/hqueue/coreclr/src/jit/regset.cpp:333
dotnet/coreclr#11 0x7041f7d8 in CodeGen::genCodeForBlkOp (this=0x87b8c, tree=0x8f2c8, destReg=22527)
    at /opt/code/github/hqueue/coreclr/src/jit/codegenlegacy.cpp:9649
dotnet/coreclr#12 0x7041faf8 in CodeGen::genCodeForTreeSmpOp (this=0x87b8c, tree=0x8f2c8, destReg=22527, bestReg=0)
    at /opt/code/github/hqueue/coreclr/src/jit/codegenlegacy.cpp:9708
dotnet/coreclr#13 0x7040b45e in CodeGen::genCodeForTree (this=0x87b8c, tree=0x8f2c8, destReg=22527, bestReg=0)
    at /opt/code/github/hqueue/coreclr/src/jit/codegenlegacy.cpp:12360
dotnet/coreclr#14 0x70429266 in CodeGen::genCodeForBBlist (this=0x87b8c) at /opt/code/github/hqueue/coreclr/src/jit/codegenlegacy.cpp:12840
dotnet/coreclr#15 0x70297a3a in CodeGen::genGenerateCode (this=0x87b8c, codePtr=0x7effc874, nativeSizeOfCode=0x7effcd18)
    at /opt/code/github/hqueue/coreclr/src/jit/codegencommon.cpp:3141
dotnet/coreclr#16 0x702ad892 in Compiler::compCompile (this=0x862f0, methodCodePtr=0x7effc874, methodCodeSize=0x7effcd18, compileFlags=0x7effc888)
    at /opt/code/github/hqueue/coreclr/src/jit/compiler.cpp:4850

wateret avatar Jul 12 '17 01:07 wateret

@wateret @BruceForstall I'm looking at different assert failure: isRegPairType(tree->gtType). I'll make new issue.

hseok-oh avatar Jul 12 '17 01:07 hseok-oh

It looks like in the case of false of this condition, we do not set RBM_ARG_2 as used for regSet.

At the time of assertion failure: (rsMaskUsed & regMask) == regMask, the value of rsMaskUsed is 0x403 and regMask is 0x7, which means r2 is not set but it should have.

wateret avatar Jul 12 '17 08:07 wateret