x64 JIT stack overflow - by Jeroen Frijters1

Status : 

  Fixed<br /><br />
		This item has been fixed in the current or upcoming version of this product.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.


2
0
Sign in
to vote
ID 578948 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 7/27/2010 3:16:22 AM
Access Restriction Public

Description

The CLR x64 JIT (both 2.0 and 4.0) dies with a stack overflow while jitting.
Sign in to post a comment.
Posted by Jeroen Frijters1 on 8/25/2010 at 9:40 PM
Thanks for the explanation Grant. In this case the workaround was easy, I simply removed the Int64BitsToDouble call and replaced it with a ldc_r8 instruction. The Int64BitsToDouble call was actually a workaround for an older x64 JIT bug: https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=276714
Posted by Grant [MSFT] on 8/25/2010 at 11:33 AM
Thank you Jeroen for reporting this issue. This is caused by a bug in the 64-bit and how it optimizes calls to System.BitConverter.Int64BitsToDouble when the parameter is a large constant (i.e. has any bits set in the upper DWORD). The issue has been fixed and it will be part of a future release.

As a work-around, you can either annotate the calling method with MethodImplOptions.NoOptimization, or you can wrap the method with another method that is marked with MethodImplOptions.NoInlning.

Grant Richins
CLR CodeGen Developer
Posted by Grant [MSFT] on 8/25/2010 at 11:25 AM
Hello Jeroen. Thank you for reporting this issue. This is caused by a bug in how the 64-bit JIT internally optimizes large constants (anything with the high 32-bits set) through an inlined call to System.BitConverter.Int64BitsToDouble. The issue has been fixed and it will be part of a future release.

If you need a work-around, I would suggest either applying MethodImplOptions.NoOptimization to callers, or wrapping the method with another that is marked with MethodImplOptions.NoInlining.

Grant Richins
CLR CodeGen Developer
Posted by Jeroen Frijters1 on 7/29/2010 at 11:02 PM
It's right there. If you don't see the attachment, I suggest you log into connect instead of your internal system:
https://connect.microsoft.com/VisualStudio/feedback/details/578948/x64-jit-stack-overflow
Posted by Microsoft on 7/29/2010 at 1:09 PM
I'm not seeing any attached file. We just swapped our bug database over for the next product cycle, so there's a chance it got accidentally eaten. Or you could have just forgotten, like I do every other time I say "See attached file" :-). If you could reattach it, that would be great.
Posted by Microsoft on 7/27/2010 at 9:57 PM
Thanks for your feedback. We are routing this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.
Posted by Microsoft on 7/27/2010 at 4:03 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)