Bug 525 - Cannot debug mono-master app with monodevelop
Summary: Cannot debug mono-master app with monodevelop
Status: RESOLVED FIXED
Alias: None
Product: Runtime
Classification: Mono
Component: Debugger ()
Version: unspecified
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2011-08-29 12:11 UTC by knittl89+bugs
Modified: 2011-09-02 05:49 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 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 knittl89+bugs 2011-08-29 12:11:23 UTC
When trying to debug a program with mono-master (2.11) monodevelop hangs as soon as it hits a breakpoint (or pauses execution due to an exceptions being thrown) and waits indefinitely for the debugger. No message on console or anything visible to the user is displayed.

Debugged processes stay open after halting execution and closing monodevelop.

IRC quote > mhutch: knittl: it's deadlocking in the suspend code

System configuration: Ubuntu 11.04, mono and monodevelop build from git master.

backtrace attached:

(gdb) t a a bt

Thread 4 (Thread 0xb739db70 (LWP 10854)):
#0  0xb788f424 in __kernel_vsyscall ()
#1  0xb782a48c in pthread_cond_wait@@GLIBC_2.3.2 ()
   from /lib/i386-linux-gnu/libpthread.so.0
#2  0x0823b0f4 in GC_wait_marker () at pthread_support.c:1868
#3  0x08240484 in GC_help_marker (my_mark_no=1) at mark.c:1116
#4  0x08239fde in GC_mark_thread (id=0x0) at pthread_support.c:552
#5  0xb7825e99 in start_thread () from /lib/i386-linux-gnu/libpthread.so.0
#6  0xb778f73e in clone () from /lib/i386-linux-gnu/libc.so.6

Thread 3 (Thread 0xb6711b70 (LWP 10856)):
#0  0xb788f424 in __kernel_vsyscall ()
#1  0xb782c7d5 in sem_wait@@GLIBC_2.1 () from /lib/i386-linux-gnu/libpthread.so.0
#2  0x08228f80 in mono_sem_wait (sem=0x95caa54, alertable=0) at mono-semaphore.c:113
#3  0x082291f8 in suspend_signal_handler (_dummy=35, info=0xb6710e2c, context=
    0xb6710eac) at mono-threads-posix.c:93
#4  <signal handler called>
#5  0xb788f424 in __kernel_vsyscall ()
#6  0xb782c7d5 in sem_wait@@GLIBC_2.1 () from /lib/i386-linux-gnu/libpthread.so.0
#7  0x08228f80 in mono_sem_wait (sem=0x831d4d4, alertable=1) at mono-semaphore.c:113
#8  0x0815a74e in finalizer_thread (unused=0x0) at gc.c:1072
#9  0x0817a63e in start_wrapper_internal (data=0x95cfde8) at threads.c:569
#10 start_wrapper (data=0x95cfde8) at threads.c:617
#11 0x0820ce3a in thread_start_routine (args=0x95ba734) at wthreads.c:290
#12 0x08229317 in inner_start_thread (arg=0x95cb788) at mono-threads-posix.c:49
#13 0x0823ad91 in GC_start_routine (arg=0x61fe0) at pthread_support.c:1473
#14 0xb7825e99 in start_thread () from /lib/i386-linux-gnu/libpthread.so.0
#15 0xb778f73e in clone () from /lib/i386-linux-gnu/libc.so.6

Thread 2 (Thread 0xb6610b70 (LWP 10857)):
#0  0xb788f424 in __kernel_vsyscall ()
#1  0xb782c7d5 in sem_wait@@GLIBC_2.1 () from /lib/i386-linux-gnu/libpthread.so.0
#2  0x08228f80 in mono_sem_wait (sem=0x831d0b0, alertable=0) at mono-semaphore.c:113
#3  0x08102af6 in wait_for_suspend () at debugger-agent.c:2533
#4  0x0811083b in thread_commands (arg=0x0) at debugger-agent.c:6959
#5  debugger_thread (arg=0x0) at debugger-agent.c:7571
#6  0x0820ce3a in thread_start_routine (args=0x95ba844) at wthreads.c:290
#7  0x08229317 in inner_start_thread (arg=0x95cfee0) at mono-threads-posix.c:49
#8  0x0823ad91 in GC_start_routine (arg=0x61fe0) at pthread_support.c:1473
#9  0xb7825e99 in start_thread () from /lib/i386-linux-gnu/libpthread.so.0
#10 0xb778f73e in clone () from /lib/i386-linux-gnu/libc.so.6

Thread 1 (Thread 0xb76beb60 (LWP 10853)):
#0  0xb788f424 in __kernel_vsyscall ()
#1  0xb782a48c in pthread_cond_wait@@GLIBC_2.3.2 ()
   from /lib/i386-linux-gnu/libpthread.so.0
#2  0x0810ac14 in suspend_current () at debugger-agent.c:2464
---Type <return> to continue, or q <return> to quit---
#3  0x0810b6d5 in process_event (event=<value optimized out>, 
    arg=<value optimized out>, il_offset=<value optimized out>, ctx=0x95c84b8, 
    events=0x0, suspend_policy=2) at debugger-agent.c:3193
#4  0x0810d3fa in process_breakpoint_inner (tls=0x95c8360) at debugger-agent.c:4025
#5  0x08103dee in process_signal_event (func=0x810cfd0 <process_breakpoint_inner>)
    at debugger-agent.c:4046
#6  0xb6787fe0 in ?? ()
#7  0xb67881ae in ?? ()
#8  0x080624e8 in mono_jit_runtime_invoke (method="serialize.serialize:Main ()", obj=
    0x0, params=0xbfd0684c, exc=0x0) at mini.c:5768
#9  0x0814d6be in mono_runtime_invoke (method="serialize.serialize:Main ()", obj=
    0x0, params=0xbfd0684c, exc=0x0) at object.c:2779
#10 0x08150558 in mono_runtime_exec_main (method="serialize.serialize:Main ()", args=
    0x3bd80, exc=0x0) at object.c:3970
#11 0x080be128 in main_thread_handler (argc=4, argv=0xbfd06a34) at driver.c:1003
#12 mono_main (argc=4, argv=0xbfd06a34) at driver.c:1876
#13 0x080571fe in mono_main_with_options (argc=4, argv=0xbfd06a34) at main.c:66
#14 main (argc=4, argv=0xbfd06a34) at main.c:97
(gdb)
Comment 1 Zoltan Varga 2011-08-29 21:57:04 UTC
Committed a workaround in f913e8b6d7b70d2f79d85fb5e6596f8e0b5338d1.
Comment 2 knittl89+bugs 2011-09-01 08:25:56 UTC
With the workaround from f913e8b6d7b70d2f79d85fb5e6596f8e0b5338d1 I can debug again, thanks
Comment 3 Zoltan Varga 2011-09-01 16:04:05 UTC
This should be fixed in HEAD, could you try it without the workaround.
Comment 4 knittl89+bugs 2011-09-02 05:49:50 UTC
Just tried with b3a711fae73476455498b67561402f9d42f19f50 and the debugger works again for my testcase. Great work, thanks!

Marking as fixed