[Mono-devel-list] mono debugger in infinite loop

Philip Nelson panmanphil at yahoo.com
Sun Mar 23 14:08:39 EST 2003

One side note before digging in, thanks a lot for this monumental effort.

Also, the dialog handling to load a new program needs a little work.  If you
click the Browse button, the new dialog is locked, unless you kill the initial
dialog.  Then you can choose a file and say OK, but nothing happens. Open the
choose dialog again, the file selected is there and can be loaded.

Also I hadn't noticed the step over vs step command, but the results were the
same.  It would make sense perhaps if I tried to step into a method for which
there were no symbols, but alas, that wasn't the problem.

> > So, with great anticipation ...
> > 
> > mono /usr/bin/Debugger.exe NAnt.exe -help
> Did you compile NAnt with debugging support ?


> I compiled mine with
>         $ cd ~/monocvs/mcs/nant/
>         $ mcs -g /out:NAnt.exe /recurse:*.cs
> > blew up somewhere deep in gtk-sharp (?) with a null reference exception
> Can you please post the full backtrace ?

Filename: /home/panmanphil/nant/src/NAnt.Console/ConsoleStub.cs

Unhandled Exception: System.NullReferenceException: A null value was found
where an object instance was required
in <0x00020> 00 Gtk.TextBuffer:MoveMark (Gtk.TextMark,Gtk.TextIter)
in <0x00290> 00 Mono.Debugger.GUI.SourceView:frame_changed_event
in <0x0002a> 00 Mono.Debugger.GUI.SourceView:SetActive ()
in <0x00011> 00 Mono.Debugger.GUI.DisassemblerView:SetActive ()
in <0x0005d> 00 Mono.Debugger.GUI.SourceView:set_Active (bool)
in <0x00147> 00 Mono.Debugger.GUI.SourceManager:MethodChanged
in <0x000d8> 00 Mono.Debugger.GUI.SourceManager:FrameChanged
in <0x0003f> 00 Mono.Debugger.GUI.DebuggerWidget:frame_event ()
in <0x0005b> 01 System.MulticastDelegate:invoke_void ()
in <0x000a7> 00 Mono.Debugger.ThreadNotify:read_data_handler (int)
in <0x00061> 01 System.MulticastDelegate:invoke_void_int (int)
in <0x00041> 00 Mono.Debugger.IOInputChannel:read_data (int)
in <0x00030> 05 Mono.Debugger.IOInputChannel:read_data (int)
in (unmanaged) 06
in <0x00004> 06
in <0x0001b> 00
Mono.Debugger.Frontends.CommandLine.ProcessHandle:process_events ()
in <0x002a5> 00 Mono.Debugger.Frontends.CommandLine.ProcessHandle:.ctor
in <0x000ab> 00 Mono.Debugger.Frontends.CommandLine.ScriptingContext:Run ()
in <0x0025e> 00 Mono.Debugger.GUI.DebuggerGUI:LoadProgram (string[])
in <0x00213> 00 Mono.Debugger.GUI.DebuggerGUI:.ctor (string[])
in <0x00276> 00 Mono.Debugger.GUI.DebuggerGUI:Main (string[])

> > Ok. mono /usr/bin/Debugger.exe
> > load program and viola, the debugger shows a yellow highlight on the first
> line
> > of source.
> Ok, I suppose that's also NAnt.exe and it stopped in NAnt.cs, line 98 (on the
> `if (!project.Run ())` statement), that's what it does for me.
> > Step, Step, and then step into the first reference to a system
> > type, AppDomain in this case, never to return.  I could break, but have to
> > close the session after that.  
> Which method in AppDomain do you mean and did you compile your corlib with
> debugging
> support ?

I have the rpm version of corlib.  

AppDomain cd = AppDomain.CurrentDomain;
Appdomain executionAD = cd; //this line never returns.

> > Ok, try the same thing from the command line.  I can step and again it goes
> > into a loop of some sort when hitting the AppDomain reference.
> > 
> > OK, try something simpler, a 10 line program that loads up a DataSet,
> builds a
> > DataTable in memory and calls WriteXml() to save.  This was a simple test
> that
> > already worked (except for writexml not being implemented).  In this case I
> > could step a few steps until I called a method on the dataset and then an
> > infinite loop.
> Please send me this small test program so I can have a look at it myself. 
> Which method
> did you attempt to call where it crashed ?

It crashes in various places.  Today I made it through to the return statement
with the step over (F9).  Second pass it locked on the line: 

System.Data.DataSet test = new System.Data.DataSet("test");

Third time, after killing some zombie debugger and mono processes, on the call
to Console.WriteLn()

EXCEPTION: Mono.Debugger.InternalError: Call not completed
in <0x00087> 00 Mono.Debugger.Backends.PTraceInferior:WaitForCallback ()
in <0x000c2> 00 Mono.Debugger.Backends.PTraceInferior:CallMethod
in <0x0017f> 00
in <0x00209> 00 Mono.Debugger.Backends.SingleSteppingEngine:Step
in <0x001b3> 00 Mono.Debugger.Backends.SingleSteppingEngine:process_command
in <0x0002b> 00 Mono.Debugger.Backends.SingleSteppingEngine:engine_thread_main

4th time it locked on the tb.Rows.Add call

using System.Data;
using System;

namespace WINN
	public class Test
		public Test()
		//	System.Console.Out.Println("hello worlds");
		public static int Main(string[] args)
			Console.WriteLine("Hello World");
			System.Data.DataSet test = new System.Data.DataSet("test");
			System.Data.DataTable tb = test.Tables[0];
			tb.Columns.Add("foo", Type.GetType("System.String"));
			object[] ogs = new Object[]{"one", "two"};
			Console.WriteLine("Count of Tables is: " + test.Tables.Count);
			Console.WriteLine("Count of rows is " + test.Tables[0].Rows.Count);
			return 0;


More information about the Mono-devel-list mailing list