ReadyToRun: JIT\jit64\regress\vsw\543645\test fails
Test: JIT\jit64\regress\vsw\543645\test
Repro steps: Git commit hash: c89bf3f
E:\coreclr>rd /s/q E:\coreclr\bin\tests E:\coreclr>build checked skiptests E:\coreclr>tests\buildtest.cmd checked crossgen E:\coreclr>tests\runtest.cmd checked
BEGIN EXECUTION Microsoft (R) CoreCLR Native Image Generator - Version 4.5.22220.0 Copyright (c) Microsoft Corporation. All rights reserved.
Native image E:\coreclr\bin\tests\Windows_NT.x64.Checked\JIT\jit64\regress\vsw\543645\test\ovfldiv1.ni.exe generated successfully.
"E:\coreclr\tests..\bin\tests\Windows_NT.x64.Checked\Tests\Core_Root\corerun.exe" test.exe
Expected: 100
Actual: 255
END EXECUTION - FAILED
FAILED
This looks like an issue having to do with unwinding exceptions in ReadyToRun. It looks like the Jit is calling correctly the overflow throw handler. Here is the stack that leads to the crash...
coreclr.dll!
RaiseTheExceptionInternalOnly'::81'::__Body::Run(RaiseTheExceptionInternalOnly::__l2::Param * pParam) Line 3114 C++ coreclr.dll!RaiseTheExceptionInternalOnly(OBJECTREF throwable, int rethrow, int fForStackOverflow) Line 3114 C++ coreclr.dll!UnwindAndContinueRethrowHelperAfterCatch(Frame * pEntryFrame, Exception * pException) Line 8747 C++ coreclr.dll!JIT_Overflow() Line 5484 C++
Code for the offending method:
0:000> u 00007ffe`52df26b0 L30
ovfldiv1_ni!Overflow.test1() [c:\coreclr\tests\src\JIT\jit64\regress\vsw\543645\test.il @ 94]:
push rbp
mov rbp,rsp
nop
mov eax,0FFFFFFFFh
movsxd rax,eax
mov rdx,8000000000000000h
imul rax,rdx
jno ovfldiv1_ni!Overflow.test1()+0x22
call JIT_Overflow
nop
pop rbp
ret
The problem is the method is calling the JIT_Overflow helper, but there is no shadow argument area allocated on the stack.
@LLITCHEV Should this go to you?
Only affects Debuggable code, so, even though this is really bad silent bad code, we don't think it's likely to hit RC2 scenarios.
Fixed with PR dotnet/coreclr#3953