Bug 9112 - Xamarin.Mac app crashing when debugger is connected.
Summary: Xamarin.Mac app crashing when debugger is connected.
Status: RESOLVED NORESPONSE
Alias: None
Product: Xamarin.Mac
Classification: Desktop
Component: Library (Xamarin.Mac.dll) ()
Version: Master
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: master
Assignee: Chris Hamons
URL:
Depends on:
Blocks:
 
Reported: 2012-12-21 15:14 UTC by Jon Lipsky
Modified: 2017-01-20 18:22 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED NORESPONSE

Description Jon Lipsky 2012-12-21 15:14:31 UTC
Hi All,

Since upgrading to Xamarin.Mac from the version of MonoMac I had been using (a snapshot from last June where I had added quite a few missing mappings that are now in Xamarin.Mac), I've started getting random app crashes when the application is sitting idle while launched in debug mode.

It seems most times it happens when there is a callback from NSDocument to autosave a dirty document.

This only happens when the debugger is connected, so it's not a blocking issue since release versions aren't impacted; however it makes it difficult to debug when I need things running for longer sessions.

I've attached the console log below.

Thanks,
Jon...


Native stacktrace:

	0   libmono-2.0.dylib                   0x0013037c mono_handle_native_sigsegv + 284
	1   libmono-2.0.dylib                   0x001756dd sigabrt_signal_handler + 109
	2   libsystem_c.dylib                   0x920c986b _sigtramp + 43
	3   ???                                 0xffffffff 0x0 + 4294967295
	4   libsystem_c.dylib                   0x921154f8 abort + 168
	5   libmono-2.0.dylib                   0x002ec7a3 monoeg_g_logv + 243
	6   libmono-2.0.dylib                   0x002ec856 monoeg_assertion_message + 54
	7   libmono-2.0.dylib                   0x00156822 resume_from_signal_handler + 178
	8   libmono-2.0.dylib                   0x00156880 mono_debugger_agent_single_step_event + 80
	9   libmono-2.0.dylib                   0x0009f48d mono_sigsegv_signal_handler + 61
	10  libsystem_c.dylib                   0x920c986b _sigtramp + 43
	11  ???                                 0xffffffff 0x0 + 4294967295
	12  libobjc.A.dylib                     0x92a07565 objc_retain + 37
	13  libsystem_blocks.dylib              0x9111acf7 _Block_object_assign + 464
	14  AppKit                              0x915aac32 __copy_helper_block_587 + 66
	15  libsystem_blocks.dylib              0x9111aea4 _Block_call_copy_helper + 32
	16  libsystem_blocks.dylib              0x9111a88b _Block_copy_internal + 247
	17  libsystem_blocks.dylib              0x9111abdf _Block_object_assign + 184
	18  AppKit                              0x915e8262 __copy_helper_block_1639 + 66
	19  libsystem_blocks.dylib              0x9111aea4 _Block_call_copy_helper + 32
	20  libsystem_blocks.dylib              0x9111a88b _Block_copy_internal + 247
	21  libdispatch.dylib                   0x9507af89 _dispatch_Block_copy + 55
	22  libdispatch.dylib                   0x9507f4f3 dispatch_async + 24
	23  AppKit                              0x911981a5 -[NSDocumentController(NSInternal) _onMainThreadInvokeWorker:] + 111
	24  AppKit                              0x91198125 -[NSDocument continueAsynchronousWorkOnMainThreadUsingBlock:] + 62
	25  AppKit                              0x915aa78e __54-[NSDocument performAsynchronousFileAccessUsingBlock:]_block_invoke_0566 + 581
	26  libdispatch.dylib                   0x9507ef8f _dispatch_call_block_and_release + 15
	27  libdispatch.dylib                   0x9507ac82 _dispatch_client_callout + 46
	28  libdispatch.dylib                   0x9507c160 _dispatch_queue_drain + 206
	29  libdispatch.dylib                   0x9507bffa _dispatch_queue_invoke + 50
	30  libdispatch.dylib                   0x9507becb _dispatch_worker_thread2 + 230
	31  libsystem_c.dylib                   0x920dfe12 _pthread_wqthread + 441
	32  libsystem_c.dylib                   0x920c7cca start_wqthread + 30

Debug info from gdb:

Attaching to process 32478.
Reading symbols for shared libraries * Assertion at debugger-agent.c:3894, condition `tls' not met

. done
Reading symbols for shared libraries ....................................................................................................................................................................................................................................................... done
Reading symbols for shared libraries + done
0x920c9f3a in OSAtomicCompareAndSwap64Barrier$VARIANT$mp ()
  9                                 0x926270ee in __workq_kernreturn ()
  8                                 0x926270ee in __workq_kernreturn ()
  7                                 0x926270ee in __workq_kernreturn ()
  6 "NSDocument File Access"        0x9262709a in __wait4 ()
  5 "com.apple.libdispatch-manager" 0x926279ae in kevent ()
  4                                 0x92626b3e in recvfrom$UNIX2003 ()
  3                                 0x9262480e in semaphore_wait_trap ()
  2                                 0x926247d2 in mach_msg_trap ()
* 1 "com.apple.main-thread"         0x920c9f3a in OSAtomicCompareAndSwap64Barrier$VARIANT$mp ()

Thread 9 (process 32478):
#0  0x926270ee in __workq_kernreturn ()
#1  0x920e004c in _pthread_workq_return ()
#2  0x920dfe19 in _pthread_wqthread ()
#3  0x920c7cca in start_wqthread ()

Thread 8 (process 32478):
#0  0x926270ee in __workq_kernreturn ()
#1  0x920e004c in _pthread_workq_return ()
#2  0x920dfe19 in _pthread_wqthread ()
#3  0x920c7cca in start_wqthread ()

Thread 7 (process 32478):
#0  0x926270ee in __workq_kernreturn ()
#1  0x920e004c in _pthread_workq_return ()
#2  0x920dfe19 in _pthread_wqthread ()
#3  0x920c7cca in start_wqthread ()

Thread 6 (process 32478):
#0  0x9262709a in __wait4 ()
#1  0x921679a2 in waitpid$UNIX2003 ()
#2  0x00130472 in mono_handle_native_sigsegv (signal=6, ctx=0xb030670c) at mini-exceptions.c:2218
#3  0x001756dd in sigabrt_signal_handler (_dummy=6, info=0xb03066cc, context=0xb030670c) at mini-posix.c:196
#4  <signal handler called>
#5  0x92626a6a in __pthread_kill ()
#6  0x920deacf in pthread_kill ()
#7  0x921154f8 in abort ()
#8  0x002ec7a3 in monoeg_g_logv (log_domain=0x0, log_level=G_LOG_LEVEL_ERROR, format=0x385874 "* Assertion at %s:%d, condition `%s' not met\n", args=0xb03067f4 "��8") at goutput.c:129
#9  0x002ec856 in monoeg_assertion_message (format=0x385874 "* Assertion at %s:%d, condition `%s' not met\n") at goutput.c:153
#10 0x00156822 in resume_from_signal_handler (sigctx=<value temporarily unavailable, due to optimizations>, func=<value temporarily unavailable, due to optimizations>) at debugger-agent.c:3894
#11 0x00156880 in mono_debugger_agent_single_step_event (sigctx=0xb0306c40) at debugger-agent.c:4124
#12 0x0009f48d in mono_sigsegv_signal_handler (_dummy=10, info=0xb0306c00, context=0xb0306c40) at mini.c:5877
#13 <signal handler called>
#14 0x011c005e in ?? ()
#15 0x92a07565 in objc_retain ()
#16 0x9111acf7 in _Block_object_assign ()
#17 0x915aac32 in __copy_helper_block_587 ()
#18 0x9111aea4 in _Block_call_copy_helper ()
#19 0x9111a88b in _Block_copy_internal ()
#20 0x9111abdf in _Block_object_assign ()
#21 0x915e8262 in __copy_helper_block_1639 ()
#22 0x9111aea4 in _Block_call_copy_helper ()
#23 0x9111a88b in _Block_copy_internal ()
#24 0x9507af89 in _dispatch_Block_copy ()
#25 0x9507f4f3 in dispatch_async ()
#26 0x911981a5 in -[NSDocumentController(NSInternal) _onMainThreadInvokeWorker:] ()
#27 0x91198125 in -[NSDocument continueAsynchronousWorkOnMainThreadUsingBlock:] ()
#28 0x915aa78e in __54-[NSDocument performAsynchronousFileAccessUsingBlock:]_block_invoke_0566 ()
#29 0x9507ef8f in _dispatch_call_block_and_release ()
#30 0x9507ac82 in _dispatch_client_callout ()
#31 0x9507c160 in _dispatch_queue_drain ()
#32 0x9507bffa in _dispatch_queue_invoke ()
#33 0x9507becb in _dispatch_worker_thread2 ()
#34 0x920dfe12 in _pthread_wqthread ()
#35 0x920c7cca in start_wqthread ()

Thread 5 (process 32478):
#0  0x926279ae in kevent ()
#1  0x9507dc71 in _dispatch_mgr_invoke ()
#2  0x9507d7a9 in _dispatch_mgr_thread ()

Thread 4 (process 32478):
#0  0x92626b3e in recvfrom$UNIX2003 ()
#1  0x92167bcb in recv$UNIX2003 ()
#2  0x00147218 in recv_length [inlined] () at :1002
#3  0x00147218 in debugger_thread (arg=0x0) at debugger-agent.c:7213
#4  0x002d001e in thread_start_routine (args=0x7d16a92c) at wthreads.c:287
#5  0x00310428 in GC_start_routine (arg=0x4eaf60) at pthread_support.c:1468
#6  0x920dd557 in _pthread_start ()
#7  0x920c7cee in thread_start ()

Thread 3 (process 32478):
#0  0x9262480e in semaphore_wait_trap ()
#1  0x002e7082 in mono_sem_wait (sem=0x3bf894, alertable=1) at mono-semaphore.c:115
#2  0x001bf762 in finalizer_thread (unused=0x0) at gc.c:1087
#3  0x00283f01 in start_wrapper_internal (data=0x7c37ba90) at threads.c:784
#4  0x00283ff7 in start_wrapper (data=0x7c37ba90) at threads.c:832
#5  0x002d001e in thread_start_routine (args=0x7d16a834) at wthreads.c:287
#6  0x00310428 in GC_start_routine (arg=0x4eaf60) at pthread_support.c:1468
#7  0x920dd557 in _pthread_start ()
#8  0x920c7cee in thread_start ()

Thread 2 (process 32478):
#0  0x926247d2 in mach_msg_trap ()
#1  0x92623cb0 in mach_msg ()
#2  0x0017470a in mach_exception_thread (arg=0x0) at mini-darwin.c:129
#3  0x00310428 in GC_start_routine (arg=0x4eaf60) at pthread_support.c:1468
#4  0x920dd557 in _pthread_start ()
#5  0x920c7cee in thread_start ()

