Repository navigation
Description
Crash seen when running the following CoreCLR test on the mono runtime from the dotnet\runtime repo.
Repro : Command to run individual tests : From the dotnet\runtime repo src\mono\netcore run this command or relevant one for a particular test - make run-tests-coreclr CoreClrTest="bash ../../artifacts/tests/coreclr/OSX.x64.Debug/reflection/DefaultInterfaceMethods/GetInterfaceMapConsumer/GetInterfaceMapConsumer.sh"
Crash report :
=================================================================
External Debugger Dump:
=================================================================
/Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/reflection/DefaultInterfaceMethods/GetInterfaceMapConsumer/GetInterfaceMapConsumer.sh: line 275: 87324 Abort trap: 6 $LAUNCHER
Return code: 1
Raw output file: /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/reflection/DefaultInterfaceMethods/Reports/reflection.DefaultInterfaceMethods/GetInterfaceMapConsumer/GetInterfaceMapConsumer.output.txt
Raw output:
BEGIN EXECUTION
/Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Tests/Core_Root/corerun GetInterfaceMapConsumer.dll ''
System.RuntimeTypeHandle DefaultMethod() (IFoo`1[Fooer]) - System.RuntimeTypeHandle DefaultMethod() (IFoo`1[Fooer]) - FAIL
Int32 OtherMethod(Int32) (IFoo`1[Fooer]) - Int32 OtherMethod(Int32) (IBar`1[Fooer]) - FAIL
Int32 DefaultMethod(Int32) (IFoo) - Int32 DefaultMethod(Int32) (IFoo) - FAIL
Int32 OtherMethod(Int32) (IFoo) - Int32 OtherMethod(Int32) (IBar) - FAIL
Int32 InstanceMethod(Int32) (IFoo) - Int32 OtherMethod(Int32) (IBar`1[Fooer]) - UNEXPECTED
Int32 StaticMethod(Int32) (IFoo) - System.RuntimeTypeHandle DefaultMethod() (IFoo`1[Fooer]) - UNEXPECTED
=================================================================
Native Crash Reporting
=================================================================
Got a segv while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================
=================================================================
Native stacktrace:
=================================================================
0x101a624b2 - /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Tests/Core_Root/libcoreclr.dylib : mono_dump_native_crash_info
0x101a04105 - /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Tests/Core_Root/libcoreclr.dylib : mono_handle_native_crash
0x101c2b387 - /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Tests/Core_Root/libcoreclr.dylib : altstack_handle_and_restore.cold.1
0x101a5cdee - /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Tests/Core_Root/libcoreclr.dylib : altstack_handle_and_restore
0x101b74481 - /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Tests/Core_Root/libcoreclr.dylib : method_object_construct
0x101b73534 - /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Tests/Core_Root/libcoreclr.dylib : check_or_construct_handle
0x101aee3cf - /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Tests/Core_Root/libcoreclr.dylib : ves_icall_RuntimeType_GetInterfaceMapData
0x101afef83 - /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Tests/Core_Root/libcoreclr.dylib : ves_icall_RuntimeType_GetInterfaceMapData_raw
0x101fa636f - Unknown
=================================================================
Telemetry Dumper:
=================================================================
Pkilling 0x123145509298176x from 0x4553166272x
Entering thread summarizer pause from 0x4553166272x
Finished thread summarizer pause from 0x4553166272x.
Waiting for dumping threads to resume
=================================================================
Basic Fault Address Reporting
=================================================================
Memory around native instruction pointer (0x101b74481):0x101b74471 49 89 d4 49 89 f6 49 89 fd 41 c7 00 00 00 00 00 I..I..I..A......
0x101b74481 48 8b 5a 18 80 3b 2e 75 26 48 8d 35 0a c8 0d 00 H.Z..;.u&H.5....
0x101b74491 48 89 df e8 81 77 0b 00 85 c0 74 4b 48 8d 35 e5 H....w....tKH.5.
0x101b744a1 49 0e 00 48 89 df e8 6e 77 0b 00 85 c0 74 38 48 I..H...nw....t8H
=================================================================
Managed Stacktrace:
=================================================================
at <unknown> <0xffffffff>
at System.RuntimeType:GetInterfaceMapData <0x000be>
at System.RuntimeType:GetInterfaceMap <0x0015a>
at Program:Main <0x007e7>
at <Module>:runtime_invoke_int <0x000a5>
=================================================================
Expected: 100
Actual: 134
END EXECUTION - FAILED
Test Harness Exitcode is : 1
To run the test:
> set CORE_ROOT=/Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Tests/Core_Root
> /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/reflection/DefaultInterfaceMethods/GetInterfaceMapConsumer/GetInterfaceMapConsumer.sh
Expected: True
Actual: False
Stack Trace:
/Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/TestWrappers/reflection.DefaultInterfaceMethods/reflection.DefaultInterfaceMethods.XUnitWrapper.cs(237,0): at reflection_DefaultInterfaceMethods._GetInterfaceMapConsumer_GetInterfaceMapConsumer_._GetInterfaceMapConsumer_GetInterfaceMapConsumer_sh()
/Users/samarthpatel/Documents/DotNetRunTime/runtime/src/mono/netcore/System.Private.CoreLib/src/System/Reflection/RuntimeMethodInfo.cs(339,0): at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
Activity
Dotnet-GitSync-Bot commentedon Apr 1, 2020
I couldn't figure out the best area label to add to this issue. Please help me learn by adding exactly one area label.
CoffeeFlux commentedon Apr 5, 2020
These tests are all failing, so fixing out GetInterfaceMap lookups in this situation will probably resolve the crash as well as the failures. The IL for InvokeProvider defines:
and
I assume we aren't properly distinguishing between them.
SamMonoRT commentedon Apr 8, 2020
@CoffeeFlux - sending this your way.
jpobst commentedon Jun 19, 2020
This affects attempting to use Xamarin Android's
jnimarshalmethod-gen.exefor Android API-30, because it uses theType.GetInterfaceMapmethod against an interface with default methods. This Xamarin feature has been documented as "experimental" so we will still be shipping without this fix, but it will be good to get it working before targeting Android 11 is widespread.lambdageek commentedon Jun 19, 2020
I haven't tried to verify, but I bet it's this line
runtime/src/mono/mono/metadata/icall.c
Line 3027 in a8d8b4a
The problem is that with DIMs you can re-abstract methods, so some vtable entries for non-abstract classes are null. And
method_object_constructdoesn't check forNULLbefore dereferencingmethod[Mono.Android] API-30 stabilization (#4830)
[Mono.Android] API-30 stabilization (dotnet#4830)
[Mono.Android] API-30 stabilization (#4830) (#4843)
2 remaining items
Build XF test with jnimarshalmethod-gen
Build XF test with jnimarshalmethod-gen
Fixing the GetInterfaceMap tests for mono in the runtime repo.
Fixing the GetInterfaceMap tests for mono in the runtime repo. (#52566)