[Mono-bugs] [Bug 76981][Nor] New - mono aborts when using reflection

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Tue Dec 13 12:46:19 EST 2005

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 sebastien.robitaille at croesus.com.


--- shadow/76981	2005-12-13 12:46:18.000000000 -0500
+++ shadow/76981.tmp.1172	2005-12-13 12:46:18.000000000 -0500
@@ -0,0 +1,95 @@
+Bug#: 76981
+Product: Mono: Runtime
+Version: 1.1
+OS: Red Hat 9.0
+OS Details: 
+Status: NEW   
+Priority: Normal
+Component: misc
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: sebastien.robitaille at croesus.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+Summary: mono aborts when using reflection
+Description of Problem:
+The problem is difficult to reproduce outside our application (I tried to 
+reproduce it using a test case without success).
+Here's the mono output:
+** ERROR **: file class.c: line 1641 (mono_class_setup_vtable_general): 
+should not be reached
+Aborted (core dumped)
+Our application iterates on the dll files availables in a directory and 
+uses reflection to activate objects contained in these assemblies. The 
+application searches inside every assembly to find the implementations of 
+a pre-defined interface.
+Let say "IMyInterface" is the interface we are searching for,
+and suppose we have 2 assemlies (A.dll and B.dll) in the directory. If 
+A.dll and B.dll both contain an implementation of the IMyInterface (let 
+say ClassA and ClassB), the crash does not arise, both ClassA and ClassB 
+objects are instanciated. On the other hand, if A.dll does not contain an 
+implementation of the IMyInterface, the crash will arise when searching 
+in the B.dll assembly (assuming A.dll was searched first).
+Our code is quite simple, here's a sample:
+Assembly assembly = Assembly.LoadFrom(assemblyName);
+foreach(Module module in assembly.GetModules())
+	foreach(Type type in module.GetTypes())
+	{
+		if(	!type.IsAbstract && 
+			type.IsClass &&
+			typeof(IMyInterface).IsAssignableFrom(type))
+		{
+			try
+			{
+				IMyInterface impl = (IMyInterface) 
+				// Uses the IMyInterface object created...
+				// ...
+			}
+			catch
+			{
+			}
+		}
+	}
+Steps to reproduce the problem:
+1. This problem is difficult to reproduce with a test case but our 
+application always crash when this situation occurs.
+Actual Results:
+mono aborts.
+Expected Results:
+Program continues to run.
+How often does this happen? 
+Additional Information:
+Linux RedHat 9.0
+bash-2.05b$ mono --version
+Mono JIT compiler version 1.1.9, (C) 2002-2005 Novell, Inc and 
+Contributors. www.mono-project.com
+        TLS:           __thread
+        GC:            Included Boehm (with typed GC)
+        SIGSEGV      : normal
+        Globalization: normal

More information about the mono-bugs mailing list