runtime icon indicating copy to clipboard operation
runtime copied to clipboard

ReadyToRun: JIT\jit64\regress\vsw\543645\test fails

Open erozenfeld opened this issue 10 years ago • 6 comments

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

erozenfeld avatar Mar 09 '16 02:03 erozenfeld

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++

LLITCHEV avatar Mar 10 '16 00:03 LLITCHEV

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

jkotas avatar Mar 12 '16 18:03 jkotas

The problem is the method is calling the JIT_Overflow helper, but there is no shadow argument area allocated on the stack.

jkotas avatar Mar 12 '16 18:03 jkotas

@LLITCHEV Should this go to you?

gkhanna79 avatar Mar 14 '16 16:03 gkhanna79

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.

RussKeldorph avatar Mar 28 '16 22:03 RussKeldorph

Fixed with PR dotnet/coreclr#3953

LLITCHEV avatar Mar 31 '16 22:03 LLITCHEV