Skip to content

Instantly share code, notes, and snippets.

@chamons
Created August 17, 2016 21:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chamons/6e6ae4bdbb1ae0c104ca0d8b1f3e5eeb to your computer and use it in GitHub Desktop.
Save chamons/6e6ae4bdbb1ae0c104ca0d8b1f3e5eeb to your computer and use it in GitHub Desktop.
$ MONO_GC_DEBUG=verify-before-collections,check-at-minor-collections /Users/donblas/Projects/XMTestApp/XMTestApp/bin/Debug/XMTestApp.app/Contents/MacOS/XMTestApp
How did we get to sweep a block that's being marked or being checked?
Stacktrace:
at <unknown> <0xffffffff>
at (wrapper managed-to-native) object.__icall_wrapper_mono_gc_alloc_vector (intptr,intptr,intptr) <IL 0x00009, 0x00065>
at (wrapper alloc) object.AllocVector (intptr,intptr) <IL 0x000b4, 0x00164>
at System.Collections.Generic.Dictionary`2<TKey_REF, TValue_REF>.Resize (int,bool) [0x0001f] in /Users/donblas/Programming/macios/master/xamarin-macios/_mac-build/Library/Frameworks/Xamarin.Mac.framework/Versions/git/src/mono/mcs/class/referencesource/mscorlib/system/collections/generic/dictionary.cs:447
at System.Collections.Generic.Dictionary`2<TKey_REF, TValue_REF>.Resize () [0x00000] in /Users/donblas/Programming/macios/master/xamarin-macios/_mac-build/Library/Frameworks/Xamarin.Mac.framework/Versions/git/src/mono/mcs/class/referencesource/mscorlib/system/collections/generic/dictionary.cs:440
at System.Collections.Generic.Dictionary`2<TKey_REF, TValue_REF>.Insert (TKey_REF,TValue_REF,bool) [0x0011f] in /Users/donblas/Programming/macios/master/xamarin-macios/_mac-build/Library/Frameworks/Xamarin.Mac.framework/Versions/git/src/mono/mcs/class/referencesource/mscorlib/system/collections/generic/dictionary.cs:356
at System.Collections.Generic.Dictionary`2<TKey_REF, TValue_REF>.set_Item (TKey_REF,TValue_REF) [0x00000] in /Users/donblas/Programming/macios/master/xamarin-macios/_mac-build/Library/Frameworks/Xamarin.Mac.framework/Versions/git/src/mono/mcs/class/referencesource/mscorlib/system/collections/generic/dictionary.cs:187
at Registrar.SharedDynamic.PrepareInterfaceMethodMapping (System.Type) [0x000b2] in /Users/donblas/Programming/macios/master/xamarin-macios/src/ObjCRuntime/DynamicRegistrar.cs:50
at Registrar.DynamicRegistrar.PrepareMethodMapping (System.Type) [0x00002] in /Users/donblas/Programming/macios/master/xamarin-macios/src/ObjCRuntime/DynamicRegistrar.cs:268
at Registrar.Registrar.RegisterTypeUnsafe (System.Type,System.Collections.Generic.List`1<System.Exception>&) [0x00df9] in /Users/donblas/Programming/macios/master/xamarin-macios/src/ObjCRuntime/Registrar.cs:1767
at Registrar.Registrar.RegisterAssembly (System.Reflection.Assembly) [0x000b0] in /Users/donblas/Programming/macios/master/xamarin-macios/src/ObjCRuntime/Registrar.cs:1933
at ObjCRuntime.Runtime.RegisterAssembly (System.Reflection.Assembly) [0x0017f] in /Users/donblas/Programming/macios/master/xamarin-macios/src/ObjCRuntime/Runtime.cs:489
at ObjCRuntime.Runtime.RegisterAssembly (intptr) [0x0000c] in /Users/donblas/Programming/macios/master/xamarin-macios/src/ObjCRuntime/Runtime.cs:304
at ObjCRuntime.Runtime.register_assembly (intptr,int&) [0x00006] in /Users/donblas/Programming/macios/master/xamarin-macios/runtime/Delegates.generated.cs:114
at (wrapper native-to-managed) ObjCRuntime.Runtime.register_assembly (intptr,int&) <IL 0x00021, 0x000c2>
at <unknown> <0xffffffff>
at (wrapper managed-to-native) object.wrapper_native_0x10cf92630 () <IL 0x00008, 0x00052>
at ObjCRuntime.Runtime.EnsureInitialized () [0x0004b] in /Users/donblas/Programming/macios/master/xamarin-macios/src/ObjCRuntime/Runtime.mac.cs:115
at AppKit.NSApplication.Init () [0x00017] in /Users/donblas/Programming/macios/master/xamarin-macios/src/AppKit/NSApplication.cs:54
at XMTestApp.MainClass.Main (string[]) [0x00001] in /Users/donblas/Projects/XMTestApp/XMTestApp/Main.cs:9
at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object (object,intptr,intptr,intptr) <IL 0x00051, 0x000e0>
Native stacktrace:
0 XMTestApp 0x000000010d08dd2a mono_handle_native_sigsegv + 282
1 libsystem_platform.dylib 0x00007fff951d952a _sigtramp + 26
2 ??? 0x00007fff6e4a9672 0x0 + 140735043769970
3 libsystem_c.dylib 0x00007fff9b0ef6df abort + 129
4 XMTestApp 0x000000010d228e29 monoeg_log_default_handler + 105
5 XMTestApp 0x000000010d228f03 monoeg_g_log + 211
6 XMTestApp 0x000000010d1e9517 sweep_block + 295
7 XMTestApp 0x000000010d1d8f2b major_iterate_objects + 267
8 XMTestApp 0x000000010d1ca0dc sgen_check_whole_heap + 172
9 XMTestApp 0x000000010d1d4b06 major_copy_or_mark_from_roots + 182
10 XMTestApp 0x000000010d1d5302 major_start_collection + 386
11 XMTestApp 0x000000010d1d0c0e major_do_collection + 78
12 XMTestApp 0x000000010d1d00af sgen_perform_collection + 735
13 XMTestApp 0x000000010d1d752d sgen_los_alloc_large_inner + 93
14 XMTestApp 0x000000010d1c5039 sgen_alloc_obj_nolock + 105
15 XMTestApp 0x000000010d190e9b mono_gc_alloc_vector + 123
16 ??? 0x00000001148d70e6 0x0 + 4639781094
17 ??? 0x0000000114905a34 0x0 + 4639971892
Debug info from gdb:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Applications/Xcode8-beta6.app/Contents/SharedFrameworks/LLDB.framework/Resources/Python/lldb/__init__.py", line 98, in <module>
import six
ImportError: No module named six
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 'run_one_line' is not defined
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 'run_one_line' is not defined
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 'run_one_line' is not defined
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 'run_one_line' is not defined
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 'run_one_line' is not defined
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 'run_one_line' is not defined
(lldb) command source -s 0 '/tmp/mono-gdb-commands.qIxQNA'
Executing commands in '/tmp/mono-gdb-commands.qIxQNA'.
(lldb) process attach --pid 63396
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 'run_one_line' is not defined
-snip-
Process 63396 stopped
* thread #1: tid = 0x22882c, 0x00007fff8f11d582 libsystem_kernel.dylib`__wait4 + 10, name = 'tid_50f', queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
frame #0: 0x00007fff8f11d582 libsystem_kernel.dylib`__wait4 + 10
libsystem_kernel.dylib`__wait4:
-> 0x7fff8f11d582 <+10>: jae 0x7fff8f11d58c ; <+20>
0x7fff8f11d584 <+12>: movq %rax, %rdi
0x7fff8f11d587 <+15>: jmp 0x7fff8f1177f2 ; cerror
0x7fff8f11d58c <+20>: retq
Executable module set to "/Users/donblas/Projects/XMTestApp/XMTestApp/bin/Debug/XMTestApp.app/Contents/MacOS/XMTestApp".
Architecture set to: x86_64-apple-macosx.
(lldb) thread list
Process 63396 stopped
* thread #1: tid = 0x22882c, 0x00007fff8f11d582 libsystem_kernel.dylib`__wait4 + 10, name = 'tid_50f', queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
thread #2: tid = 0x22882e, 0x00007fff8f11d5e2 libsystem_kernel.dylib`__workq_kernreturn + 10
thread #3: tid = 0x22882f, 0x00007fff8f11defa libsystem_kernel.dylib`kevent_qos + 10, queue = 'com.apple.libdispatch-manager'
thread #4: tid = 0x228831, 0x00007fff8f11cdb6 libsystem_kernel.dylib`__psynch_cvwait + 10, name = 'SGen worker'
thread #5: tid = 0x228832, 0x00007fff8f116fae libsystem_kernel.dylib`semaphore_wait_trap + 10, name = 'Finalizer'
thread #6: tid = 0x228834, 0x00007fff8f11d5e2 libsystem_kernel.dylib`__workq_kernreturn + 10
(lldb) thread backtrace all
* thread #1: tid = 0x22882c, 0x00007fff8f11d582 libsystem_kernel.dylib`__wait4 + 10, name = 'tid_50f', queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
* frame #0: 0x00007fff8f11d582 libsystem_kernel.dylib`__wait4 + 10
frame #1: 0x000000010d08ddc1 XMTestApp`mono_handle_native_sigsegv(signal=<unavailable>, ctx=<unavailable>, info=<unavailable>) + 433 at mini-exceptions.c:2427 [opt]
frame #2: 0x00007fff951d952a libsystem_platform.dylib`_sigtramp + 26
frame #3: 0x00007fff8f11cf07 libsystem_kernel.dylib`__pthread_kill + 11
frame #4: 0x00007fff89dfe4ec libsystem_pthread.dylib`pthread_kill + 90
frame #5: 0x00007fff9b0ef6df libsystem_c.dylib`abort + 129
frame #6: 0x000000010d228e29 XMTestApp`monoeg_log_default_handler(log_domain=<unavailable>, log_level=<unavailable>, message=<unavailable>, unused_data=<unavailable>) + 105 at goutput.c:231 [opt]
frame #7: 0x000000010d228f03 XMTestApp`monoeg_g_log [inlined] monoeg_g_logv + 70 at goutput.c:111 [opt]
frame #8: 0x000000010d228ebd XMTestApp`monoeg_g_log(log_domain=0x0000000000000000, log_level=G_LOG_LEVEL_ERROR, format=<unavailable>) + 141 at goutput.c:121 [opt]
frame #9: 0x000000010d1e9517 XMTestApp`sweep_block(block=<unavailable>) + 295 at sgen-marksweep.c:1334 [opt]
frame #10: 0x000000010d1d8f2b XMTestApp`major_iterate_objects(flags=<unavailable>, callback=(XMTestApp`verify_object_pointers_callback at sgen-debug.c:442), data=0x0000000000000000) + 267 at sgen-marksweep.c:875 [opt]
frame #11: 0x000000010d1ca0dc XMTestApp`sgen_check_whole_heap(allow_missing_pinned=<unavailable>) + 172 at sgen-debug.c:462 [opt]
frame #12: 0x000000010d1d4b06 XMTestApp`major_copy_or_mark_from_roots(old_next_pin_slot=0x00007fff52c7e118, mode=COPY_OR_MARK_FROM_ROOTS_SERIAL, object_ops=0x000000010d3032e0) + 182 at sgen-gc.c:1709 [opt]
frame #13: 0x000000010d1d5302 XMTestApp`major_start_collection(reason=<unavailable>, concurrent=0, old_next_pin_slot=0x00007fff52c7e118) + 386 at sgen-gc.c:1922 [opt]
frame #14: 0x000000010d1d0c0e XMTestApp`major_do_collection(reason="LOS overflow", is_overflow=0, forced=0) + 78 at sgen-gc.c:2079 [opt]
frame #15: 0x000000010d1d00af XMTestApp`sgen_perform_collection(requested_size=10376, generation_to_collect=1, reason="LOS overflow", wait_to_finish=0, stw=1) + 735 at sgen-gc.c:2276 [opt]
frame #16: 0x000000010d1d752d XMTestApp`sgen_los_alloc_large_inner(vtable=0x00007fb35b1cc700, size=10376) + 93 at sgen-los.c:379 [opt]
frame #17: 0x000000010d1c5039 XMTestApp`sgen_alloc_obj_nolock(vtable=0x00007fb35b1cc700, size=<unavailable>) + 105 at sgen-alloc.c:191 [opt]
frame #18: 0x000000010d190e9b XMTestApp`mono_gc_alloc_vector(vtable=0x00007fb35b1cc700, size=10376, max_length=431) + 123 at sgen-mono.c:1761 [opt]
frame #19: 0x00000001148d70e6
thread #2: tid = 0x22882e, 0x00007fff8f11d5e2 libsystem_kernel.dylib`__workq_kernreturn + 10
frame #0: 0x00007fff8f11d5e2 libsystem_kernel.dylib`__workq_kernreturn + 10
frame #1: 0x00007fff89dfb578 libsystem_pthread.dylib`_pthread_wqthread + 1283
frame #2: 0x00007fff89df9341 libsystem_pthread.dylib`start_wqthread + 13
thread #3: tid = 0x22882f, 0x00007fff8f11defa libsystem_kernel.dylib`kevent_qos + 10, queue = 'com.apple.libdispatch-manager'
frame #0: 0x00007fff8f11defa libsystem_kernel.dylib`kevent_qos + 10
frame #1: 0x00007fff8dbb3165 libdispatch.dylib`_dispatch_mgr_invoke + 216
frame #2: 0x00007fff8dbb2dcd libdispatch.dylib`_dispatch_mgr_thread + 52
thread #4: tid = 0x228831, 0x00007fff8f11cdb6 libsystem_kernel.dylib`__psynch_cvwait + 10, name = 'SGen worker'
frame #0: 0x00007fff8f11cdb6 libsystem_kernel.dylib`__psynch_cvwait + 10
frame #1: 0x00007fff89dfc728 libsystem_pthread.dylib`_pthread_cond_wait + 767
frame #2: 0x000000010d1f3650 XMTestApp`thread_func [inlined] mono_os_cond_wait(mutex=0x000000010d315280) + 15 at mono-os-mutex.h:150 [opt]
frame #3: 0x000000010d1f3641 XMTestApp`thread_func(thread_data=0x0000000000000000) + 609 at sgen-thread-pool.c:110 [opt]
frame #4: 0x00007fff89dfb99d libsystem_pthread.dylib`_pthread_body + 131
frame #5: 0x00007fff89dfb91a libsystem_pthread.dylib`_pthread_start + 168
frame #6: 0x00007fff89df9351 libsystem_pthread.dylib`thread_start + 13
thread #5: tid = 0x228832, 0x00007fff8f116fae libsystem_kernel.dylib`semaphore_wait_trap + 10, name = 'Finalizer'
frame #0: 0x00007fff8f116fae libsystem_kernel.dylib`semaphore_wait_trap + 10
frame #1: 0x000000010d0f4a8d XMTestApp`finalizer_thread [inlined] mono_os_sem_wait(flags=MONO_SEM_FLAGS_ALERTABLE) + 11 at mono-os-semaphore.h:90 [opt]
frame #2: 0x000000010d0f4a82 XMTestApp`finalizer_thread + 11 at mono-coop-semaphore.h:40 [opt]
frame #3: 0x000000010d0f4a77 XMTestApp`finalizer_thread(unused=<unavailable>) + 167 at gc.c:844 [opt]
frame #4: 0x000000010d1b11b8 XMTestApp`start_wrapper [inlined] start_wrapper_internal + 582 at threads.c:741 [opt]
frame #5: 0x000000010d1b0f72 XMTestApp`start_wrapper(data=<unavailable>) + 50 at threads.c:796 [opt]
frame #6: 0x000000010d218bc9 XMTestApp`inner_start_thread(arg=<unavailable>) + 633 at mono-threads-posix.c:93 [opt]
frame #7: 0x00007fff89dfb99d libsystem_pthread.dylib`_pthread_body + 131
frame #8: 0x00007fff89dfb91a libsystem_pthread.dylib`_pthread_start + 168
frame #9: 0x00007fff89df9351 libsystem_pthread.dylib`thread_start + 13
thread #6: tid = 0x228834, 0x00007fff8f11d5e2 libsystem_kernel.dylib`__workq_kernreturn + 10
frame #0: 0x00007fff8f11d5e2 libsystem_kernel.dylib`__workq_kernreturn + 10
frame #1: 0x00007fff89dfb578 libsystem_pthread.dylib`_pthread_wqthread + 1283
frame #2: 0x00007fff89df9341 libsystem_pthread.dylib`start_wqthread + 13
(lldb) detach
=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================
Process 63396 detached
(lldb) Abort trap: 6
donblas:~/Programming/MS/BAE (dev/towang/dev6) $ (lldb) quit
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 'lldb' is not defined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment