|
Bugzilla – Full Text Bug Listing |
| Summary: | [Regression] Exception when showing popup menus with MenuPositionFunc | ||
|---|---|---|---|
| Product: | [Mono] Mono: Runtime | Reporter: | Sanford Armstrong <saarmstrong> |
| Component: | misc | Assignee: | Mono Bugs <mono-bugs> |
| Status: | VERIFIED FIXED | QA Contact: | Mono Bugs <mono-bugs> |
| Severity: | Blocker | ||
| Priority: | P1 - Urgent | CC: | forgotten_vxPDddArjq |
| Version: | 2.4.x | ||
| Target Milestone: | 2.4.x | ||
| Hardware: | Other | ||
| OS: | Other | ||
| Whiteboard: | |||
| Found By: | --- | Services Priority: | |
| Business Priority: | Blocker: | --- | |
| Marketing QA Status: | --- | IT Deployment: | --- |
| Attachments: | Simple test case | ||
|
Description
Sanford Armstrong
2009-02-16 17:43:57 UTC
Moving to gtk#, because a coworker saw this bug when trying to click on their Tomboy applet with the same revision of the 2.12 branch. Also, I upped the priority/severity quite a bit, as this is on the stable branch... Exception in Gtk# callback delegate Note: Applications can use GLib.ExceptionManager.UnhandledException to handle the exception. System.NullReferenceException: Object reference not set to an instance of an object at (wrapper native-to-managed) GtkSharp.MenuPositionFuncWrapper.NativeCallback (intptr,int&,int&,byte,intptr) <0x00037> at (wrapper managed-to-native) Gtk.Menu.gtk_menu_popup (intptr,intptr,intptr,GtkSharp.MenuPositionFuncNative,intptr,uint,uint) <0x00004> at Gtk.Menu.Popup (Gtk.Widget,Gtk.Widget,Gtk.MenuPositionFunc,uint,uint) [0x00007] in /usr/src/packages/BUILD/gtk-sharp-126100/gtk/generated/Menu.cs:187 at Tomboy.GuiUtils.PopupMenu (Gtk.Menu,Gdk.EventButton,Gtk.MenuPositionFunc) [0x00012] in /usr/src/packages/BUILD/tomboy-0.12.1/Tomboy/Utils.cs:79 at Tomboy.TomboyTrayIcon.ShowMenu (bool) [0x00023] in /usr/src/packages/BUILD/tomboy-0.12.1/Tomboy/Tray.cs:180 at Tomboy.TomboyTrayIcon.OnActivate () [0x00000] in /usr/src/packages/BUILD/tomboy-0.12.1/Tomboy/Tray.cs:160 at Gtk.StatusIcon.activate_cb (intptr) [0x0000d] in /usr/src/packages/BUILD/gtk-sharp-126100/gtk/generated/StatusIcon.cs:262 at GLib.ExceptionManager.RaiseUnhandledException(System.Exception e, Boolean is_terminal) in /usr/src/packages/BUILD/gtk-sharp-126100/glib/ExceptionManager.cs:line 58 at Gtk.StatusIcon.activate_cb(IntPtr status_icon) in /usr/src/packages/BUILD/gtk-sharp-126100/gtk/generated/StatusIcon.cs:line 264 at Gtk.Application.gtk_main() at Gtk.Application.Run() in /usr/src/packages/BUILD/gtk-sharp-126100/gtk/generated/AboutDialog.cs:line 1 at Gnome.Program.Run() in /usr/src/packages/BUILD/gnome-sharp-2.24.0/gnome/generated/About.cs:line 1 at Tomboy.Application.StartMainLoop() in /usr/src/packages/BUILD/tomboy-0.12.1/Tomboy/Tomboy.cs:line 1 at Tomboy.Tomboy.StartTrayIcon() in /usr/src/packages/BUILD/tomboy-0.12.1/Tomboy/Tomboy.cs:line 129 at Tomboy.Tomboy.Main(System.String[] args) in /usr/src/packages/BUILD/tomboy-0.12.1/Tomboy/Tomboy.cs:line 92 ray@ray-laptop:~/.tomboy> Updating summary. Also, trying to make a small test case, but so far not having much luck, which is troubling. Created attachment 273148 [details] Simple test case Oh, I figured out how to reproduce. Should have been obvious from the stack trace. You just have to specify a MenuPositionFunc in the Popup call. Attaching a simple test case based on the sample here: http://www.mono-project.com/GtkSharpNotificationIcon Just right-click the StatusIcon and you should experience the crash. Note that if it does not crash, the context menu will appear in the upper left corner of the screen based on my silly MenuPositionFunc. It doesn't matter what I build against. But this test works fine in gtk# 2.12.5 on Mono 2.0.1, and crashes in 2.12.8 (r126100 of gtk-sharp-2-12-branch) on Mono 2.4. Is there a specific reason you believe this is a gtk-sharp bug as opposed to a regression in mono between 2.0 and 2.4? I can't recall any significant changes in callback parameter handling between 2.12.5 and 2.12.8. I can take a look at this tomorrow, but it would be interesting to see if gtk-sharp-2.12.8 works on mono-2.0 and/or gtk-sharp-2.12.5 fails on 2.4. (In reply to comment #4) > Is there a specific reason you believe this is a gtk-sharp bug as opposed to a > regression in mono between 2.0 and 2.4? I can't recall any significant changes > in callback parameter handling between 2.12.5 and 2.12.8. Because I didn't know any better and was unable to test other combinations. When in doubt, isn't it standard policy in this world to blame gtk-sharp for everything? :-P > I can take a look at this tomorrow, but it would be interesting to see if > gtk-sharp-2.12.8 works on mono-2.0 and/or gtk-sharp-2.12.5 fails on 2.4. I can easily try the latter combination tomorrow if you haven't already gotten to it by then. Heh, just as it's equally standard policy for me to blame mono. ;-) I just ran your sample with gtk-sharp-2-12-branch and mono 2.2 and I get a menu item at 0,0 with no crash, FWIW. It's possible they've fixed something in mono which exposed a latent gtk-sharp bug. I don't see it in a cursory inspection of that NativeCallback marshaler though. Okay, with latest mono-2-4 (r127080), I can still reproduce with gtk-sharp 2.12.5 and 2.12.6 from tarball. I'm going to ask for guidance on how to reassign this bug. Adding Zoltan to CC list. Any thoughts on how to redirect this bug? Can't repro it using mono HEAD/2.4 branch on amd64. I can confirm that this is not a problem for me in r125947 of mono-2-4 (~ Feb 5). Still reproducing in latest version of mono-2-4, though. I'm on openSUSE 11.0 32-bit. I'm not sure what else I can do here besides bisecting, which I don't have time for. I'll see if I can convince a friend to reproduce it. Zoltan, I assume you tested with my attached test case, and not with the status icon sample on the wiki that I linked to? I just confirmed this bug with Mono 2.4 Preview 3 on OS X. You can easily see it if you have Tomboy for Mac running...just left-click on the dock. It will crash when trying to show the Tomboy menu positioned at the cursor location. Fixed in SVN HEAD/2.4 branch. Moving to runtime since zoltan fixed it. Sandy, can you verify that this is fixed, and if it is, mark the bug verified? Thanks :) You'll need Mono 2.4rc2 which we'll be releasing early next week (unless you want to build a 2.4 branch build yourself, of course). Yup, tested this right after Zoltan fixed it and it worked fine. :-) Verifying fixed. This still happens on Mac PPC - see Bug 547894. Any suggestions? |