coreclr AVs at coreclr.dll!MarshalNative::GCHandleInternalCheckDomain(OBJECTHANDLE__ * handle) Line 820
After upgrading the runtime references to rc3-23722 in the dotnet/cli repo, we are starting to see AVs in Windows with the below call stack
coreclr.dll!MarshalNative::GCHandleInternalCheckDomain(OBJECTHANDLE__ * handle) Line 820 C++ mscorlib.ni.dll!00007ffe539eca89() Unknown mscorlib.ni.dll!00007ffe53c09e94() Unknown coreclr.dll!CallDescrWorkerInternal() Line 102 Unknown coreclr.dll!MethodDescCallSite::CallTargetWorker(const unsigned __int64 * pArguments) Line 654 C++ coreclr.dll!RuntimeInvokeHostAssemblyResolver(__int64 pManagedAssemblyLoadContextToBindWithin, IAssemblyName * pIAssemblyName, ICLRPrivAssembly * * ppLoadedAssembly) Line 14285 C++ coreclr.dll!CLRPrivBinderCoreCLR::BindAssemblyByName(IAssemblyName * pIAssemblyName, ICLRPrivAssembly * * ppAssembly) Line 84 C++ coreclr.dll!AssemblySpec::Bind(AppDomain * pAppDomain, int fThrowOnFileNotFound, CoreBindResult * pResult, int) Line 174 C++ coreclr.dll!AppDomain::BindAssemblySpec(AssemblySpec * pSpec, int fThrowOnFileNotFound, int fRaisePrebindEvents, StackCrawlMark * pCallerStackMark, AssemblyLoadSecurity * pLoadSecurity, int fUseHostBinderIfAvailable) Line 8870 C++ coreclr.dll!AssemblySpec::LoadDomainAssembly(FileLoadLevel targetLevel, AssemblyLoadSecurity * pLoadSecurity, int fThrowOnFileNotFound, int fRaisePrebindEvents, StackCrawlMark * pCallerStackMark) Line 1469 C++ coreclr.dll!AssemblyNative::Load(AssemblyNameBaseObject * assemblyNameUNSAFE, StringObject * codeBaseUNSAFE, Object * securityUNSAFE, AssemblyBaseObject * requestingAssemblyUNSAFE, StackCrawlMark * stackMark, ICLRPrivBinder * pPrivHostBinder, bool fThrowOnFileNotFound, bool fForIntrospection, bool fSuppressSecurityChecks) Line 279 C++ mscorlib.ni.dll!00007ffe539e9e92() Unknown mscorlib.ni.dll!00007ffe53a1dcff() Unknown mscorlib.ni.dll!00007ffe53a1cf8b() Unknown mscorlib.ni.dll!00007ffe539d216e() Unknown mscorlib.ni.dll!00007ffe539d1f60() Unknown mscorlib.ni.dll!00007ffe539d2d39() Unknown 00007ffdf842b94f() Unknown 00007ffdf842b8b2() Unknown 00007ffdf8428af1() Unknown 00007ffdf84289de() Unknown 00007ffdf8413f6d() Unknown 00007ffdf841358e() Unknown 00007ffdf8412a27() Unknown coreclr.dll!CallDescrWorkerInternal() Line 102 Unknown coreclr.dll!MethodDescCallSite::CallTargetWorker(const unsigned __int64 * pArguments) Line 654 C++ coreclr.dll!RunMain(MethodDesc * pFD, short piRetVal, int * stringArgs, PtrArray * *) Line 2595 C++ coreclr.dll!Assembly::ExecuteMainMethod(PtrArray * * stringArgs, int waitForOtherThreads) Line 2716 C++ coreclr.dll!CorHost2::ExecuteAssembly(unsigned long dwAppDomainId, const wchar_t * pwzAssemblyPath, int argc, const wchar_t * * argv, unsigned long * pReturnValue) Line 1349 C++ coreclr.dll!coreclr_execute_assembly(void * hostHandle, unsigned int domainId, int argc, const char * * argv, const char * managedAssemblyPath, unsigned int * exitCode) Line 371 C++ hostpolicy.dll!coreclr::execute_assembly(void * host_handle, unsigned int domain_id, int argc, const char * * argv, const char * managed_assembly_path, unsigned int * exit_code) Line 110 C++ hostpolicy.dll!run(const arguments_t & args, const std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> > & clr_path) Line 203 C++ hostpolicy.dll!corehost_main(const int argc, const wchar_t * * argv) Line 247 C++ dotnet-compile-csc.exe!wmain(const int argc, const wchar_t * * argv) Line 117 C++ dotnet-compile-csc.exe!invoke_main() Line 90 C++ dotnet-compile-csc.exe!__scrt_common_main_seh() Line 264 C++ dotnet-compile-csc.exe!__scrt_common_main() Line 309 C++ dotnet-compile-csc.exe!wmainCRTStartup() Line 17 C++ kernel32.dll!BaseThreadInitThunk(unsigned long RunProcessInit, long (void *) * StartAddress, void * Argument) Line 64 C ntdll.dll!RtlUserThreadStart(long (void *) * StartAddress, void * Argument) Line 994 C
Windbg callstack
0:000> k
Child-SP RetAddr Call Site
00 (Inline Function) --------
-------- coreclr!HndGetHandleTableADIndex+0x7 [f:\dd\ndp\clr\src\gc\handletable.cpp @ 259] 01 0000007e2cd7bf10 00007ffe539eca89 coreclr!MarshalNative::GCHandleInternalCheckDomain+0x3f [f:\dd\ndp\clr\src\vm\marshalnative.cpp @ 820] 02 0000007e2cd7bf40 00007ffe53c09e94 mscorlib_ni!System.Runtime.InteropServices.GCHandle.FromIntPtr(IntPtr)+0x19 03 0000007e2cd7bf70 00007ffe5811a823 mscorlib_ni!System.Runtime.Loader.AssemblyLoadContext.Resolve(IntPtr, System.Reflection.AssemblyName)+0x14 04 0000007e2cd7bfb0 00007ffe57dbb787 coreclr!CallDescrWorkerInternal+0x83 [f:\dd\ndp\clr\src\vm\amd64\CallDescrWorkerAMD64.asm @ 102] 05 0000007e2cd7bff0 00007ffe57d88f75 coreclr!MethodDescCallSite::CallTargetWorker+0x20f [f:\dd\ndp\clr\src\vm\callhelpers.cpp @ 654] 06 (Inline Function) ---------------- coreclr!MethodDescCallSite::Call_RetOBJECTREF+0x10 [f:\dd\ndp\clr\src\vm\callhelpers.h @ 424] 07 0000007e2cd7c100 00007ffe58108e62 coreclr!RuntimeInvokeHostAssemblyResolver+0x141 [f:\dd\ndp\clr\src\vm\appdomain.cpp @ 14285] 08 (Inline Function) ---------------- coreclr!BINDER_SPACE::AssemblyBinder::BindUsingHostAssemblyResolver+0x1c [f:\dd\ndp\clr\src\binder\assemblybinder.cpp @ 1871] 09 0000007e2cd7c380 00007ffe57dc7c40 coreclr!CLRPrivBinderCoreCLR::BindAssemblyByName+0x1c2 [f:\dd\ndp\clr\src\binder\clrprivbindercoreclr.cpp @ 84] 0a 0000007e2cd7c4a0 00007ffe57d83938 coreclr!AssemblySpec::Bind+0x380 [f:\dd\ndp\clr\src\vm\coreassemblyspec.cpp @ 174] 0b 0000007e2cd7ce20 00007ffe57dbc9e9 coreclr!AppDomain::BindAssemblySpec+0x604 [f:\dd\ndp\clr\src\vm\appdomain.cpp @ 8870] 0c 0000007e2cd7d930 00007ffe57f99ce3 coreclr!AssemblySpec::LoadDomainAssembly+0x1dd [f:\dd\ndp\clr\src\vm\assemblyspec.cpp @ 1469] 0d (Inline Function) ---------------- coreclr!AssemblySpec::LoadAssembly+0x28 [f:\dd\ndp\clr\src\vm\assemblyspec.cpp @ 1202] 0e 0000007e2cd7d9f0 00007ffe539e9e92 coreclr!AssemblyNative::Load+0x4ff [f:\dd\ndp\clr\src\vm\assemblynative.cpp @ 279] 0f 0000007e2cd7ddf0 00007ffe53a1dcff mscorlib_ni!System.Reflection.RuntimeAssembly.InternalGetSatelliteAssembly(System.String, System.Globalization.CultureInfo, System.Version, Boolean, System.Threading.StackCrawlMark ByRef)+0x102 10 0000007e2cd7deb0 00007ffe53a1cf8b mscorlib_ni!System.Resources.ManifestBasedResourceGroveler.GetSatelliteAssembly(System.Globalization.CultureInfo, System.Threading.StackCrawlMark ByRef)+0xdf 11 0000007e2cd7df30 00007ffe539d216e mscorlib_ni!System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet(System.Globalization.CultureInfo, System.Collections.Generic.Dictionary2<System.String,System.Resources.ResourceSet>, Boolean, Boolean, System.Threading.StackCrawlMark ByRef)+0xdb 12 0000007e2cd7dfb0 00007ffe539d1f60 mscorlib_ni!System.Resources.ResourceManager.InternalGetResourceSet(System.Globalization.CultureInfo, Boolean, Boolean, System.Threading.StackCrawlMark ByRef)+0x1fe 13 0000007e2cd7e050 00007ffe539d2d39 mscorlib_ni!System.Resources.ResourceManager.InternalGetResourceSet(System.Globalization.CultureInfo, Boolean, Boolean)+0x30 14 0000007e2cd7e090 00007ffdf842b94f mscorlib_ni!System.Resources.ResourceManager.GetString(System.String, System.Globalization.CultureInfo)+0x1a9 15 0000007e2cd7e120 00007ffdf842b8b2 System_CommandLine!System.CommandLine.HelpTextGenerator.WriteUsage(System.Text.StringBuilder, System.String, System.Collections.Generic.IEnumerable1<System.String>, Int32)+0x2f*** WARNING: Unable to verify checksum for System.CommandLine.dll * ERROR: Module load completed but symbols could not be loaded for System.CommandLine.dll 16 0000007e2cd7e1b0 00007ffdf8428af1 System_CommandLine!System.CommandLine.HelpTextGenerator.WriteHelpPage(System.Text.StringBuilder, HelpPage, Int32)+0x22 17 0000007e2cd7e1f0 00007ffdf84289de System_CommandLine!System.CommandLine.HelpTextGenerator.Generate(System.CommandLine.ArgumentSyntax, Int32)+0xf1 18 0000007e2cd7e280 00007ffdf8413f6d System_CommandLine!System.CommandLine.ArgumentSyntax.GetHelpText()+0xe 19 0000007e2cd7e2b0 00007ffdf841358e dotnet_compile_csc_22c97310000!Microsoft.DotNet.Tools.Compiler.Csc.Program+<>c__DisplayClass1_0.b__0(System.CommandLine.ArgumentSyntax)+0x20d * WARNING: Unable to verify checksum for dotnet-compile-csc.dll [D:\github\cli-rel-latest\src\Microsoft.DotNet.Tools.Compiler.Csc\Program.cs @ 60] 1a 0000007e2cd7e360 00007ffdf8412a27 System_CommandLine!System.CommandLine.ArgumentSyntax.Parse(System.Collections.Generic.IEnumerable1<System.String>, System.Action1<System.CommandLine.ArgumentSyntax>)+0x3e 1b 0000007e2cd7e3a0 00007ffe5811a823 dotnet_compile_csc_22c97310000!Microsoft.DotNet.Tools.Compiler.Csc.Program.Main(System.String[])+0x1a7 [D:\github\cli-rel-latest\src\Microsoft.DotNet.Tools.Compiler.Csc\Program.cs @ 39] 1c 0000007e2cd7e6b0 00007ffe57dbb787 coreclr!CallDescrWorkerInternal+0x83 [f:\dd\ndp\clr\src\vm\amd64\CallDescrWorkerAMD64.asm @ 102] 1d 0000007e2cd7e6f0 00007ffe57dc1ae2 coreclr!MethodDescCallSite::CallTargetWorker+0x20f [f:\dd\ndp\clr\src\vm\callhelpers.cpp @ 654] 1e (Inline Function) ---------------- coreclr!MethodDescCallSite::Call_RetArgSlot+0x5 [f:\dd\ndp\clr\src\vm\callhelpers.h @ 421] 1f 0000007e2cd7e800 00007ffe57dc1dc9 coreclr!RunMain+0x226 [f:\dd\ndp\clr\src\vm\assembly.cpp @ 2595] 20 0000007e2cd7ea70 00007ffe57d53344 coreclr!Assembly::ExecuteMainMethod+0xd9 [f:\dd\ndp\clr\src\vm\assembly.cpp @ 2716] 21 0000007e2cd7ed40 00007ffe57d52bbb coreclr!CorHost2::ExecuteAssembly+0x1e0 [f:\dd\ndp\clr\src\vm\corhost.cpp @ 1349] *** WARNING: Unable to verify checksum for hostpolicy.dll 22 0000007e2cd7ee40 00007ffe73538c28 coreclr!coreclr_execute_assembly+0x123 [f:\dd\ndp\clr\src\dlls\mscoree\unixinterface.cpp @ 371] 23 0000007e2cd7eed0 00007ffe7352eade hostpolicy!coreclr::execute_assembly+0x88 [d:\github\cli-rel-latest\src\corehost\cli\coreclr.cpp @ 110] 24 0000007e2cd7ef10 00007ffe7352ee15 hostpolicy!run+0xa1e [d:\github\cli-rel-latest\src\corehost\cli\hostpolicy.cpp @ 203] *** WARNING: Unable to verify checksum for dotnet-compile-csc.exe 25 0000007e2cd7f6f0 00007ff6b8fcda34 hostpolicy!corehost_main+0x105 [d:\github\cli-rel-latest\src\corehost\cli\hostpolicy.cpp @ 247] 26 0000007e2cd7f920 00007ff6b903e404 dotnet_compile_csc!wmain+0x124 [d:\github\cli-rel-latest\src\corehost\corehost.cpp @ 117] 27 0000007e2cd7fa40 00007ff6b903e29e dotnet_compile_csc!invoke_main+0x34 [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl @ 90] 28 0000007e2cd7fa80 00007ff6b903e15e dotnet_compile_csc!__scrt_common_main_seh+0x12e [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl @ 264] 29 0000007e2cd7fae0 00007ff6b903e429 dotnet_compile_csc!__scrt_common_main+0xe [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl @ 309] 2a 0000007e2cd7fb10 00007ffe94338102 dotnet_compile_csc!wmainCRTStartup+0x9 [f:\dd\vctools\crt\vcstartup\src\startup\exe_wmain.cpp @ 17] 2b 0000007e2cd7fb40 00007ffe9675c2e4 kernel32!BaseThreadInitThunk+0x22 [d:\th\base\win32\client\thread.c @ 64] 2c 0000007e2cd7fb70 00000000`00000000 ntdll!RtlUserThreadStart+0x34 [d:\th\minkernel\ntdll\rtlstrt.c @ 994]