Bug 4362 - MD stops responding after changing parameter value
Summary: MD stops responding after changing parameter value
Status: RESOLVED FIXED
Alias: None
Product: Runtime
Classification: Mono
Component: Debugger ()
Version: unspecified
Hardware: PC Linux
: --- critical
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-04-10 07:10 UTC by Marek Safar
Modified: 2012-04-16 11:40 UTC (History)
5 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 Marek Safar 2012-04-10 07:10:28 UTC
using System;

public class C
{
	delegate void D<in T> (T t);
	
	static void M<T> (ref T t, D<T> a)
	{
		a (t); // Set a breakpoint here and change "t" value to something. MD stops responding and has to be killed.
	}

	public static int Main ()
	{
		D<object> action = l => Console.WriteLine (l);
		string s = "value";
		
		M (ref s, action);
		return 0;
	}
}
Comment 1 Jeffrey Stedfast 2012-04-11 10:10:46 UTC
This seems to be a bug in the runtime (btw, I used the ImmediatePad to set the value of "t"):

This is the crash I get in Mono 2.11.1 from git master built last night:


Bad call to mono_mutex_lock result 22
* Assertion at debugger-agent.c:2063, condition `ret == 0' not met

Stacktrace:


Native stacktrace:

	0   mono                                0x00000001070dbca4 mono_handle_native_sigsegv + 276
	1   libsystem_c.dylib                   0x00007fff8f864cfa _sigtramp + 26
	2   ???                                 0x0000000000000043 0x0 + 67
	3   libsystem_c.dylib                   0x00007fff8f803a7a abort + 143
	4   mono                                0x000000010723e34a monoeg_g_logv + 154
	5   mono                                0x000000010723e3df monoeg_assertion_message + 143
	6   mono                                0x0000000107103f7c buffer_add_ptr_id + 124
	7   mono                                0x0000000107101b43 debugger_thread + 36547
	8   mono                                0x0000000107228a83 thread_start_routine + 131
	9   mono                                0x0000000107234146 inner_start_thread + 54
	10  mono                                0x000000010725b5dc GC_start_routine + 124
	11  libsystem_c.dylib                   0x00007fff8f8108bf _pthread_start + 335
	12  libsystem_c.dylib                   0x00007fff8f813b75 thread_start + 13

Debug info from gdb:

Attaching to process 21331.
Reading symbols for shared libraries . done
Reading symbols for shared libraries .................................... done
Reading symbols for shared libraries + done
0x00007fff93633bca in __psynch_cvwait ()
  3                         0x00007fff93634156 in __wait4 ()
  2                         0x00007fff936326b6 in semaphore_wait_trap ()
* 1 "com.apple.main-thread" 0x00007fff93633bca in __psynch_cvwait ()

Thread 3 (process 21331):
#0  0x00007fff93634156 in __wait4 ()
#1  0x00000001070dbd5b in mono_handle_native_sigsegv (signal=21332, ctx=0x107ea36e4) at mini-exceptions.c:2266
#2  <signal handler called>
#3  0x00007fff93633ce2 in __pthread_kill ()
#4  0x00007fff8f8127d2 in pthread_kill ()
#5  0x00007fff8f803a7a in abort ()
#6  0x000000010723e34a in monoeg_g_logv (log_domain=<value temporarily unavailable, due to optimizations>, log_level=<value temporarily unavailable, due to optimizations>, format=<value temporarily unavailable, due to optimizations>, args=<value temporarily unavailable, due to optimizations>) at goutput.c:136
#7  0x000000010723e3df in monoeg_assertion_message (format=0x0) at goutput.c:156
#8  0x0000000107103f7c in get_id [inlined] () at /Users/fejj/src/bockbuild/profiles/monodevelop-mac-dev-master/mono/mono/mini/debugger-agent.c:2063
#9  0x0000000107103f7c in buffer_add_ptr_id (buf=0x107ea46d8, domain=0x7fc35b071ef0, type=ID_TYPE, val=0x7fc35b007bf8) at debugger-agent.c:2129
#10 0x0000000107101b43 in debugger_thread (arg=0x2703) at debugger-agent.c:2177
#11 0x0000000107228a83 in thread_start_routine (args=0x7fc35b039f88) at wthreads.c:286
#12 0x0000000107234146 in inner_start_thread (arg=0x7fc35ad005f0) at mono-threads-posix.c:49
#13 0x000000010725b5dc in GC_start_routine (arg=0x107a91f00) at pthread_support.c:1473
#14 0x00007fff8f8108bf in _pthread_start ()
#15 0x00007fff8f813b75 in thread_start ()

Thread 2 (process 21331):
#0  0x00007fff936326b6 in semaphore_wait_trap ()
#1  0x0000000107232748 in mono_sem_wait (sem=Cannot access memory at address 0x0
) at mono-semaphore.c:115
#2  0x0000000107168fc4 in finalizer_thread (unused=0x1f03) at gc.c:1074
#3  0x00000001071f8c7e in start_wrapper (data=0x107533f30) at threads.c:571
#4  0x0000000107228a83 in thread_start_routine (args=0x7fc35b039ec0) at wthreads.c:286
#5  0x0000000107234146 in inner_start_thread (arg=0x107533f50) at mono-threads-posix.c:49
#6  0x000000010725b5dc in GC_start_routine (arg=0x107a91f00) at pthread_support.c:1473
#7  0x00007fff8f8108bf in _pthread_start ()
#8  0x00007fff8f813b75 in thread_start ()

Thread 1 (process 21331):
#0  0x00007fff93633bca in __psynch_cvwait ()
#1  0x00007fff8f814274 in _pthread_cond_wait ()
#2  0x0000000107108d8b in suspend_current () at debugger-agent.c:2746
#3  0x0000000107109f23 in process_event (event=1724212096, arg=0x7fff66c56380, il_offset=1724212096, ctx=0x7fff66c56380, events=0x7fff66c56380, suspend_policy=1724212096) at debugger-agent.c:3510
#4  0x000000010710823f in process_breakpoint_inner (tls=0x7fff66c56410) at debugger-agent.c:4371
#5  0x0000000107107e1f in process_signal_event [inlined] () at /Users/fejj/src/bockbuild/profiles/monodevelop-mac-dev-master/mono/mono/mini/debugger-agent.c:4392
#6  0x0000000107107e1f in process_breakpoint () at debugger-agent.c:4404
#7  0x00007fff66c564ac in ?? ()
#8  0x000000010705f311 in mono_jit_runtime_invoke (obj=0x0, method=0x7fff66c567c0, params=0x7fff66c567c0, exc=0x7fff66c567c0) at mini.c:5891
#9  0x00000001071c13db in mono_runtime_invoke (method=0x10750d1b0, obj=0x0, params=0x7fff66c56800, exc=0x0) at object.c:2808
#10 0x00000001071c4fa0 in mono_runtime_exec_main (method=0x10750d1b0, args=0x8, exc=0x0) at object.c:3991
#11 0x00000001070b5977 in mono_main (argc=1724213568, argv=0x7fff66c56940) at driver.c:1013
#12 0x00000001070585e4 in start ()

=================================================================
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.
=================================================================

Abort trap: 6

Press any key to continue...
Comment 2 Jeffrey Stedfast 2012-04-11 10:13:57 UTC
And this is the backtrace I get from Mono 2.10.9 (latest Mac OS X package):


Bad call to mono_mutex_lock result 22
* Assertion at debugger-agent.c:1742, condition `ret == 0' not met

Stacktrace:


Native stacktrace:

	0   mono                                0x000e1678 mono_handle_native_sigsegv + 408
	1   mono                                0x001542cd sigabrt_signal_handler + 141
	2   libsystem_c.dylib                   0x929a859b _sigtramp + 43
	3   ???                                 0xffffffff 0x0 + 4294967295
	4   libsystem_c.dylib                   0x92943bdd abort + 167
	5   mono                                0x002cc393 monoeg_g_logv + 243
	6   mono                                0x002cc446 monoeg_assertion_message + 54
	7   mono                                0x0010336d get_id + 173
	8   mono                                0x00106488 buffer_add_ptr_id + 56
	9   mono                                0x001063f9 buffer_add_typeid + 57
	10  mono                                0x00112451 object_commands + 1505
	11  mono                                0x00112cbe debugger_thread + 1374
	12  mono                                0x002af0de thread_start_routine + 206
	13  mono                                0x002e9608 GC_start_routine + 120
	14  libsystem_c.dylib                   0x92950ed9 _pthread_start + 335
	15  libsystem_c.dylib                   0x929546de thread_start + 34

Debug info from gdb:

Attaching to process 21348.
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 0x3bd000.
.................................... done
0x94f1f83e in __psynch_cvwait ()
  4                         0x94f1ffda in __wait4 ()
  3                         0x94f1dc5e in semaphore_wait_trap ()
  2                         0x94f1dc22 in mach_msg_trap ()
* 1 "com.apple.main-thread" 0x94f1f83e in __psynch_cvwait ()

