Bug 577 - Debugger hangs MonoMac application
Summary: Debugger hangs MonoMac application
Status: RESOLVED FIXED
Alias: None
Product: Runtime
Classification: Mono
Component: Debugger ()
Version: unspecified
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2011-08-31 17:58 UTC by Miguel de Icaza [MSFT]
Modified: 2011-11-27 10:40 UTC (History)
4 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 GitHub or Developer Community 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 FIXED

Description Miguel de Icaza [MSFT] 2011-08-31 17:58:03 UTC
Setting a breakpoint in a constructor for my UI.

To reproduce git clone mono/monomac, and then reset the sample to:

git reset --hard 6b0337b33ad0c4f9c5842d50de20749b81c4c8f8

Then open the monomac/samples/macdoc solution and, set breakpoint in MyDocument.cs, line 41.

Run the application.   The MacDoc app starts, but never shows up anything, and the debugger breakpoint is never hit.

Attaching with GDB shows the following stack trace:


mac$ gdb
GNU gdb 6.3.50-20050815 (Apple version gdb-1708) (Mon Aug  8 20:32:45 UTC 2011)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin".
(gdb) attach 37598
Attaching to process 37598.
Reading symbols for shared libraries . done
Reading symbols for shared libraries warning: Trying to remove a section from the ordered section list that did not exist at 0x343000.
............................................................................................................................................................................................... done
0x95eff83e in __psynch_cvwait ()
(gdb) t a a bt

Thread 8 (process 37598):
#0  0x00000000 in ?? ()

Thread 7 (process 37598):
#0  0x95f0002e in __workq_kernreturn ()
#1  0x97539ccf in _pthread_wqthread ()
#2  0x9753b6fe in start_wqthread ()

Thread 6 (process 37598):
#0  0x95eff83e in __psynch_cvwait ()
#1  0x9753be21 in _pthread_cond_wait ()
#2  0x974ec42c in pthread_cond_wait$UNIX2003 ()
#3  0x976b2d81 in WTF::ThreadCondition::timedWait ()
#4  0x92e07144 in WebCore::LocalStorageThread::threadEntryPoint ()
#5  0x92e070a1 in WebCore::LocalStorageThread::threadEntryPointCallback ()
#6  0x97537ed9 in _pthread_start ()
#7  0x9753b6de in thread_start ()

Thread 5 (process 37598):
#0  0x95f0090a in kevent ()
#1  0x95069ccc in _dispatch_mgr_invoke ()
#2  0x9506871b in _dispatch_mgr_thread ()

Thread 4 (process 37598):
#0  0x95efdc5e in semaphore_wait_trap ()
#1  0x0024b6a6 in mono_sem_wait (sem=0x320888, alertable=0) at mono-semaphore.c:115
#2  0x000d3c9e in wait_for_suspend () at debugger-agent.c:2438
#3  0x000d9916 in thread_commands (command=1, p=0x66b80e0 "", end=0x66b80ec "", buf=0xb0284de0) at debugger-agent.c:6627
#4  0x000e47b6 in debugger_thread (arg=0x0) at debugger-agent.c:7201
#5  0x0023e366 in thread_start_routine (args=0x22d272c) at wthreads.c:287
#6  0x0026f8bb in GC_start_routine (arg=0x459f60) at pthread_support.c:1468
#7  0x97537ed9 in _pthread_start ()
#8  0x9753b6de in thread_start ()

Thread 3 (process 37598):
#0  0x95efdc5e in semaphore_wait_trap ()
#1  0x0024b6a6 in mono_sem_wait (sem=0x320ed0, alertable=1) at mono-semaphore.c:115
#2  0x0014d336 in finalizer_thread (unused=0x0) at gc.c:1066
#3  0x001ff0f3 in start_wrapper_internal (data=0x1d419d0) at threads.c:783
#4  0x001ff193 in start_wrapper (data=0x1d419d0) at threads.c:831
#5  0x0023e366 in thread_start_routine (args=0x22d2634) at wthreads.c:287
#6  0x0026f8bb in GC_start_routine (arg=0x459f60) at pthread_support.c:1468
#7  0x97537ed9 in _pthread_start ()
#8  0x9753b6de in thread_start ()

Thread 2 (process 37598):
#0  0x95efdc22 in mach_msg_trap ()
#1  0x95efd1f6 in mach_msg ()
#2  0x0010a8b4 in mach_exception_thread (arg=0x0) at mini-darwin.c:129
#3  0x0026f8bb in GC_start_routine (arg=0x459f60) at pthread_support.c:1468
#4  0x97537ed9 in _pthread_start ()
#5  0x9753b6de in thread_start ()

