[Mono-bugs] [Bug 633275] Abort trap in smcs

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Sep 14 08:05:29 EDT 2010


https://bugzilla.novell.com/show_bug.cgi?id=633275

https://bugzilla.novell.com/show_bug.cgi?id=633275#c5


Benjamin Nitschke <Benjamin at exDream.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |NEW
       InfoProvider|Benjamin at exDream.com        |

--- Comment #5 from Benjamin Nitschke <Benjamin at exDream.com> 2010-09-14 12:05:28 UTC ---
Created an attachment (id=389487)
 --> (http://bugzilla.novell.com/attachment.cgi?id=389487)
Sample for the Abort Trap compiler crash when using optional parameters

Hi again.

Today I just grabbed all required files to reproduce the Abort Trap issue and
put them into one simple project and I was able to reproduce the issue! Last
week I tried reproducing the issue with a simple sample, but there was no Abort
Trap compiler crash then (see Main.cs). We had some other stuff to do, so sorry
for the delay again. All files are obfuscated a little (no comments, not really
useful) except for the InputSystem/Command.cs file where the compiler crash
occurs. Tthis is the output from MonoDevelop (using MonoTouch), but the same
happens in the command line:
------------------
Performing main compilation...
/Developer/MonoTouch/usr/bin/smcs [...]
/Developer/MonoTouch/usr/bin/smcs: line 2: 11587 Abort trap             
MONO_PATH=/Developer/MonoTouch/usr/lib/mono/2.1
/Developer/MonoTouch/usr/bin/mono
/Developer/MonoTouch/usr/lib/mono/2.1/smcs.exe "$@"
/Developer/MonoTouch/usr/bin/smcs: line 2: 11587 Abort trap             
MONO_PATH=/Developer/MonoTouch/usr/lib/mono/2.1
/Developer/MonoTouch/usr/bin/mono
/Developer/MonoTouch/usr/lib/mono/2.1/smcs.exe "$@"
Build complete -- 1 error, 0 warnings
------------------

When compiling the same with MonoDevelop not targeting iPhone/iPad (normal app)
the same thing happens, but at least it gives you more detail where the error
occurred. This probably helps you guys the most,
Mono.CSharp.EnumMember.Define() just should not throw that
NullRefrenceException:
------------------
Performing main compilation...
/Library/Frameworks/Mono.framework/Versions/2.6.7/bin/gmcs [...]
Unhandled Exception: Mono.CSharp.InternalErrorException:
/Users/exdream/Projects/TestAbortTrapBug/Command.cs(14,22):
Delta.InputSystem.Command ---> Mono.CSharp.InternalErrorException:
/Users/exdream/Projects/TestAbortTrapBug/Command.cs(133,26):
Delta.InputSystem.Command.Command(Delta.InputSystem.CommandEventWrapper,
Delta.InputSystem.InputButton, Delta.InputSystem.InputState, InputButton[])
---> System.NullReferenceException: Object reference not set to an instance of
an object
  at Mono.CSharp.EnumMember.Define () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.TypeContainer.FindMembers (MemberTypes mt, BindingFlags bf,
System.Reflection.MemberFilter filter, System.Object criteria) [0x00000] in
<filename unknown>:0 
  at Mono.CSharp.TypeManager.MemberLookup_FindMembers (System.Type t,
MemberTypes mt, BindingFlags bf, System.String name, System.Boolean&
used_cache) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.TypeManager.RealMemberLookup (System.Type invocation_type,
System.Type qualifier_type, System.Type queried_type, MemberTypes mt,
BindingFlags original_bf, System.String name, IList almost_match) [0x00000] in
<filename unknown>:0 
  at Mono.CSharp.TypeManager.MemberLookup (System.Type invocation_type,
System.Type qualifier_type, System.Type queried_type, MemberTypes mt,
BindingFlags original_bf, System.String name, IList almost_match) [0x00000] in
<filename unknown>:0 
  at Mono.CSharp.Expression.MemberLookup (Mono.CSharp.CompilerContext ctx,
System.Type container_type, System.Type qualifier_type, System.Type
queried_type, System.String name, MemberTypes mt, BindingFlags bf, Location
loc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Expression.MemberLookup (Mono.CSharp.CompilerContext ctx,
System.Type container_type, System.Type qualifier_type, System.Type
queried_type, System.String name, Location loc) [0x00000] in <filename
unknown>:0 
  at Mono.CSharp.MemberAccess.DoResolve (Mono.CSharp.ResolveContext ec,
Mono.CSharp.Expression right_side) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.MemberAccess.DoResolve (Mono.CSharp.ResolveContext ec)
[0x00000] in <filename unknown>:0 
  at Mono.CSharp.Expression.Resolve (Mono.CSharp.ResolveContext ec,
ResolveFlags flags) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Expression.Resolve (Mono.CSharp.ResolveContext ec) [0x00000]
in <filename unknown>:0 
  at Mono.CSharp.Parameter.Resolve (IMemberContext rc) [0x00000] in <filename
unknown>:0 
  at Mono.CSharp.ParametersCompiled.Resolve (IMemberContext ec) [0x00000] in
<filename unknown>:0 
  at Mono.CSharp.InterfaceMemberBase.DefineParameters
(Mono.CSharp.ParametersCompiled parameters) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Constructor.CheckBase () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Constructor.Define () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.TypeContainer+MemberCoreArrayList.DefineContainerMembers ()
[0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at Mono.CSharp.TypeContainer+MemberCoreArrayList.DefineContainerMembers ()
[0x00000] in <filename unknown>:0 
  at Mono.CSharp.TypeContainer.DefineContainerMembers
(Mono.CSharp.MemberCoreArrayList mcal) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Class.DefineContainerMembers (Mono.CSharp.MemberCoreArrayList
list) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.TypeContainer.DoDefineMembers () [0x00000] in <filename
unknown>:0 
  at Mono.CSharp.Class.DoDefineMembers () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.TypeContainer.Define () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.ClassOrStruct.Define () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Class.Define () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.RootContext.PopulateTypes () [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at Mono.CSharp.RootContext.PopulateTypes () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Driver.Compile () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Driver.Main (System.String[] args) [0x00000] in <filename
unknown>:0 
Build complete -- 1 error, 0 warnings
------------------

And finally my comments from the Command.cs file and the workaround:
//This sadly crashes on Mono and MonoTouch compilers (tested in command line
and via this MonoDevelop project, 2010-09-14):
//Unhandled Exception: Mono.CSharp.InternalErrorException:
/Users/ben/Public/DeltaMac/InputSystem/Command.cs(17,22):
Delta.InputSystem.Command ---> Mono.CSharp.InternalErrorException:
/Users/ben/Public/DeltaMac/InputSystem/Command.cs(136,26):
Delta.InputSystem.Command.Command(Delta.InputSystem.CommandEventWrapper,
Delta.InputSystem.InputButton, Delta.InputSystem.InputState, InputButton[])
---> System.NullReferenceException: Object reference not set to an instance of
an object
//at Mono.CSharp.EnumMember.Define () [0x00000] in <filename unknown>:0 
//at Mono.CSharp.TypeContainer.FindMembers (MemberTypes mt, BindingFlags bf,
System.Reflection.MemberFilter filter, System.Object criteria) [0x00000] in
<filename unknown>:0 
//at Mono.CSharp.TypeManager.MemberLookup_FindMembers (System.Type t,
MemberTypes mt, BindingFlags bf, System.String name, System.Boolean&
used_cache) [0x00000] in <filename unknown>:0 
InputState setState = InputState.Released,
InputButton[] setModifiers = null)
//Note: Removing the optional parameters and just providing 2 extra
constructors for them instead works fine!

I hope this helps, we just fixed our Abort Trap crash by removing those
optional parameters where it crashed.

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list