[Mono-bugs] [Bug 38291][Min] Changed - Strange Reflection crash.

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
Sun, 23 Feb 2003 02:28:48 -0500 (EST)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by miguel@ximian.com.

http://bugzilla.ximian.com/show_bug.cgi?id=38291

--- shadow/38291	Wed Feb 19 15:25:28 2003
+++ shadow/38291.tmp.30395	Sun Feb 23 02:28:48 2003
@@ -1,23 +1,23 @@
 Bug#: 38291
-Product: Mono/MCS
+Product: Mono/Runtime
 Version: unspecified
 OS: unknown
 OS Details: Mandrake 9.0
 Status: NEW   
 Resolution: 
 Severity: Unknown
-Priority: Normal
-Component: Misc
+Priority: Minor
+Component: misc
 AssignedTo: mono-bugs@ximian.com                            
 ReportedBy: pt99par@student.bth.se               
 QAContact: mono-bugs@ximian.com
 TargetMilestone: ---
 URL: 
 Cc: 
-Summary: mcs gets exception when compiling this incorrect code
+Summary: Strange Reflection crash.
 
 Please fill in this template when reporting a bug, unless you know what you
 are doing.
 Description of Problem:
 
 When compiling this incorrect code the compiler crashes:
@@ -53,6 +53,82 @@
     public static void Main( string[] args ) {
 	NameValueCollection c = 
          new NameValueCollection();c.Item["k"]="v";
     }
 }
 ------------------
+
+------- Additional Comments From miguel@ximian.com  2003-02-23 02:28 -------
+I am setting the priority to `Minor', because it is not a
+show-stopper, this bug is only exposed when compiling invalid C# code. 
+
+Am re-assigning this to Mono/runtime, I believe it might be a bug in
+our class libraries.   But the stack trace is very puzzling:
+
+Compiling the code above, I get the following crash:
+Exception caught by the compiler while compiling:
+   Block that caused the problem begin at: bug.cs: (3)
+                     Block being compiled: [bug.cs: (3),bug.cs: (6)]
+
+Unhandled Exception: System.Reflection.TargetParameterCountException:
+Number of parameter does not match expected count.
+in <0x00099> 00 System.Reflection.Binder:ConvertArgs
+(System.Reflection.Binder,object[],System.Reflection.ParameterInfo[],System.Globalization.CultureInfo)
+in <0x00055> 00 System.Reflection.MonoMethod:Invoke
+(object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo)
+in <0x00106> 00 System.Reflection.MonoProperty:GetValue
+(object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo)
+in <0x00015> 00 System.Reflection.MethodBase:get_IsStatic ()
+in [0x00000] (at /cvs/mcs/mcs/ecore.cs:3847) 00
+Mono.CSharp.MethodGroupExpr:get_IsInstance ()
+in [0x0031c] (at /cvs/mcs/mcs/expression.cs:6085) 00
+Mono.CSharp.MemberAccess:ResolveMemberAccess
+(Mono.CSharp.EmitContext,Mono.CSharp.Expression,Mono.CSharp.Expression,Mono.CSharp.Location,Mono.CSharp.Expression)
+in [0x001b3] (at /cvs/mcs/mcs/expression.cs:6204) 00
+Mono.CSharp.MemberAccess:DoResolve
+(Mono.CSharp.EmitContext,Mono.CSharp.Expression,Mono.CSharp.ResolveFlags)
+in [0x00000] (at /cvs/mcs/mcs/expression.cs:6221) 00
+Mono.CSharp.MemberAccess:DoResolve (Mono.CSharp.EmitContext)
+in [0x0005a] (at /cvs/mcs/mcs/ecore.cs:312) 00
+Mono.CSharp.Expression:Resolve
+(Mono.CSharp.EmitContext,Mono.CSharp.ResolveFlags)
+in [0x00000] (at /cvs/mcs/mcs/expression.cs:6377) 00
+Mono.CSharp.ElementAccess:CommonResolve (Mono.CSharp.EmitContext)
+in [0x00000] (at /cvs/mcs/mcs/expression.cs:6434) 00
+Mono.CSharp.ElementAccess:DoResolveLValue
+(Mono.CSharp.EmitContext,Mono.CSharp.Expression)
+in [0x00000] (at /cvs/mcs/mcs/ecore.cs:415) 00
+Mono.CSharp.Expression:ResolveLValue
+(Mono.CSharp.EmitContext,Mono.CSharp.Expression)
+in [0x00126] (at /cvs/mcs/mcs/assign.cs:196) 00
+Mono.CSharp.Assign:DoResolve (Mono.CSharp.EmitContext)
+in [0x0005a] (at /cvs/mcs/mcs/ecore.cs:312) 00
+Mono.CSharp.Expression:Resolve
+(Mono.CSharp.EmitContext,Mono.CSharp.ResolveFlags)
+in [0x00000] (at /cvs/mcs/mcs/statement.cs:579) 00
+Mono.CSharp.StatementExpression:Resolve (Mono.CSharp.EmitContext)
+in [0x000b1] (at /cvs/mcs/mcs/statement.cs:3101) 00
+Mono.CSharp.Block:Resolve (Mono.CSharp.EmitContext)
+in [0x00056] (at /cvs/mcs/mcs/codegen.cs:427) 00
+Mono.CSharp.EmitContext:EmitTopBlock
+(Mono.CSharp.Block,Mono.CSharp.InternalParameters,Mono.CSharp.Location)
+in [0x00126] (at /cvs/mcs/mcs/codegen.cs:454) 00
+Mono.CSharp.EmitContext:EmitTopBlock
+(Mono.CSharp.Block,Mono.CSharp.InternalParameters,Mono.CSharp.Location)
+in [0x00254] (at /cvs/mcs/mcs/class.cs:3244) 00
+Mono.CSharp.MethodData:Emit
+(Mono.CSharp.TypeContainer,Mono.CSharp.Block,object)
+in [0x00000] (at /cvs/mcs/mcs/class.cs:2500) 00
+Mono.CSharp.Method:Emit (Mono.CSharp.TypeContainer)
+in [0x00072] (at /cvs/mcs/mcs/class.cs:1491) 00
+Mono.CSharp.TypeContainer:Emit ()
+in [0x00190] (at /cvs/mcs/mcs/rootcontext.cs:775) 00
+Mono.CSharp.RootContext:EmitCode ()
+in [0x003ce] (at /cvs/mcs/mcs/driver.cs:1269) 00
+Mono.CSharp.Driver:MainDriver (string[])
+in [0x00000] (at /cvs/mcs/mcs/driver.cs:246) 00
+Mono.CSharp.Driver:Main (string[])
+
+The MethodBase.get_IsStatic method in the source code nowhere makes a
+call to GetValue on a Property, so this is very strange to me.
+
+Miguel