Skip to content
This repository has been archived by the owner on Nov 1, 2020. It is now read-only.

FailFast: (InternalError): Runtime internal error #2254

Closed
MichalStrehovsky opened this issue Nov 23, 2016 · 1 comment · Fixed by #2271
Closed

FailFast: (InternalError): Runtime internal error #2254

MichalStrehovsky opened this issue Nov 23, 2016 · 1 comment · Fixed by #2271
Assignees
Labels
Milestone

Comments

@MichalStrehovsky
Copy link
Member

MichalStrehovsky commented Nov 23, 2016

JIT\Directed\FaultHandlers\Nesting\Nesting test is hitting an issue with calling finally funclets:

 	reproNative.exe!System_Private_CoreLib_Interop_mincore__RaiseFailFastException() Line 166	Unknown
 	reproNative.exe!System_Private_CoreLib_System_RuntimeExceptionHelpers__FailFast_1() Line 232	Unknown
 	reproNative.exe!System_Private_CoreLib_System_RuntimeExceptionHelpers__RuntimeFailFast() Line 188	Unknown
 	reproNative.exe!System_Private_CoreLib_System_Runtime_EH__FailFastViaClasslib() Line 177	Unknown
 	reproNative.exe!System_Private_CoreLib_System_Runtime_EH__RhThrowHwEx() Line 530	Unknown
 	reproNative.exe!RhpThrowHwEx() Line 106	Unknown
> 	reproNative.exe!nesting_TEST__Main() Line 64	Unknown
	reproNative.exe!RhpCallFinallyFunclet() Line 597	Unknown
 	reproNative.exe!System_Private_CoreLib_System_Runtime_EH__InvokeSecondPass_0() Line 890	Unknown
 	reproNative.exe!System_Private_CoreLib_System_Runtime_EH__DispatchEx() Line 674	Unknown
 	reproNative.exe!System_Private_CoreLib_System_Runtime_EH__RhThrowEx() Line 560	Unknown
 	reproNative.exe!RhpThrowEx() Line 198	Unknown
 	reproNative.exe!nesting_TEST__Main() Line 50	Unknown
 	reproNative.exe!__managed__Main�()	Unknown

The disassembly at the TEST__Main frame looks like this:

00007FF7CB5155B5 ??                   ?? ?? 
00007FF7CB5155B6 ??                   ?? ?? 
00007FF7CB5155B7 ??                   ?? ?? 
00007FF7CB5155B8 ??                   ?? ?? 
  leave end_6
end_6:
  call void [mscorlib]System.GC::Collect() 
00007FF7CB5155B9 BA 02 00 00 00       mov         edx,2  
00007FF7CB5155BE E8 69 A0 FF FF       call        System_Private_CoreLib_System_Runtime_InternalCalls__RhCollect (07FF7CB50F62Ch)  
  endfinally

We ended up calling 4 bytes before what we were supposed to call. The hardware exception being thrown is 0xC000001D: Illegal Instruction.

@MichalStrehovsky MichalStrehovsky added this to the March 2017 milestone Nov 23, 2016
@jkotas jkotas self-assigned this Nov 24, 2016
@jkotas
Copy link
Member

jkotas commented Nov 24, 2016

The catch funclets end with something like:

lea rax, <address to continue>
...
ret

The <address to continue> in the final image is off by a couple of bytes in some cases. The problem is that recordRelocation on the JIT-EE interface does not do what RyuJIT expects it to do.

jkotas added a commit that referenced this issue Nov 27, 2016
RyuJIT depends on the relocation offset delta to be stored in the code stream because of it applies additional fixups to it.

Tweak the list of Top200 tests to include coverage for this issue.

Fixes #2254
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants