Skip to content

clrinterp: Add missing must-expand intrinsics - #103326

Merged
EgorBo merged 11 commits into
dotnet:mainfrom
EgorBo:fix-IsReferenceOrContainsReferences-interp
Jun 14, 2024
Merged

EgorBo merged 11 commits into
dotnet:mainfrom
EgorBo:fix-IsReferenceOrContainsReferences-interp

Conversation

@EgorBo

@EgorBo EgorBo commented Jun 12, 2024 •

Copy link
Copy Markdown
Member

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

@ghost ghost added the area-VM-coreclr label Jun 12, 2024
@EgorBo
EgorBo marked this pull request as draft June 12, 2024 02:55
Comment thread src/coreclr/vm/interpreter.cpp Resolved
@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
Comment thread src/coreclr/vm/interpreter.cpp Resolved
@EgorBo

EgorBo commented Jun 12, 2024 •

Copy link
Copy Markdown
Member Author

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)

@EgorBo
EgorBo requested review from jakobbotsch and jkotas June 12, 2024 07:31
@jkotas
jkotas requested a review from janvorli June 12, 2024 15:25
@EgorBo
EgorBo merged commit 7d6ea7c into dotnet:main Jun 14, 2024
@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