Thread 1 (process 32478):
#0  0x920c9f3a in OSAtomicCompareAndSwap64Barrier$VARIANT$mp ()
#1  0x920e3395 in pthread_mutex_trylock ()
#2  0x00303a19 in GC_malloc_atomic (lb=14) at malloc.c:259
#3  0x00247300 in mono_object_allocate_ptrfree (size=14, vtable=0x7c941338) at object.c:4254
#4  0x002476d3 in mono_string_new_size (domain=0x4eee00, len=0) at object.c:4881
#5  0x002475b4 in mono_string_new_utf16 (domain=0x4eee00, text=0x8051f840, len=0) at object.c:4851
#6  0x0024786b in mono_string_new (domain=0x4eee00, text=0x80096740 "") at object.c:4943
#7  0x002478ce in mono_string_new_wrapper (text=0x80096740 "") at object.c:4984
#8  0x0476148e in ?? ()
#9  0x041bab10 in ?? ()
#10 0x9124b0e9 in -[NSView _convertRectToSuperview:] ()
#11 0x9124afb1 in -[NSView _convertRect:toAncestor:] ()
#12 0x9124ae0f in -[NSView convertRect:toView:] ()
#13 0x91268612 in -[NSView _regionForOpaqueDescendants:forMove:] ()
#14 0x91268e56 in -[NSView _regionForOpaqueDescendants:forMove:] ()
#15 0x91268e56 in -[NSView _regionForOpaqueDescendants:forMove:] ()
#16 0x91268e56 in -[NSView _regionForOpaqueDescendants:forMove:] ()
#17 0x91268e56 in -[NSView _regionForOpaqueDescendants:forMove:] ()
#18 0x91268e56 in -[NSView _regionForOpaqueDescendants:forMove:] ()
#19 0x91268e56 in -[NSView _regionForOpaqueDescendants:forMove:] ()
#20 0x91268e56 in -[NSView _regionForOpaqueDescendants:forMove:] ()
#21 0x912681c2 in -[NSTitledFrame _regionForOpaqueDescendants:forMove:] ()
#22 0x91267de6 in -[NSThemeFrame _regionForOpaqueDescendants:forMove:] ()
#23 0x912ccb53 in -[NSFrameView drawThemeContentFill:inView:] ()
#24 0x912c2194 in -[NSFrameView drawRect:] ()
#25 0x912c1df6 in -[NSThemeFrame drawRect:] ()
#26 0x912c1434 in -[NSView _drawRect:clip:] ()
#27 0x912c05a6 in -[NSThemeFrame _drawRect:clip:] ()
#28 0x912be999 in -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] ()
#29 0x912bdf1f in -[NSThemeFrame _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] ()
#30 0x912b9c83 in -[NSView _displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:] ()
#31 0x91282481 in -[NSView displayIfNeeded] ()
#32 0x91281e3d in -[NSWindow displayIfNeeded] ()
#33 0x91281ad4 in _handleWindowNeedsDisplayOrLayoutOrUpdateConstraints ()
#34 0x918bfb3b in __83-[NSWindow _postWindowNeedsDisplayOrLayoutOrUpdateConstraintsUnlessPostingDisabled]_block_invoke_01253 ()
#35 0x942dc28d in _runLoopObserverWithBlockContext ()
#36 0x942acdfe in __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ ()
#37 0x942acd3d in __CFRunLoopDoObservers ()
#38 0x94286e16 in __CFRunLoopRun ()
#39 0x9428663a in CFRunLoopRunSpecific ()
#40 0x942864ab in CFRunLoopRunInMode ()
#41 0x92b6515a in RunCurrentEventLoopInMode ()
#42 0x92b64df5 in ReceiveNextEventCommon ()
#43 0x92b64d44 in BlockUntilNextEventMatchingListInMode ()
#44 0x9127ea3a in _DPSNextEvent ()
#45 0x9127e26c in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] ()
#46 0x912746cc in -[NSApplication run] ()
#47 0x912176f6 in NSApplicationMain ()
#48 0x04761326 in ?? ()
#49 0x0476104c in ?? ()
#50 0x0096b014 in ?? ()
#51 0x0096b346 in ?? ()
#52 0x000a7902 in mono_jit_runtime_invoke (method=0x7c94681c, obj=0x0, params=0xbffbf608, exc=0x0) at mini.c:5813
#53 0x00242b6a in mono_runtime_invoke (method=0x7c94681c, obj=0x0, params=0xbffbf608, exc=0x0) at object.c:2788
#54 0x002456e1 in mono_runtime_exec_main (method=0x7c94681c, args=0x984f30, exc=0x0) at object.c:3972
#55 0x002448f1 in mono_runtime_run_main (method=0x7c94681c, argc=1, argv=0x7b67858c, exc=0x0) at object.c:3594
#56 0x00105095 in mono_jit_exec (domain=0x4eee00, assembly=0x7c467400, argc=2, argv=0x7b678588) at driver.c:944
#57 0x00107629 in mono_main (argc=4, argv=0x7b678580) at driver.c:1003
#58 0x000434bf in main ()

=================================================================
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.
=================================================================
Comment 1 Timothy Risi 2015-02-12 21:07:52 UTC
Is this crash still occuring on the current version of Xamarin.Mac?  If so, could you provide a simple repro case for it?
Comment 2 Timothy Risi 2017-01-20 18:22:04 UTC
We have not received the requested information. If you are still experiencing this issue please provide all the requested information and re-open the bug report. Thanks!