Bugzilla – Bug 318869
Stack traces seem incorrect
Last modified: 2007-09-15 21:24:34 UTC
---- Reported by miguel@ximian.com 2005-09-02 08:44:03 MST ---- I tried debugging a problem with aspnetedit, when I click on a button in aspnetedit, I get the following stack trace on the command line: free(): invalid pointer 0x8958138! Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object in <0x00000> <unknown method> in (wrapper managed-to-native) Gtk.FileChooserDialog:gtk_file_chooser_dialog_new (intptr,intptr,int,intptr) in <0x000fa> Gtk.FileChooserDialog:.ctor (System.String title, Gtk.Window parent, FileChooserAction action, System.Object[] button_data)in <0x0009d> AspNetEdit.SampleHost.SampleHost:toolboxAddButton_Clicked (System.Object sender, System.EventArgs e) in (wrapper delegate-invoke) System.MulticastDelegate:invoke_void_object_EventArgs (object,System.EventArgs) in <0x00093> GLib.Signal:voidObjectCallback (IntPtr handle, IntPtr gch) in (wrapper native-to-managed) GLib.Signal:voidObjectCallback (intptr,intptr) in <0x00000> <unknown method> in (wrapper managed-to-native) Gtk.Application:gtk_main () in <0x00007> Gtk.Application:Run () in <0x00c9e> AspNetEdit.SampleHost.SampleHost:Main () So about 11 levels deep. If I run this with mdb, I get: free(): invalid pointer 0x89affa8! Process @4 received signal 11 at #0: 0x40315ded. 0x40315ded mov 0x4(%eax),%edx (mdb) where (*) #0: 0x40315ded #1: 0x4031622b #2: 0x447c20db #3: 0x447c2702 #4: 0x447c5389 #5: 0x447cb05f #6: 0x43b4e9b7 #7: 0x43b57dd9 #8: 0x447c90a3 #9: 0x447c87be #10: 0x4474bcdc #11: 0x41b2aac1 #12: 0x4191710b #13: 0x41917254 #14: 0x4191760f #15: 0x419158a8 #16: 0x443dab68 #17: 0x443db506 #18: 0x418f9875 #19: 0x418e6bc4 #20: 0x418e7271 #21: 0x418e77e4 #22: 0x418ea66f #23: 0x41d1feac #24: 0x41d20414 #25: 0x41d2054a #26: 0x418ee9a5 #27: 0x418efcb9 #28: 0x41d1feac #29: 0x41d203b8 #30: 0x41d2054a #31: 0x418e3a10 #32: 0x41d1feac #33: 0x41d20414 #34: 0x41d2054a #35: 0x418e3cc0 #36: 0x418e3d45 #37: 0x431d459e #38: 0x431d42e9 #39: 0x431d3a76 in AspNetEdit.SampleHost.SampleHost.toolboxAddButton_Clicked(System.Object,System.EventArgs)+0xc6 at /home/cvs/aspeditor/src/aspnetedit/SampleHost.cs:306 #40: 0x41e823ba in <(wrapper delegate-invoke) System.MulticastDelegate:invoke_void_object_EventArgs (object,System.EventArgs)>+0x52 at 46 #41: 0x4305c4f8 in GLib.Signal.voidObjectCallback(System.IntPtr,System.IntPtr)+0xc0 at /home/cvs/gtk-sharp/glib/Signal.cs:175 #42: 0x41e71abe in <(wrapper native-to-managed) GLib.Signal:voidObjectCallback (intptr,intptr)>+0x36 at 13 #43: 0x41d287b1 #44: 0x41d19d9b #45: 0x41d2b286 #46: 0x41d2c371 #47: 0x41d2c575 #48: 0x41a061bd #49: 0x41d287b1 #50: 0x41d19d9b #51: 0x41d2aca0 #52: 0x41d2c371 #53: 0x41d2c6a2 #54: 0x418714af #55: 0x418726d7 #56: 0x41d287b1 #57: 0x41d19a87 #58: 0x41d19d9b #59: 0x41d2aae2 #60: 0x41d2c371 #61: 0x41d2c6a2 #62: 0x418713fc #63: 0x4187251d #64: 0x41941c8c #65: 0x41d19a87 #66: 0x41d19d9b #67: 0x41d2b0d6 #68: 0x41d2c0cc #69: 0x41d2c6a2 #70: 0x41a5f89e #71: 0x41a5f3d6 #72: 0x41940061 #73: 0x4193eb9d #74: 0x41b7f1e1 #75: 0x40257e87 #76: 0x4025a5c7 #77: 0x4025b7b7 #78: 0x4193e25d #79: 0x431d2289 in <(wrapper managed-to-native) Gtk.Application:gtk_main ()>+0x29 at 9 #80: 0x431d2248 in Gtk.Application.Run()+0x8 at /home/cvs/gtk-sharp/gtk/Application.cs:100 #81: 0x40d9dc1e in AspNetEdit.SampleHost.SampleHost.Main()+0x13ae at /home/cvs/aspeditor/src/aspnetedit/SampleHost.cs:197 So 81 frames, so my feeling is that there is something wrong on that stack trace ---- Additional Comments From miguel@ximian.com 2005-09-05 13:52:34 MST ---- reassigning to new debugger owner. ---- Additional Comments From martin@ximian.com 2005-09-05 13:55:02 MST ---- The stack trace is from an application called `aspnetedit' which is in trunk/aspnetedit in SVN. ---- Additional Comments From martin@ximian.com 2005-09-07 13:45:37 MST ---- Closing as INVALID, give me a real application with real dependencies with actually builds. ---- Additional Comments From miguel@ximian.com 2005-09-07 15:02:15 MST ---- I just built it, it works. If you have problems building it, find me on irc, and we can discuss it. ---- Additional Comments From miguel@ximian.com 2005-09-08 10:52:00 MST ---- Here is a small test case: 1. Compile: mcs a.cs -pkg:gtk-sharp 2. Run inside mdb: mdb a.exe (mdb) cont 3. Click on button. 4. Issue the "where" command using Gtk; using System; class D { D val; static void Main () { Application.Init (); Window w = new Window ("XX"); Button b = new Button ("Hola"); w.Add (b); b.Clicked += delegate { D d = new D (); D x = d.val.val; }; w.ShowAll (); Application.Run (); } } ---- Additional Comments From martin@ximian.com 2005-09-08 11:50:45 MST ---- After fixing a small issue, I'm getting this: (mdb) c Process @4 received signal 11 at #0: 0x40de61d4. 0x40de61d4 mov 0x8(%eax),%eax (mdb) bt (*) #0: 0x40de61d4 #1: 0x40de618a #2: 0x40de5310 in GLib.Signal.voidObjectCallback(System.IntPtr,System.IntPtr)+0xc0 at /home/martin/monocvs/gtk-sharp/glib/Signal.cs:181 #3: 0x40de514e in <(wrapper native-to-managed) GLib.Signal:voidObjectCallback (intptr,intptr)>+0x36 at 13 #4: 0x4188e7b1 in g_cclosure_marshal_VOID__VOID+0xa1 #5: 0x4187fd9b in g_closure_invoke+0x10b #6: 0x41891286 in g_signal_chain_from_overridden+0x1506 #7: 0x41892371 in g_signal_emit_valist+0x941 #8: 0x418926a2 in g_signal_emit+0x32 #9: 0x41427101 in gtk_button_clicked+0x51 #10: 0x41428185 in gtk_button_new+0xd85 #11: 0x4188e7b1 in g_cclosure_marshal_VOID__VOID+0xa1 #12: 0x4187fa87 in g_closure_ref+0x137 #13: 0x4187fd9b in g_closure_invoke+0x10b #14: 0x41890ae2 in g_signal_chain_from_overridden+0xd62 #15: 0x41892371 in g_signal_emit_valist+0x941 #16: 0x418926a2 in g_signal_emit+0x32 #17: 0x414271b1 in gtk_button_released+0x51 #18: 0x4142723f in gtk_button_released+0xdf #19: 0x414e9024 in gtk_marshal_BOOLEAN__VOID+0x38b4 #20: 0x4187fa87 in g_closure_ref+0x137 #21: 0x4187fd9b in g_closure_invoke+0x10b #22: 0x418910d6 in g_signal_chain_from_overridden+0x1356 #23: 0x418920cc in g_signal_emit_valist+0x69c #24: 0x418926a2 in g_signal_emit+0x32 #25: 0x415e0e64 in gtk_widget_get_default_style+0x364 #26: 0x414e14e9 in gtk_propagate_event+0xc9 #27: 0x414e2a11 in gtk_main_do_event+0x371 #28: 0x416ebc22 in gdk_add_client_message_filter+0x1b2 #29: 0x40294e87 in g_main_context_dispatch+0x1d7 #30: 0x402975c7 in g_main_context_acquire+0x5a7 #31: 0x402987b7 in g_main_loop_run+0x207 #32: 0x414e2ec3 in gtk_main+0xb3 #33: 0x40de5231 in <(wrapper managed-to-native) Gtk.Application:gtk_main ()>+0x29 at 9 #34: 0x40de51f0 in Gtk.Application.Run()+0x8 at /home/martin/monocvs/gtk-sharp/gtk/Application.cs:100 #35: 0x40ddc89d in D.Main()+0xd5 at /home/martin/monocvs/debugger/test/A.cs:19 (mdb) ---- Additional Comments From martin@ximian.com 2005-09-08 12:52:17 MST ---- This should now be fixed as of r49715. ---- Additional Comments From martin@ximian.com 2006-04-18 13:04:09 MST ---- Old. ---- Additional Comments From miguel@ximian.com 2006-04-18 13:31:59 MST ---- Wow, the stack trace looks beautiful now. Unknown operating system unknown. Setting to default OS "Other".