-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Closed
Description
Description
If you try to stop at a breakpoint (or step into) a default interface method inside a generic interface, Mono crashes with a native stacktrace.
Reproduction Steps
- Android application template (This happens for both Xamarin "Classic" and .NET 6)
- Paste in the following types:
class TestClass<T> : ITestGeneric<T>
{
}
interface ITestGeneric<T> : ITestBase
{
void ITestBase.DoThing () => Console.WriteLine ();
}
interface ITestBase
{
void DoThing ();
}
- Call DIM in
OnCreate:
var c = new TestClass<string> ();
((ITestBase)c).DoThing ();
Run and code will succeed.
- Set a breakpoint on the
Console.WriteLine ();and the process will crash when the breakpoint is hit.
Expected behavior
Debugger stops at breakpoint.
Actual behavior
Message printed in adb logcat:
01-27 16:03:21.871 23092 23113 E Lib_Sample_Net: * Assertion at /__w/1/s/src/mono/mono/mini/mini-exceptions.c:879, condition `klass' not met
--------- beginning of crash
01-27 16:03:21.872 23092 23113 F libc : Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 23113 (Debugger agent), pid 23092 (Lib_Sample_Net6)
01-27 16:03:21.889 14296 14305 W e.android.euic: Reducing the number of considered missed Gc histogram windows from 104 to 100
01-27 16:03:21.930 23121 23121 I crash_dump64: obtaining output fd from tombstoned, type: kDebuggerdTombstoneProto
01-27 16:03:21.931 828 828 I tombstoned: received crash request for pid 23113
01-27 16:03:21.932 23121 23121 I crash_dump64: performing dump of process 23092 (target tid = 23113)
01-27 16:03:21.945 23121 23121 E DEBUG : failed to read /proc/uptime: Permission denied
01-27 16:03:22.068 1794 2221 D ConnectivityService: NetReassign [no changes]
01-27 16:03:22.159 23121 23121 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
01-27 16:03:22.159 23121 23121 F DEBUG : Build fingerprint: 'google/bonito/bonito:12/SQ1A.211205.008/7888514:user/release-keys'
01-27 16:03:22.159 23121 23121 F DEBUG : Revision: 'MP1.0'
01-27 16:03:22.159 23121 23121 F DEBUG : ABI: 'arm64'
01-27 16:03:22.159 23121 23121 F DEBUG : Timestamp: 2022-01-27 16:03:21.944731316-0600
01-27 16:03:22.159 23121 23121 F DEBUG : Process uptime: 0s
01-27 16:03:22.159 23121 23121 F DEBUG : Cmdline: com.companyname.Generic_Binding_Lib_Sample_Net6
01-27 16:03:22.159 23121 23121 F DEBUG : pid: 23092, tid: 23113, name: Debugger agent >>> com.companyname.Generic_Binding_Lib_Sample_Net6 <<<
01-27 16:03:22.159 23121 23121 F DEBUG : uid: 10468
01-27 16:03:22.159 23121 23121 F DEBUG : signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
01-27 16:03:22.159 23121 23121 F DEBUG : x0 0000000000000000 x1 0000000000005a49 x2 0000000000000006 x3 0000007956a86320
01-27 16:03:22.159 23121 23121 F DEBUG : x4 6e6d6e6c2e627172 x5 6e6d6e6c2e627172 x6 6e6d6e6c2e627172 x7 7f7f7f7f7f7f7f7f
01-27 16:03:22.159 23121 23121 F DEBUG : x8 00000000000000f0 x9 da80a0e513e6a44f x10 0000000000000000 x11 ffffff80fffffbdf
01-27 16:03:22.159 23121 23121 F DEBUG : x12 0000000000000001 x13 000000000000005d x14 0000007956a851c0 x15 0033cca14d03d5e0
01-27 16:03:22.159 23121 23121 F DEBUG : x16 0000007c7040e050 x17 0000007c703eaeb0 x18 000000795668c000 x19 0000000000005a34
01-27 16:03:22.159 23121 23121 F DEBUG : x20 0000000000005a49 x21 00000000ffffffff x22 0000000000000000 x23 000000795a516c38
01-27 16:03:22.159 23121 23121 F DEBUG : x24 0000007956a86ac0 x25 0000007b5709ebc8 x26 0000007956a86ac0 x27 0000007956a86bc0
01-27 16:03:22.159 23121 23121 F DEBUG : x28 0000007956a879f0 x29 0000007956a863a0
01-27 16:03:22.159 23121 23121 F DEBUG : lr 0000007c7039dba0 sp 0000007956a86300 pc 0000007c7039dbcc pst 0000000000000000
01-27 16:03:22.159 23121 23121 F DEBUG : backtrace:
01-27 16:03:22.159 23121 23121 F DEBUG : #00 pc 000000000004fbcc /apex/com.android.runtime/lib64/bionic/libc.so (abort+164) (BuildId: ba489d4985c0cf173209da67405662f9)
01-27 16:03:22.159 23121 23121 F DEBUG : #01 pc 0000000000031598 /data/app/~~eFrrzAI6TJ0O3PHLh-p2Qw==/com.companyname.Generic_Binding_Lib_Sample_Net6-BJMFf4uedhZHAVwqzceHXA==/lib/arm64/libmonodroid.so (xamarin::android::internal::MonodroidRuntime::mono_log_handler(char const*, char const*, char const*, int, void*)+144) (BuildId: ab750de5bc2960d28ad97dee10de0c633f16f369)
01-27 16:03:22.159 23121 23121 F DEBUG : #02 pc 0000000000266afc /data/app/~~eFrrzAI6TJ0O3PHLh-p2Qw==/com.companyname.Generic_Binding_Lib_Sample_Net6-BJMFf4uedhZHAVwqzceHXA==/lib/arm64/libmonosgen-2.0.so (BuildId: 4881f6ac8ca60bdb4b0c44c72440267b1b8f2a34)
01-27 16:03:22.159 23121 23121 F DEBUG : #03 pc 0000000000266c28 /data/app/~~eFrrzAI6TJ0O3PHLh-p2Qw==/com.companyname.Generic_Binding_Lib_Sample_Net6-BJMFf4uedhZHAVwqzceHXA==/lib/arm64/libmonosgen-2.0.so (BuildId: 4881f6ac8ca60bdb4b0c44c72440267b1b8f2a34)
01-27 16:03:22.159 23121 23121 F DEBUG : #04 pc 0000000000266c6c /data/app/~~eFrrzAI6TJ0O3PHLh-p2Qw==/com.companyname.Generic_Binding_Lib_Sample_Net6-BJMFf4uedhZHAVwqzceHXA==/lib/arm64/libmonosgen-2.0.so (BuildId: 4881f6ac8ca60bdb4b0c44c72440267b1b8f2a34)
01-27 16:03:22.159 23121 23121 F DEBUG : #05 pc 00000000001e7cfc /data/app/~~eFrrzAI6TJ0O3PHLh-p2Qw==/com.companyname.Generic_Binding_Lib_Sample_Net6-BJMFf4uedhZHAVwqzceHXA==/lib/arm64/libmonosgen-2.0.so (mono_get_generic_context_from_stack_frame+312) (BuildId: 4881f6ac8ca60bdb4b0c44c72440267b1b8f2a34)
01-27 16:03:22.159 23121 23121 F DEBUG : #06 pc 00000000001e8198 /data/app/~~eFrrzAI6TJ0O3PHLh-p2Qw==/com.companyname.Generic_Binding_Lib_Sample_Net6-BJMFf4uedhZHAVwqzceHXA==/lib/arm64/libmonosgen-2.0.so (BuildId: 4881f6ac8ca60bdb4b0c44c72440267b1b8f2a34)
01-27 16:03:22.159 23121 23121 F DEBUG : #07 pc 00000000001e8498 /data/app/~~eFrrzAI6TJ0O3PHLh-p2Qw==/com.companyname.Generic_Binding_Lib_Sample_Net6-BJMFf4uedhZHAVwqzceHXA==/lib/arm64/libmonosgen-2.0.so (BuildId: 4881f6ac8ca60bdb4b0c44c72440267b1b8f2a34)
01-27 16:03:22.159 23121 23121 F DEBUG : #08 pc 00000000001e6db0 /data/app/~~eFrrzAI6TJ0O3PHLh-p2Qw==/com.companyname.Generic_Binding_Lib_Sample_Net6-BJMFf4uedhZHAVwqzceHXA==/lib/arm64/libmonosgen-2.0.so (mono_walk_stack_with_state+80) (BuildId: 4881f6ac8ca60bdb4b0c44c72440267b1b8f2a34)
01-27 16:03:22.159 23121 23121 F DEBUG : #09 pc 000000000000aec4 /data/app/~~eFrrzAI6TJ0O3PHLh-p2Qw==/com.companyname.Generic_Binding_Lib_Sample_Net6-BJMFf4uedhZHAVwqzceHXA==/lib/arm64/libmono-component-debugger.so (BuildId: 8f2c698b57b4e77652e4a2f24d841741b7be4cc4)
01-27 16:03:22.159 23121 23121 F DEBUG : #10 pc 0000000000010da0 /data/app/~~eFrrzAI6TJ0O3PHLh-p2Qw==/com.companyname.Generic_Binding_Lib_Sample_Net6-BJMFf4uedhZHAVwqzceHXA==/lib/arm64/libmono-component-debugger.so (BuildId: 8f2c698b57b4e77652e4a2f24d841741b7be4cc4)
01-27 16:03:22.159 23121 23121 F DEBUG : #11 pc 00000000000171c8 /data/app/~~eFrrzAI6TJ0O3PHLh-p2Qw==/com.companyname.Generic_Binding_Lib_Sample_Net6-BJMFf4uedhZHAVwqzceHXA==/lib/arm64/libmono-component-debugger.so (BuildId: 8f2c698b57b4e77652e4a2f24d841741b7be4cc4)
01-27 16:03:22.159 23121 23121 F DEBUG : #12 pc 00000000000b11b0 /data/app/~~eFrrzAI6TJ0O3PHLh-p2Qw==/com.companyname.Generic_Binding_Lib_Sample_Net6-BJMFf4uedhZHAVwqzceHXA==/lib/arm64/libmonosgen-2.0.so (BuildId: 4881f6ac8ca60bdb4b0c44c72440267b1b8f2a34)
01-27 16:03:22.159 23121 23121 F DEBUG : #13 pc 00000000000b105c /data/app/~~eFrrzAI6TJ0O3PHLh-p2Qw==/com.companyname.Generic_Binding_Lib_Sample_Net6-BJMFf4uedhZHAVwqzceHXA==/lib/arm64/libmonosgen-2.0.so (BuildId: 4881f6ac8ca60bdb4b0c44c72440267b1b8f2a34)
01-27 16:03:22.159 23121 23121 F DEBUG : #14 pc 00000000000b1910 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+264) (BuildId: ba489d4985c0cf173209da67405662f9)
01-27 16:03:22.159 23121 23121 F DEBUG : #15 pc 00000000000513f0 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: ba489d4985c0cf173209da67405662f9)
Visual Studio reports this as:
EXCEPTION: Mono.Debugging.Soft.DisconnectedException: The connection with the debugger has been lost. The target application may have exited. ---> Mono.Debugger.Soft.VMDisconnectedException: Exception of type 'Mono.Debugger.Soft.VMDisconnectedException' was thrown.
at Mono.Debugger.Soft.ThreadMirror.GetFrames() in C:\a\1\s\External\debugger-libs\Mono.Debugger.Soft\Mono.Debugger.Soft\ThreadMirror.cs:line 28
at Mono.Debugging.Soft.SoftDebuggerBacktrace..ctor(SoftDebuggerSession session, ThreadMirror thread) in C:\a\1\s\External\debugger-libs\Mono.Debugging.Soft\SoftDebuggerBacktrace.cs:line 64
at Mono.Debugging.Soft.SoftDebuggerSession.HandleBreakEventSet(Event[] es, Boolean dequeuing) in C:\a\1\s\External\debugger-libs\Mono.Debugging.Soft\SoftDebuggerSession.cs:line 2167
at Mono.Debugging.Soft.SoftDebuggerSession.EventHandler() in C:\a\1\s\External\debugger-libs\Mono.Debugging.Soft\SoftDebuggerSession.cs:line 1786
Regression?
No response
Known Workarounds
No response
Configuration
Google Pixel 3a XL
Microsoft Visual Studio Enterprise 2022 (64-bit)
Version 17.0.5
Xamarin.Android SDK 12.1.0.5 (d17-0/6b0e6b2)
Xamarin.Android Reference Assemblies and MSBuild support.
Mono: c633fe9
Java.Interop: xamarin/java.interop/d17-0@febb1367
ProGuard: Guardsquare/proguard@912d149
SQLite: xamarin/sqlite@a575761
Xamarin.Android Tools: xamarin/xamarin-android-tools/d17-0@a5194e9
Other information
No response