Thread 4 (process 21348):
#0  0x94f1ffda in __wait4 ()
#1  0x929054ec in waitpid$UNIX2003 ()
#2  0x000e17db in mono_handle_native_sigsegv (signal=6, ctx=0xb0284b5c) at mini-exceptions.c:2192
#3  0x001542cd in sigabrt_signal_handler (_dummy=6, info=0xb0284b1c, context=0xb0284b5c) at mini-posix.c:196
#4  <signal handler called>
#5  0x94f1f9c6 in __pthread_kill ()
#6  0x92952f78 in pthread_kill ()
#7  0x92943bdd in abort ()
#8  0x002cc393 in monoeg_g_logv (log_domain=0x0, log_level=G_LOG_LEVEL_ERROR, format=0x36c5a4 "* Assertion at %s:%d, condition `%s' not met\n", args=0xb0284c44 "v?6") at goutput.c:129
#9  0x002cc446 in monoeg_assertion_message (format=0x36c5a4 "* Assertion at %s:%d, condition `%s' not met\n") at goutput.c:153
#10 0x0010336d in get_id (domain=0x1b99964, type=ID_TYPE, val=0x1b998bc) at debugger-agent.c:1742
#11 0x00106488 in buffer_add_ptr_id (buf=0xb0284eb0, domain=0x1b99964, type=ID_TYPE, val=0x1b998bc) at debugger-agent.c:1809
#12 0x001063f9 in buffer_add_typeid (buf=0xb0284eb0, domain=0x1b99964, klass=0x1b998bc) at debugger-agent.c:1857
#13 0x00112451 in object_commands (command=7, p=0x1661c04 "?a\026`?", end=0x1661c04 "?a\026`?", buf=0xb0284eb0) at debugger-agent.c:7049
#14 0x00112cbe in debugger_thread (arg=0x0) at debugger-agent.c:7241
#15 0x002af0de in thread_start_routine (args=0x1bc212c) at wthreads.c:287
#16 0x002e9608 in GC_start_routine (arg=0x4ebf60) at pthread_support.c:1468
#17 0x92950ed9 in _pthread_start ()
#18 0x929546de in thread_start ()

Thread 3 (process 21348):
#0  0x94f1dc5e in semaphore_wait_trap ()
#1  0x002be652 in mono_sem_wait (sem=0x3b74b4, alertable=1) at mono-semaphore.c:115
#2  0x0019eb42 in finalizer_thread (unused=0x0) at gc.c:1066
#3  0x00268811 in start_wrapper_internal (data=0x1375c40) at threads.c:784
#4  0x00268907 in start_wrapper (data=0x1375c40) at threads.c:832
#5  0x002af0de in thread_start_routine (args=0x1bc2034) at wthreads.c:287
#6  0x002e9608 in GC_start_routine (arg=0x4ebf60) at pthread_support.c:1468
#7  0x92950ed9 in _pthread_start ()
#8  0x929546de in thread_start ()

Thread 2 (process 21348):
#0  0x94f1dc22 in mach_msg_trap ()
#1  0x94f1d1f6 in mach_msg ()
#2  0x00153a01 in mach_exception_thread (arg=0x0) at mini-darwin.c:129
#3  0x002e9608 in GC_start_routine (arg=0x4ebf60) at pthread_support.c:1468
#4  0x92950ed9 in _pthread_start ()
#5  0x929546de in thread_start ()

Thread 1 (process 21348):
#0  0x94f1f83e in __psynch_cvwait ()
#1  0x92954e21 in _pthread_cond_wait ()
#2  0x9290542c in pthread_cond_wait$UNIX2003 ()
#3  0x00104618 in suspend_current () at debugger-agent.c:2376
#4  0x00106236 in process_event (event=EVENT_KIND_BREAKPOINT, arg=0x13776c0, il_offset=0, ctx=0xbffff588, events=0x0, suspend_policy=2) at debugger-agent.c:3018
#5  0x00108604 in process_breakpoint_inner (tls=0x1374d60, ctx=0xbffff588) at debugger-agent.c:3855
#6  0x001086d9 in process_breakpoint () at debugger-agent.c:3873
#7  0xbffff248 in ?? ()
#8  0x0078300c in ?? ()
#9  0x00783189 in ?? ()
#10 0x000113bf in mono_jit_runtime_invoke (method=0xbbb41c, obj=0x0, params=0xbffff718, exc=0x0) at mini.c:5791
#11 0x00221b3a in mono_runtime_invoke (method=0xbbb41c, obj=0x0, params=0xbffff718, exc=0x0) at object.c:2755
#12 0x0022481c in mono_runtime_exec_main (method=0xbbb41c, args=0x4f4d70, exc=0x0) at object.c:3930
#13 0x00223a81 in mono_runtime_run_main (method=0xbbb41c, argc=0, argv=0xbffffa34, exc=0x0) at object.c:3560
#14 0x000acf5f in mono_jit_exec (domain=0x4efe00, assembly=0x1375fd0, argc=1, argv=0xbffffa30) at driver.c:944
#15 0x000ad1b0 in main_thread_handler (user_data=0xbffff948) at driver.c:1003
#16 0x000af608 in mono_main (argc=4, argv=0xbffffa24) at driver.c:1855
#17 0x00002904 in mono_main_with_options (argc=4, argv=0xbffffa24) at main.c:66
#18 0x00002998 in main (argc=4, argv=0xbffffa24) at main.c:97

=================================================================
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.
=================================================================

Abort trap: 6

Press any key to continue...
Comment 3 Zoltan Varga 2012-04-12 05:24:25 UTC
Fixed in master.
Comment 4 Miguel de Icaza [MSFT] 2012-04-16 10:22:18 UTC
Zoltan, is it possible to get this on 2.10 as well?
Comment 5 Zoltan Varga 2012-04-16 11:40:58 UTC
Done.