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

OSX-ARM64 Investigate Hello World failure. #41119

Closed
sdmaclea opened this issue Aug 20, 2020 · 4 comments
Closed

OSX-ARM64 Investigate Hello World failure. #41119

sdmaclea opened this issue Aug 20, 2020 · 4 comments
Labels
arch-arm64 area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI os-macos-bigsur (macOS11)
Milestone

Comments

@sdmaclea
Copy link
Contributor

With #40435,

HelloWorld fails like this:

   at System.NullReferenceException..ctor()
...
Repeat until stack overflow
...
   at System.NullReferenceException..ctor()
   at System.Array.LastIndexOf[[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.__Canon[], System.__Canon, Int32, Int32)
   at System.Collections.Generic.List`1[[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].LastIndexOf(System.__Canon, Int32, Int32)
   at System.Collections.Generic.List`1[[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].LastIndexOf(System.__Canon)
   at System.SR.InternalGetResourceString(System.String)
   at System.SR.GetResourceString(System.String, System.String)
   at System.SR.GetResourceString(System.String)
   at System.SR.get_Arg_NullReferenceException()
   at System.NullReferenceException..ctor()
   at System.Array.LastIndexOf[[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.__Canon[], System.__Canon, Int32, Int32)
   at System.Collections.Generic.List`1[[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].LastIndexOf(System.__Canon, Int32, Int32)
   at System.Collections.Generic.List`1[[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].LastIndexOf(System.__Canon)
   at System.SR.InternalGetResourceString(System.String)
   at System.SR.GetResourceString(System.String, System.String)
   at System.SR.GetResourceString(System.String)
   at System.SR.get_Arg_ArrayTypeMismatchException()
   at System.ArrayTypeMismatchException..ctor()
   at System.Runtime.CompilerServices.CastHelpers.StelemRef_Helper_NoCacheLookup(System.Object ByRef, Void*, System.Object)
   at System.Runtime.CompilerServices.CastHelpers.StelemRef_Helper(System.Object ByRef, Void*, System.Object)
   at System.Collections.Generic.ComparerHelpers.CreateDefaultEqualityComparer(System.Type)
   at System.Collections.Generic.EqualityComparer`1[[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]..cctor()
   at System.Collections.Generic.EqualityComparer`1[[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].get_Default()
   at System.Text.EncodingHelper.GetCharset()
   at System.Text.EncodingHelper.GetCharset()
   at System.Text.EncodingHelper.GetEncodingFromCharset()
   at System.ConsolePal.GetConsoleEncoding()
   at System.ConsolePal.get_OutputEncoding()
   at System.Console.get_OutputEncoding()
   at System.Console.CreateOutputWriter(System.IO.Stream)
   at System.Console.<get_Out>g__EnsureInitialized|25_0()
   at System.Console.get_Out()
   at System.Console.WriteLine(System.String)
   at x64.console.Program.Main(System.String[])
@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added area-Meta untriaged New issue has not been triaged by the area owner labels Aug 20, 2020
@sdmaclea sdmaclea added arch-arm64 area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI os-macos-bigsur (macOS11) and removed area-Meta untriaged New issue has not been triaged by the area owner labels Aug 20, 2020
@sdmaclea sdmaclea added this to the 6.0.0 milestone Aug 20, 2020
@danmoseley
Copy link
Member

The amusing thing here is that InternalGetResourceString protects itself against recursive lookup - unless it is specifically a failure within List<T>.LastIndexOf

One would think that would be rare, but #40073 hit it for another reason.

We probably should fix that in InternalGetResourceString, not that it would solve the problem here.

@sdmaclea
Copy link
Contributor Author

Thanks @danmosemsft. Root cause of #40073 was a bad S.P.C.dll. This could be the same issue. As I have been trying to work around #41120, so my S.P.C.dll build may not be right.

@sdmaclea
Copy link
Contributor Author

With a proper S.P.C.dll as mentioned in #40435 (comment), the hello world exception now looks like an interop issue.

Unhandled exception. Fatal error. System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at System.Diagnostics.StackFrameHelper.InitializeSourceInfo(Int32, Boolean, System.Exception)
   at System.Diagnostics.StackTrace.CaptureStackTrace(Int32, Boolean, System.Exception)
   at System.Diagnostics.StackTrace.InitializeForException(System.Exception, Int32, Boolean)
   at System.Diagnostics.StackTrace..ctor(System.Exception, Boolean)
   at System.Exception.GetStackTrace(System.Exception)
   at System.Exception.get_StackTrace()
   at System.Exception.ToString()
   at Interop+Sys.Dup(Microsoft.Win32.SafeHandles.SafeFileHandle)
   at System.ConsolePal+<>c.<OpenStandardOutput>b__9_0()
   at Microsoft.Win32.SafeHandles.SafeFileHandleHelper.Open(System.Func`1<Microsoft.Win32.SafeHandles.SafeFileHandle>)
   at System.ConsolePal.OpenStandardOutput()
   at System.Console.OpenStandardOutput()
   at System.Console.<get_Out>g__EnsureInitialized|25_0()
   at System.Console.get_Out()
   at System.Console.Write(System.String)
   at x64.console.Program.Main(System.String[])

@sdmaclea
Copy link
Contributor Author

Fixed in #40435

@ghost ghost locked as resolved and limited conversation to collaborators Dec 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-arm64 area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI os-macos-bigsur (macOS11)
Projects
None yet
Development

No branches or pull requests

3 participants