Bug 4052 - Compiler Crash on mono 2.11 alpha compiling OpenSimulator
Summary: Compiler Crash on mono 2.11 alpha compiling OpenSimulator
Status: RESOLVED FIXED
Alias: None
Product: Compilers
Classification: Mono
Component: C# ()
Version: unspecified
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Marek Safar
URL:
Depends on:
Blocks:
 
Reported: 2012-03-23 00:06 UTC by Michael Cerquoni
Modified: 2012-03-27 04:38 UTC (History)
1 user (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
file referenced in the monodevelop error report (15.24 KB, text/plain)
2012-03-23 04:34 UTC, Michael Cerquoni
Details


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 Michael Cerquoni 2012-03-23 00:06:48 UTC
Errors:

/home/nebadon/osgrid/okc_sandbox2/OpenSim.sln (default targets) ->
(Build target) ->
/home/nebadon/osgrid/okc_sandbox2/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/OpenSim.Region.ScriptEngine.Shared.YieldProlog.csproj (default targets) ->
/opt/mono-2.11-a/lib/mono/3.5/Microsoft.CSharp.targets (CoreCompile target) ->

        /opt/mono-2.11-a/lib/mono/3.5/Microsoft.CSharp.targets: error : Compiler crashed with code: 1.

         193 Warning(s)
         1 Error(s)

---------------------------------

OpenSimulator git master will not compile on mono 2.11 alpha, crashes compiler with above message, it does however compile fine on mono 2.10.8

source code available here : [ git clone git://opensimulator.org/git/opensim ]
to compile:

runprebuild.sh
xbuild

http://opensimulator.org
irc.freenode.net #opensim-dev
Comment 1 Michael Cerquoni 2012-03-23 04:23:06 UTC
i got some more details with monodevelop 2.8.8.1, no idea if this data is in anyway useful though :

Building: OpenSim.Region.ScriptEngine.Shared.YieldProlog (Debug)
Performing main compilation...
/opt/mono-2.11-a/bin/gmcs /noconfig "/out:/home/nebadon/opensim2/opensim/bin/OpenSim.Region.ScriptEngine.Shared.YieldProlog.dll" "/r:/home/nebadon/opensim2/opensim/bin/log4net.dll" "/r:/home/nebadon/opensim2/opensim/bin/Nini.dll" "/r:/home/nebadon/opensim2/opensim/bin/OpenMetaverseTypes.dll" "/r:/opt/mono-2.11-a/lib/mono/2.0/System.dll" "/r:/opt/mono-2.11-a/lib/mono/2.0/System.Data.dll" "/r:/opt/mono-2.11-a/lib/mono/2.0/System.Web.dll" "/r:/opt/mono-2.11-a/lib/mono/2.0/System.Xml.dll" "/r:/opt/mono-2.11-a/lib/mono/2.0/System.Core.dll" /nologo /warn:4 /debug:full /optimize- /codepage:utf8 "/define:TRACE;DEBUG"  /t:library "/home/nebadon/opensim2/opensim/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/Atom.cs" "/home/nebadon/opensim2/opensim/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/BagofAnswers.cs" "/home/nebadon/opensim2/opensim/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/FindallAnswers.cs" "/home/nebadon/opensim2/opensim/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/Functor.cs" "/home/nebadon/opensim2/opensim/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/Functor1.cs" "/home/nebadon/opensim2/opensim/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/Functor2.cs" "/home/nebadon/opensim2/opensim/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/Functor3.cs" "/home/nebadon/opensim2/opensim/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/IndexedAnswers.cs" "/home/nebadon/opensim2/opensim/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/ListPair.cs" "/home/nebadon/opensim2/opensim/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/Parser.cs" "/home/nebadon/opensim2/opensim/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/PrologException.cs" "/home/nebadon/opensim2/opensim/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/UndefinedPredicateException.cs" "/home/nebadon/opensim2/opensim/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/Variable.cs" "/home/nebadon/opensim2/opensim/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YP.cs" "/home/nebadon/opensim2/opensim/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YPCompiler.cs" 
Internal compiler error at /home/nebadon/opensim2/opensim/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/IndexedAnswers.cs(156,9):: exception caught while emitting Void Dispose()


Unhandled Exception: Mono.CSharp.InternalErrorException: Already created variable `i'
  at Mono.CSharp.LocalVariable.CreateBuilder (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.BlockVariableDeclaration.DoEmit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Statement.Emit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.For.DoEmit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Statement.Emit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Block.DoEmit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.ExplicitBlock.Emit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Block.DoEmit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.ExplicitBlock.Emit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.TryFinally.EmitFinallyBody (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.TryFinallyBlock.EmitForDispose (Mono.CSharp.EmitContext ec, IKVM.Reflection.Emit.LocalBuilder pc, Label end, Boolean have_dispatcher) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.TryFinallyBlock.EmitForDispose (Mono.CSharp.EmitContext ec, IKVM.Reflection.Emit.LocalBuilder pc, Label end, Boolean have_dispatcher) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Iterator.EmitDispose (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.IteratorStorey+DisposeMethod+DisposeMethodStatement.DoEmit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Statement.Emit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Block.DoEmit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.ExplicitBlock.Emit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.ParametersBlock.Emit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.ToplevelBlock.Emit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.MethodData.Emit (Mono.CSharp.TypeDefinition parent) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.MethodOrOperator.Emit () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Method.Emit () [0x00000] in <filename unknown>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: Mono.CSharp.InternalErrorException: Already created variable `i'
  at Mono.CSharp.LocalVariable.CreateBuilder (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.BlockVariableDeclaration.DoEmit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Statement.Emit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.For.DoEmit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Statement.Emit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Block.DoEmit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.ExplicitBlock.Emit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Block.DoEmit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.ExplicitBlock.Emit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.TryFinally.EmitFinallyBody (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.TryFinallyBlock.EmitForDispose (Mono.CSharp.EmitContext ec, IKVM.Reflection.Emit.LocalBuilder pc, Label end, Boolean have_dispatcher) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.TryFinallyBlock.EmitForDispose (Mono.CSharp.EmitContext ec, IKVM.Reflection.Emit.LocalBuilder pc, Label end, Boolean have_dispatcher) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Iterator.EmitDispose (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.IteratorStorey+DisposeMethod+DisposeMethodStatement.DoEmit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Statement.Emit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Block.DoEmit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.ExplicitBlock.Emit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.ParametersBlock.Emit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.ToplevelBlock.Emit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.MethodData.Emit (Mono.CSharp.TypeDefinition parent) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.MethodOrOperator.Emit () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Method.Emit () [0x00000] in <filename unknown>:0 



Unhandled Exception: Mono.CSharp.InternalErrorException: Already created variable `i'
  at Mono.CSharp.LocalVariable.CreateBuilder (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.BlockVariableDeclaration.DoEmit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Statement.Emit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.For.DoEmit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Statement.Emit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Block.DoEmit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.ExplicitBlock.Emit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Block.DoEmit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.ExplicitBlock.Emit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.TryFinally.EmitFinallyBody (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.TryFinallyBlock.EmitForDispose (Mono.CSharp.EmitContext ec, IKVM.Reflection.Emit.LocalBuilder pc, Label end, Boolean have_dispatcher) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.TryFinallyBlock.EmitForDispose (Mono.CSharp.EmitContext ec, IKVM.Reflection.Emit.LocalBuilder pc, Label end, Boolean have_dispatcher) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Iterator.EmitDispose (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.IteratorStorey+DisposeMethod+DisposeMethodStatement.DoEmit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Statement.Emit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Block.DoEmit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.ExplicitBlock.Emit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.ParametersBlock.Emit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.ToplevelBlock.Emit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.MethodData.Emit (Mono.CSharp.TypeDefinition parent) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.MethodOrOperator.Emit () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Method.Emit () [0x00000] in <filename unknown>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: Mono.CSharp.InternalErrorException: Already created variable `i'
  at Mono.CSharp.LocalVariable.CreateBuilder (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.BlockVariableDeclaration.DoEmit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Statement.Emit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.For.DoEmit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Statement.Emit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Block.DoEmit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.ExplicitBlock.Emit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Block.DoEmit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.ExplicitBlock.Emit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.TryFinally.EmitFinallyBody (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.TryFinallyBlock.EmitForDispose (Mono.CSharp.EmitContext ec, IKVM.Reflection.Emit.LocalBuilder pc, Label end, Boolean have_dispatcher) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.TryFinallyBlock.EmitForDispose (Mono.CSharp.EmitContext ec, IKVM.Reflection.Emit.LocalBuilder pc, Label end, Boolean have_dispatcher) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Iterator.EmitDispose (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.IteratorStorey+DisposeMethod+DisposeMethodStatement.DoEmit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Statement.Emit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Block.DoEmit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.ExplicitBlock.Emit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.ParametersBlock.Emit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.ToplevelBlock.Emit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.MethodData.Emit (Mono.CSharp.TypeDefinition parent) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.MethodOrOperator.Emit () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Method.Emit () [0x00000] in <filename unknown>:0 
Build complete -- 1 error, 0 warnings
Comment 2 Michael Cerquoni 2012-03-23 04:34:57 UTC
Created attachment 1563 [details]
file referenced in the monodevelop error report

I don't know if this is helpful but here is the IndexedAnswers.cs file referenced in the monodevelop error report.
Comment 3 Michael Cerquoni 2012-03-23 04:52:54 UTC
This appears to be where things are breaking down, lines 238-239 in IndexedAnswers.cs

---------------------------
                    
                   for (int z = 0; z < nIterators; ++z)
                        iterators[z].Dispose();

---------------------------
Comment 4 Michael Cerquoni 2012-03-23 04:53:59 UTC
oops the z should be an i in previous comment, i was testing to see if changing i to z made any difference, it did not.
Comment 5 Michael Cerquoni 2012-03-23 05:20:22 UTC
ok we were able to get past this with a minor change to our code, the question is should we have to?

original code:
----------------------------

                try
                {
                    if (gotMatch)
                        yield return false;
                }
                finally
                {
                    // Manually finalize all the iterators.
                    for (int i = 0; i < nIterators; ++i)
                        iterators[i].Dispose();
                }

----------------------------

changed to:
----------------------------

		int z = 0;
                try
                {
                    if (gotMatch)
                        yield return false;
                }
                finally
                {
                    // Manually finalize all the iterators.
                    for (z = 0; z < nIterators; ++z)
                        iterators[z].Dispose();
                }

----------------------------
Comment 6 Marek Safar 2012-03-23 14:33:59 UTC
This is compiler bug. Thanks for the bug report
Comment 7 Marek Safar 2012-03-27 04:38:59 UTC
Fixed in master