Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clrinterp: Add missing must-expand intrinsics #103326

Merged
merged 11 commits into from
Jun 14, 2024

Conversation

EgorBo
Copy link
Member

@EgorBo EgorBo commented Jun 12, 2024

This PR adds a few intrinsics to coreclr's interpreter since these intrinsics are must-expand (and crash with StackOverflowException otherwise).

@EgorBo EgorBo changed the title clrinterp: add IsReferenceOrContainsReferences intrinsic clrinterp: Add missing must-expand intrinsics Jun 12, 2024
@EgorBo EgorBo marked this pull request as ready for review June 12, 2024 04:47
@EgorBo
Copy link
Member Author

EgorBo commented Jun 12, 2024

With these fixes, an empty app works. Something more complicated including System.Console.WriteLine("Hello World") still fails, hard to say why:

Process terminated. Encountered infinite recursion while looking up resource 'Arg_BadImageFormatException' in System.Private.CoreLib. Verify the installation of .NET is complete and does not need repairing, and that the state of the process has not become corrupted.
   at System.Environment.<FailFast>g____PInvoke|11_0(System.Runtime.CompilerServices.StackCrawlMarkHandle, UInt16*, System.Runtime.CompilerServices.ObjectHandleOnStack, UInt16*)
   at System.Environment.FailFast(System.Runtime.CompilerServices.StackCrawlMarkHandle, System.String, System.Runtime.CompilerServices.ObjectHandleOnStack, System.String)
   at System.Environment.FailFast(System.Threading.StackCrawlMark ByRef, System.String, System.Exception, System.String)
   at System.Environment.FailFast(System.String)
   at System.SR.InternalGetResourceString(System.String)
   at System.SR.GetResourceString(System.String)
   at System.SR.get_Arg_BadImageFormatException()
   at System.BadImageFormatException..ctor()
   at System.Resources.ResourceManager..ctor(System.Type)
   at System.SR.get_ResourceManager()
   at System.SR.InternalGetResourceString(System.String)
   at System.SR.GetResourceString(System.String)
   at System.SR.get_Arg_BadImageFormatException()
   at System.BadImageFormatException..ctor()
   at System.IO.StreamWriter..ctor(System.IO.Stream, System.Text.Encoding, Int32, Boolean)
   at System.Console.CreateOutputWriter(System.IO.Stream)
   at System.Console.<get_Out>g__EnsureInitialized|26_0()
   at System.Console.get_Out()
   at System.Console.WriteLine(System.String)
   at Prog.Main(System.String[])

(note I disable W^X, EventSource, HWIntrinsics and R2R)

@jkotas jkotas requested a review from janvorli June 12, 2024 15:25
@EgorBo EgorBo merged commit 7d6ea7c into dotnet:main Jun 14, 2024
86 of 89 checks passed
@EgorBo EgorBo deleted the fix-IsReferenceOrContainsReferences-interp branch June 14, 2024 13:42
@github-actions github-actions bot locked and limited conversation to collaborators Jul 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants