[Mono-bugs] [Bug 69774][Blo] New - pinvoking gtk+ vararg methods throws a NullReferenceException

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sun, 21 Nov 2004 13:01:04 -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 jeroen@xs4all.nl.

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

--- shadow/69774	2004-11-21 13:01:04.000000000 -0500
+++ shadow/69774.tmp.32347	2004-11-21 13:01:04.000000000 -0500
@@ -0,0 +1,72 @@
+Bug#: 69774
+Product: Mono: Runtime
+Version: 1.1
+OS: 
+OS Details: fc3
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Blocker
+Component: misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: Jeroen@xs4all.nl               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: pinvoking gtk+ vararg methods throws a NullReferenceException
+
+With mono/mcs HEAD from ~2 days ago on x86_64 hardware (Fedora Core 3
+x86_64), it appears that any gtk+ method called from gtk# which has varargs
+fails with a NullReferenceException. Gtk# doesn't actually specify any
+varargs; it just passes IntPtr.Zero as the first vararg.
+
+From running fifteen.exe (gtk-sharp-1-0-branch): 
+
+$ mono fifteen.exe
+
+(Fifteen:24298): ��-CRITICAL **: (NULL) message
+
+Unhandled Exception: System.NullReferenceException: Object reference not
+set to an instance of an object
+in <0x67bbcbae> (wrapper managed-to-native)
+Gnome.CanvasItem:gnome_canvas_item_new (intptr,GLib.GType,intptr)
+in <0x0000f> (wrapper managed-to-native)
+Gnome.CanvasItem:gnome_canvas_item_new (intptr,GLib.GType,intptr)
+in <0x0004e> Gnome.CanvasItem:.ctor (Gnome.CanvasGroup,GLib.GType)
+in <0x00031> Gnome.CanvasGroup:.ctor (Gnome.CanvasGroup,GLib.GType)
+in <0x00082> BoardPiece:.ctor (Gnome.CanvasGroup,BoardPiece[],int,int,int)
+in <0x007a3> Fifteen:Main (string[])
+
+Segmentation fault
+
+This also happens with Gtk# HEAD and the gtk_file_chooser_dialog_new method
+(also has varargs). Works fine on linux/ppc. Haven't been able to test on
+i386 (no system ready yet).
+
+From gdb:
+
+(gdb) r
+Starting program: /home/jeroen/Mono/mbuilt/bin/mono fifteen.exe
+[Thread debugging using libthread_db enabled]
+[New Thread 182894176960 (LWP 24303)]
+Detaching after fork from child process 24306.
+[New Thread 1077934432 (LWP 24307)]
+[New Thread 1082128736 (LWP 24308)]
+
+(Fifteen:24303): &#65533;&#65533;-CRITICAL **: (NULL) message
+
+Program received signal SIGSEGV, Segmentation fault.
+[Switching to Thread 1082128736 (LWP 24308)]
+0x00000000004339de in amd64_magic_trampoline (regs=0x2a97da484c,
+    code=0x2a98876368
+"UH\213&#65533;SATAUAVAWH\203&#65533;xL\213&#65533;H\211u\200H\211\225x&#65533;&#65533;&#65533;H\211\215p&#65533;&#65533;&#65533;L\211\205h&#65533;&#65533;&#65533;L\211\215`&#65533;&#65533;&#65533;M3&#65533;M3&#65533;&#65533;E&#65533;",
+m=0x942060,
+    tramp=0x78a850 "\206\030") at tramp-amd64.c:126
+126                     if (!m->klass->valuetype) {
+
+From kangaroo on irc:
+
+kangaroo> jit bug
+kangaroo> file it for zoltan
+kangaroo> its trampolining some value wrong