[Mono-bugs] [Bug 78972][Blo] New - Vararg method in external dll not found when invoked with no variable args

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Fri Jul 28 12:25:19 EDT 2006


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 roberto.costa at st.com.

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

--- shadow/78972	2006-07-28 12:25:19.000000000 -0400
+++ shadow/78972.tmp.29516	2006-07-28 12:25:19.000000000 -0400
@@ -0,0 +1,55 @@
+Bug#: 78972
+Product: Mono: Runtime
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Blocker
+Component: misc
+AssignedTo: massi at ximian.com                            
+ReportedBy: roberto.costa at st.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Summary: Vararg method in external dll not found when invoked with no variable args
+
+Below you can find a short C example.
+
+---- File foo.c -------------
+void foo(char *s, ...)
+{
+}
+-----------------------------
+
+---- File test.c ------------
+extern void foo(char*, ...);
+
+int main()
+{
+    foo ("Ciao\n");
+    return 0;
+}
+-----------------------------
+
+Both test.exe and foo.dll have to be compiled with gcc4cil:
+cil32-gcc -O0 foo.c -o foo.dll
+cil32-gcc -L . "-Wl,-l foo.dll" -O0 test.c -o test.exe
+
+Here is what I get by making Mono 1.1.16.1 execute test.exe:
+
+mono test.exe
+
+** (test.exe:11563): WARNING **: Missing method foo::foo(sbyte*) in
+assembly /home/robertoc/gcc4net/tests/trunk/foo.dll, referenced in assembly
+/home/robertoc/gcc4net/tests/trunk/test.exe
+
+Unhandled Exception: System.MissingMethodException: Method not found:
+'foo.foo'.
+  at <0x00000> <unknown method>
+  at <Module>..start (System.String[] args) [0x00000]
+
+I believe method 'foo' is correctly specified in dll foo... by the way, if
+'foo' is invoked with at least one variable argument in test.c, then
+everything works.


More information about the mono-bugs mailing list