Skip to content

Conversation

@MihaZupan
Copy link
Member

@MihaZupan MihaZupan added this to the 9.0.0 milestone Sep 15, 2023
@MihaZupan MihaZupan self-assigned this Sep 15, 2023
@ghost
Copy link

ghost commented Sep 15, 2023

Tagging subscribers to this area: @dotnet/area-meta
See info in area-owners.md if you want to be subscribed.

Issue Details

Followup after dotnet/roslyn-analyzers#6898, #91727

Author: MihaZupan
Assignees: MihaZupan
Labels:

area-Meta

Milestone: 9.0.0

@MihaZupan
Copy link
Member Author

@MichalStrehovsky I'm seeing odd Segmentation fault failures in nativeaot.CustomMain and nativeaot.GenerateUnmanagedEntryPoints -- does that look familiar / is there any chance they're related to this PR (it does touch nativeaot's corelib)?

@MichalStrehovsky
Copy link
Member

@MichalStrehovsky I'm seeing odd Segmentation fault failures in nativeaot.CustomMain and nativeaot.GenerateUnmanagedEntryPoints -- does that look familiar / is there any chance they're related to this PR (it does touch nativeaot's corelib)?

If you click through the test results, you'll find a link to how to download the crash dump for this (it's runfo get-helix-payload -j 02391e98-2ed5-4279-97a4-f74c743cbe2c -w nativeaot.SmokeTests -o c:\hell).

We're crashing on a stack overflow, the repeating part is:

 	Exceptions.exe!S_P_CoreLib_System_ThrowHelper__ThrowArgumentNullException() Line 298	Unknown
 	Exceptions.exe!S_P_CoreLib_System_MemoryExtensions__IndexOfAny_7<Char>() Line 2102	Unknown
 	Exceptions.exe!S_P_CoreLib_System_MemoryExtensions__ContainsAny_7<Char>() Line 496	Unknown
 	Exceptions.exe!S_P_CoreLib_System_Reflection_Runtime_General_Helpers__EscapeTypeNameIdentifier() Line 115	Unknown
 	Exceptions.exe!S_P_CoreLib_System_Reflection_Runtime_TypeInfos_NativeFormat_NativeFormatRuntimeNamedTypeInfo__get_Name() Line 197	Unknown
 	Exceptions.exe!S_P_CoreLib_System_Reflection_Runtime_TypeInfos_RuntimeNamedTypeInfo__get_FullName() Line 96	Unknown
 	Exceptions.exe!S_P_CoreLib_System_Reflection_Runtime_TypeInfos_NativeFormat_NativeFormatRuntimeNamedTypeInfo__ToString() Line 147	Unknown
 	Exceptions.exe!S_P_CoreLib_System_Exception__AppendExceptionStackFrame() Line 141	Unknown
 	Exceptions.exe!S_P_CoreLib_System_Runtime_EH__AppendExceptionStackFrameViaClasslib() Line 270	Unknown
 	Exceptions.exe!S_P_CoreLib_System_Runtime_EH__UpdateStackTrace() Line 881	Unknown
 	Exceptions.exe!S_P_CoreLib_System_Runtime_EH__DispatchEx() Line 707	Unknown
 	Exceptions.exe!S_P_CoreLib_System_Runtime_EH__RhThrowEx() Line 641	Unknown
 	Exceptions.exe!RhpThrowEx() Line 190	Unknown
 	Exceptions.exe!S_P_CoreLib_System_ThrowHelper__ThrowArgumentNullException() Line 298	Unknown

This by itself doesn't make much sense. The way we got into the repeating part is:

 	Exceptions.exe!S_P_CoreLib_System_ThrowHelper__ThrowArgumentNullException() Line 298	Unknown
 	Exceptions.exe!S_P_CoreLib_System_MemoryExtensions__IndexOfAny_7<Char>() Line 2102	Unknown
 	Exceptions.exe!S_P_CoreLib_System_MemoryExtensions__ContainsAny_7<Char>() Line 496	Unknown
 	Exceptions.exe!S_P_CoreLib_System_Reflection_Runtime_General_Helpers__EscapeTypeNameIdentifier() Line 115	Unknown
 	Exceptions.exe!S_P_CoreLib_System_Reflection_Runtime_TypeInfos_NativeFormat_NativeFormatRuntimeNamedTypeInfo__get_Name() Line 197	Unknown
 	Exceptions.exe!S_P_CoreLib_System_Reflection_Runtime_TypeInfos_RuntimeNamedTypeInfo__get_FullName() Line 96	Unknown
 	Exceptions.exe!S_P_CoreLib_System_Reflection_Runtime_TypeInfos_NativeFormat_NativeFormatRuntimeNamedTypeInfo__ToString() Line 147	Unknown
 	Exceptions.exe!S_P_CoreLib_System_Reflection_Runtime_TypeInfos_RuntimeTypeInfo__EstablishDebugName() Line 739	Unknown
 	Exceptions.exe!S_P_CoreLib_System_Reflection_Runtime_TypeInfos_NativeFormat_NativeFormatRuntimeNamedTypeInfo__GetRuntimeNamedTypeInfo() Line 80	Unknown
 	Exceptions.exe!S_P_CoreLib_System_Reflection_Runtime_General_TypeUnifier__GetNamedType_0() Line 57	Unknown
 	Exceptions.exe!S_P_CoreLib_Internal_Reflection_Core_Execution_ExecutionDomain__GetNamedTypeForHandle() Line 106	Unknown
 	Exceptions.exe!S_P_Reflection_Execution_Internal_Reflection_Execution_ReflectionExecutionDomainCallbacksImplementation__GetNamedTypeForHandle() Line 40	Unknown
 	Exceptions.exe!S_P_CoreLib_Internal_Reflection_Core_NonPortable_RuntimeTypeUnifier__GetRuntimeTypeBypassCache() Line 91	Unknown
 	Exceptions.exe!S_P_CoreLib_System_Type__GetTypeFromMethodTableSlow() Line 56	Unknown
 	Exceptions.exe!S_P_CoreLib_System_Type__GetTypeFromMethodTable() Line 41	Unknown
 	Exceptions.exe!S_P_CoreLib_System_Type__GetTypeFromHandle() Line 24	Unknown
 	Exceptions.exe!UInt32__CreateChecked<Char>() Line 630	Unknown
 	Exceptions.exe!S_P_CoreLib_System_Buffers_SearchValues__TryGetSingleRange<Char>() Line 194	Unknown
 	Exceptions.exe!S_P_CoreLib_System_Buffers_SearchValues__Create_0() Line 86	Unknown
 	Exceptions.exe!S_P_CoreLib_System_Reflection_Runtime_General_Helpers___cctor() Line 27	Unknown
 	Exceptions.exe!S_P_CoreLib_System_Runtime_CompilerServices_ClassConstructorRunner__EnsureClassConstructorRun() Line 88	Unknown
 	Exceptions.exe!S_P_CoreLib_System_Runtime_CompilerServices_ClassConstructorRunner__CheckStaticClassConstructionReturnGCStaticBase() Line 35	Unknown
 	Exceptions.exe!S_P_CoreLib_System_Reflection_Runtime_General_Helpers__EscapeTypeNameIdentifier() Line 115	Unknown
 	Exceptions.exe!S_P_CoreLib_System_Reflection_Runtime_TypeInfos_NativeFormat_NativeFormatRuntimeNamedTypeInfo__get_Name() Line 197	Unknown
 	Exceptions.exe!S_P_CoreLib_System_Reflection_Runtime_TypeInfos_RuntimeNamedTypeInfo__get_FullName() Line 96	Unknown
 	Exceptions.exe!S_P_CoreLib_System_Reflection_Runtime_TypeInfos_NativeFormat_NativeFormatRuntimeNamedTypeInfo__ToString() Line 147	Unknown
 	Exceptions.exe!S_P_CoreLib_System_Reflection_Runtime_TypeInfos_RuntimeTypeInfo__EstablishDebugName() Line 739	Unknown
 	Exceptions.exe!S_P_CoreLib_System_Reflection_Runtime_TypeInfos_NativeFormat_NativeFormatRuntimeNamedTypeInfo__GetRuntimeNamedTypeInfo() Line 80	Unknown
 	Exceptions.exe!S_P_CoreLib_System_Reflection_Runtime_General_TypeUnifier__GetNamedType_0() Line 57	Unknown
 	Exceptions.exe!S_P_CoreLib_Internal_Reflection_Core_Execution_ExecutionDomain__GetNamedTypeForHandle() Line 106	Unknown
 	Exceptions.exe!S_P_Reflection_Execution_Internal_Reflection_Execution_ReflectionExecutionDomainCallbacksImplementation__GetNamedTypeForHandle() Line 40	Unknown
 	Exceptions.exe!S_P_CoreLib_Internal_Reflection_Core_NonPortable_RuntimeTypeUnifier__GetRuntimeTypeBypassCache() Line 91	Unknown
 	Exceptions.exe!S_P_CoreLib_System_Type__GetTypeFromMethodTableSlow() Line 56	Unknown
 	Exceptions.exe!S_P_CoreLib_System_Type__GetTypeFromMethodTable() Line 41	Unknown
 	Exceptions.exe!S_P_CoreLib_System_Type__GetTypeFromHandle() Line 24	Unknown
 	Exceptions.exe!S_P_CoreLib_System_Collections_Generic_Dictionary_2<System___Canon__System___Canon>___ctor_2() Line 65	Unknown
 	Exceptions.exe!S_P_CoreLib_System_Collections_Generic_Dictionary_2<System___Canon__System___Canon>___ctor_0() Line 42	Unknown
 	Exceptions.exe!S_P_CoreLib_System_AppContext__InitializeDataStore() Line 17	Unknown
 	Exceptions.exe!S_P_CoreLib_System_AppContext___cctor() Line 18	Unknown

The problem is that this PR is introducing use of reflection into the implementation of reflection. That doesn't lead to anything good.

@MihaZupan
Copy link
Member Author

Thanks!
I've disabled this rule for that file in this case given it's the only problematic site.

@MihaZupan MihaZupan closed this Sep 20, 2023
@MihaZupan MihaZupan reopened this Sep 20, 2023
@MihaZupan MihaZupan merged commit e235aef into dotnet:main Sep 20, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Oct 20, 2023
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