[Mono-bugs] [Bug 74916][Nor] New - System.Reflection.Emit.TypeBuilder:CreateType crashes

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Thu, 12 May 2005 02:22:01 -0400 (EDT)


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 dsilva@ccs.neu.edu.

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

--- shadow/74916	2005-05-12 02:22:01.000000000 -0400
+++ shadow/74916.tmp.32325	2005-05-12 02:22:01.000000000 -0400
@@ -0,0 +1,65 @@
+Bug#: 74916
+Product: Mono: Class Libraries
+Version: 1.1
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: CORLIB
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: dsilva@ccs.neu.edu               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: System.Reflection.Emit.TypeBuilder:CreateType crashes
+
+Description of Problem:
+
+I am using System.Reflection to create an assembly and I must be calling
+TypeBuilder::CreateType at the wrong time, but CreateType is crashing
+instead of telling me where the problem lies.
+
+CreateType can throw its own exceptions, but it should not propagate
+exceptions thrown by methods it called for itself.  Also, CreateType cannot
+throw NullReferenceExceptions:
+http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemreflectionemittypebuilderclasscreatetypetopic.asp
+
+
+Steps to reproduce the problem:
+
+I haven't isolated what in my code causes this exception.  Please let me
+know if it would help.  In TypeBuilder.CreateType, it's the line that says
+ "created = create_runtime_class (this);"
+
+
+Actual Results:
+
+Unhandled Exception: System.NullReferenceException: Object reference not
+set to an instance of an object
+in <0x00000> <unknown method>
+in (wrapper managed-to-native)
+System.Reflection.Emit.TypeBuilder:create_runtime_class
+(System.Reflection.Emit.TypeBuilder)
+in [0x00179] (at
+/tmp/mono-1.1.6/mcs/class/corlib/System.Reflection.Emit/TypeBuilder.cs:671)
+System.Reflection.Emit.TypeBuilder:CreateType ()
+in [0x000c8] (at
+/home/dsilva/code/contract-attributes/ProgramWrapper.cs:127)
+ProgramWrapper+RewriteRules:generatePreconditionClass
+(System.Reflection.Emit.ModuleBuilder newModule,
+System.Collections.Hashtable typerefs, ITypeDefinition iface,
+IModuleDefinition module, IAssemblyDefinition asm)
+
+
+Expected Results:
+
+Unhandled Exception: System.InvalidOperationException: blah blah blah
+in [0x000c8] (at
+/home/dsilva/code/contract-attributes/ProgramWrapper.cs:127)
+ProgramWrapper+RewriteRules:generatePreconditionClass
+(System.Reflection.Emit.ModuleBuilder newModule,
+System.Collections.Hashtable typerefs, ITypeDefinition iface,
+IModuleDefinition module, IAssemblyDefinition asm)