Thread 1 (process 37598):
#0  0x95eff83e in __psynch_cvwait ()
#1  0x9753be21 in _pthread_cond_wait ()
#2  0x974ec42c in pthread_cond_wait$UNIX2003 ()
#3  0x000dbdbf in suspend_current () at debugger-agent.c:2369
#4  0x000dc44e in process_event (event=EVENT_KIND_BREAKPOINT, arg=0xc69a8c, il_offset=0, ctx=0xbfffdf4c, events=0x66b80a0, suspend_policy=2) at debugger-agent.c:3011
#5  0x000dda22 in process_breakpoint_inner (tls=0x1d40af0, ctx=0xbfffdf4c) at debugger-agent.c:3831
#6  0x000dde49 in process_breakpoint () at debugger-agent.c:3849
#7  0xbfffdc08 in ?? ()
#8  0x03f7fa11 in ?? ()
#9  0x02ff7784 in ?? ()
#10 0x91c4de93 in -[NSWindowController _windowDidLoad] ()
#11 0x91c45116 in -[NSWindowController window] ()
#12 0x91cc05c5 in -[NSDocument(NSPersistentUISupport) restoreDocumentWindowWithIdentifier:state:completionHandler:] ()
#13 0x91cc0511 in __+[NSDocumentController restoreWindowWithIdentifier:state:completionHandler:]_block_invoke_4 ()
#14 0x91cc049b in -[NSDocumentControllerPersistentRestoration loadedDocument:forAutoID:] ()
#15 0x91cc03eb in __+[NSDocumentController restoreWindowWithIdentifier:state:completionHandler:]_block_invoke_5 ()
#16 0x91c99188 in -[NSDocumentController _restorePersistentDocumentWithState:completionHandler:] ()
#17 0x91c98967 in __+[NSDocumentController restoreWindowWithIdentifier:state:completionHandler:]_block_invoke_2 ()
#18 0x91c986a8 in -[NSDocumentController _waitForAsyncOpeningOrPrintingToFinishThenContinue:] ()
#19 0x91c985b3 in __+[NSDocumentController restoreWindowWithIdentifier:state:completionHandler:]_block_invoke_1 ()
#20 0x91a467a0 in -[NSApplication _whenReopeningIsAllowedDo:] ()
#21 0x91c9852a in +[NSDocumentController restoreWindowWithIdentifier:state:completionHandler:] ()
#22 0x91c98329 in -[NSApplication(NSPersistentUISupport) restoreWindowWithIdentifier:state:completionHandler:] ()
#23 0x91c97c74 in -[NSApplication(NSPersistentUISupport) _restoreWindowWithRestoration:handler:] ()
#24 0x91a76a6f in -[NSPersistentUIManager restoreAllPersistentStateWithTalagentWindows:registeringAsReadyWhenDone:completionHandler:] ()
#25 0x91a46079 in -[NSApplication _reopenWindowsAsNecessaryIncludingRestorableState:registeringAsReady:completionHandler:] ()
#26 0x91a45eaf in -[NSApplication(NSAppleEventHandling) _reopenWindowsIfNecessaryWithAppleEvent:completionHandler:] ()
#27 0x91a45d92 in -[NSApplication(NSAppleEventHandling) _handleAEOpenEvent:] ()
#28 0x91a45aba in -[NSApplication(NSAppleEventHandling) _handleCoreEvent:withReplyEvent:] ()
#29 0x918e4db8 in -[NSObject performSelector:withObject:withObject:] ()
#30 0x947c97e6 in __-[NSAppleEventManager setEventHandler:andSelector:forEventClass:andEventID:]_block_invoke_1 ()
#31 0x947c8599 in -[NSAppleEventManager dispatchRawAppleEvent:withRawReply:handlerRefCon:] ()
#32 0x947c836d in _NSAppleEventManagerGenericHandler ()
#33 0x95049f1d in aeDispatchAppleEvent ()
#34 0x95033a4b in dispatchEventAndSendReply ()
#35 0x95033938 in aeProcessAppleEvent ()
#36 0x909e2f72 in AEProcessAppleEvent ()
#37 0x91a42b5b in _DPSNextEvent ()
#38 0x91a42159 in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] ()
#39 0x91a3e4cb in -[NSApplication run] ()
#40 0x91cd1b54 in NSApplicationMain ()
#41 0x02ff9b8e in ?? ()
#42 0x02ff998c in ?? ()
#43 0x004afff8 in ?? ()
#44 0x004b0156 in ?? ()
#45 0x00010624 in mono_jit_runtime_invoke (method=0x12ac61c, obj=0x0, params=0xbffff4c8, exc=0x0) at mini.c:5764
#46 0x001c1032 in mono_runtime_invoke (method=0x12ac61c, obj=0x0, params=0xbffff4c8, exc=0x0) at object.c:2755
#47 0x001c3940 in mono_runtime_exec_main (method=0x12ac61c, args=0x462d70, exc=0x0) at object.c:3938
#48 0x001c2c7a in mono_runtime_run_main (method=0x12ac61c, argc=0, argv=0x52f8b0, exc=0x0) at object.c:3560
#49 0x0008943d in mono_main (argc=4, argv=0x52f8a0) at driver.c:1003
#50 0x00002db5 in start ()
(gdb)
Comment 1 Zoltan Varga 2011-09-14 09:20:36 UTC
Wasn't this the 'native thread exits but the debugger still waits for it' problem ?
Comment 2 Miguel de Icaza [MSFT] 2011-09-14 12:20:57 UTC
Yes, we are now waiting on a new Mono releas to fix this.
Comment 3 Zoltan Varga 2011-11-27 02:29:15 UTC
Is this issue still present ?
Comment 4 Miguel de Icaza [MSFT] 2011-11-27 10:40:39 UTC
This was fixed by 2.10.6 or 2.10.5