mono
mono copied to clipboard
AppDomain Unload GC Crash
I'm sure the issue is something in my program, but I'm just trying to get some further information from mono's runtime to how I can determine what's going on.
When attempting to unload an AppDomain I getting the following crash from GC:
Thread 16 (Thread 0xf00feb40 (LWP 2503)):
#0 0xf7fc3049 in __kernel_vsyscall ()
#1 0xf7ece697 in waitpid () from /lib/libpthread.so.0
#2 0x566e765b in dump_native_stacktrace (signal=signal@entry=0x56975ae5 "SIGABRT", mctx=mctx@entry=0xf00fd5f8) at mini-posix.c:1112
#3 0x566e77af in mono_dump_native_crash_info (signal=0x56975ae5 "SIGABRT", mctx=0xf00fd5f8, info=0xf00fd64c) at mini-posix.c:1156
#4 0x566a2f72 in mono_handle_native_crash (signal=0x56975ae5 "SIGABRT", mctx=0xf00fd5f8, info=0xf00fd64c) at mini-exceptions.c:3423
#5 0x566e68c4 in sigabrt_signal_handler (_dummy=6, _info=0xf00fd64c, context=0xf00fd6cc) at mini-posix.c:234
#6
Checking the source code, this appears to happen when the object's description field is not valid. So my question is really, how can I debug this further?
I have tried using trace and logging statements, but there is no logging at this deep a level (which is understandable).
My though is I have a pointer to an object that was already collected at an earlier time, but the reference pointer is still alive, but not sure. I'm far from an GC expert.
This is with mono 6.12.0.107
After a bunch of debugging and head smashing. I got a build to generate the following GC log information.
Line 25791: 2023-09-15 13:28:53 Allocated pinned object 0xf7944150, vtable: 0xf139f188 (Context), size: 48d
Line 80051: 2023-09-15 13:28:54 Added finalizer for object: 0xf7944150 (Context) (18) to old table
Line 98659: 2023-09-15 13:28:54 Overwrote root at 0xf13655b8 with 0xf7944150
Line 185330: 2023-09-15 13:35:55 Overwrote root at 0xf13655b8 with 0xf7944150
Line 191570: 2023-09-15 13:35:55 Unregistering finalizer for object: 0xf7944150 (Context)
Line 191571: 2023-09-15 13:35:55 Enqueuing object for finalization: 0xf7944150 (Context) (64)
Line 191647: 2023-09-15 13:35:55 Finalizing object 0xf7944150 (Context)
Line 193273: 2023-09-15 13:35:55 Overwrote root at 0xf13655b8 with 0xf7944150
Line 194193: 2023-09-15 13:35:55 Need to cleanup object 0xf7944150
Line 226036: 2023-09-15 13:35:55 Need to cleanup object 0xf7944150
Line 232669: 2023-09-15 13:35:55 Error: gray object 0xf7944150 (desc: 0)
The Error message at the end is inplace of the assert that the object scan normally has:
I'm also facing this issue on Android. I got nothing except this line in the logs
* Assertion: should not be reached at /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mono/sgen/sgen-scan-object.h:91