[Mono-bugs] Found an endless loop bug in mcs

Juanval juanval at gmail.com
Thu Sep 22 11:18:16 EDT 2005

Hi there
I'm working on a gtk-sharp program, and after some late night stupid
coding, when trying to compile the project, mcs got into an endless
loop. I've tracked down the bug to some 20 lines of code. If I remove
any line more, mcs stops hanging.

So, here's the code:
using System;
using Gtk;

namespace Foo
    public class Bar
        TreeView myTreeView;

        void LoopMethod(string query)
            int i = 0;
            TreeIter iter;
            myTreeView.Model.GetIterFirst(out iter);

            myTreeView.Model.Foreach(delegate(TreeModel model,TreePath
path,TreeIter iter)
                        myTreeView.Model.SetValue(iter, 1,"hey");
                    return false;

If I compile this with "mcs endlessLoop.cs  -pkg:gtk-sharp" mcs just
hangs there using all CPU.

I'm using mcs version: Mono C# compiler version, if that helps.

I haven't checked if this bug has been already fixed in newer mcs
snapshots. If that's the case, please forgive me.


More information about the mono-bugs mailing list