runtime: Infinite recursion during resource lookup within System.Private.CoreLib

Description

CoreCLR Version: 6.0.622.26707
.NET Version: 6.0.6
Description: The application requested process termination through System.Environment.FailFast(string message).
Message: Infinite recursion during resource lookup within System.Private.CoreLib.  This may be a bug in System.Private.CoreLib, or potentially in certain extensibility points such as assembly resolve events or CultureInfo names.  Resource name: Arg_NullReferenceException
Stack:
  at System.Environment.FailFast(System.String)
  at System.SR.InternalGetResourceString(System.String)
  at System.SR.GetResourceString(System.String)
  at System.NullReferenceException..ctor()
  at System.Globalization.CultureInfo.get_CurrentUICulture()
  at System.Resources.ResourceManager.GetString(System.String, System.Globalization.CultureInfo)
  at System.SR.InternalGetResourceString(System.String)
  at System.SR.GetResourceString(System.String)
  at System.NullReferenceException..ctor()
  at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
  at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.Int32, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Net.Security.SslStream+<EnsureFullTlsFrameAsync>d__186`1[[System.Net.Security.AsyncReadWriteAdapter, System.Net.Security, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]], System.Net.Security, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]].MoveNext(System.Threading.Thread)
  at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.Int32, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Net.Security.SslStream+<EnsureFullTlsFrameAsync>d__186`1[[System.Net.Security.AsyncReadWriteAdapter, System.Net.Security, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]], System.Net.Security, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]].MoveNext()
  at System.Net.Sockets.Socket+AwaitableSocketAsyncEventArgs.InvokeContinuation(System.Action`1<System.Object>, System.Object, Boolean, Boolean)
  at System.Net.Sockets.Socket+AwaitableSocketAsyncEventArgs.OnCompleted(System.Net.Sockets.SocketAsyncEventArgs)
  at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32, UInt32, System.Threading.NativeOverlapped*)

Configuration

Regression?

Other information

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 18 (15 by maintainers)

Most upvoted comments

@rzikm The stacktrace that you have shared points to the problem with the PR https://github.com/dotnet/runtime/pull/67049 at one point that was fixed before the PR got merged.

The PR was optimizing String.Replace and the crash starts with String.Replace:

00007ECD735510E0 00007f0e9ecf8347 [FaultingExceptionFrame: 00007ecd735510e0]
00007ECD73551EE0 00007F0E213B6F7E System.String.Replace(Char, Char) 

The “infinite recursion during resource lookup” is generic symptom of the things going wrong and the process state being corrupted. If you see this error message, it is unlikely to be a duplicate of the problem tracked by this issue - open a new issue instead.

The stack suggests this was thrown by ExecutionContext.RunInternal itself, not from within a callback into networking code. Unless something is broken in the async machinery, this seems more like some sort of corruption than a networking issue to me.

Stepping back, why is NullReferenceException is thrown in the first place. There is a bug somewhere. Networking folks can suggest whether it’s networking implementation or user code.