As first reported by Peter N. Spotts on the ML, when you try to switch the menu from the default to a custom menu file, the dialog just closes, and the menu is removed from the panel configuration.
Ah, for some reason my xfce4-menu-FOO.rc file contains: menu_file=/home/squisher/.config/xfce4/desktop/menu.xml Apparently the menu plugin does not like that file: libxfce4panel-Message: Xfce Menu: screen changed: 1 libxfce4panel-Message: No valid plug window. (xfce4-panel:7187): Gtk-CRITICAL **: gtk_socket_get_id: assertion GTK_WIDGET_ANCHORED (socket)' failed (xfce4-panel:7187): libxfce4panel-CRITICAL **: An item was unexpectedly removed: "Xfce Menu".
So when I re-add the menu plugin, then I can switch between default and custom menu without a crash. If I browse and select the file mentioned above, it crashes again.
Created attachment 2135 This should prevent the segfault from occuring, I am not sure if it provides the desired behaviour. Had the same problem... fixed it with the attached patch.
Steps to reproduce: 1) Use Custom Menu File 2) Open the file-chooser dialog 3) Press cancel I dunno if I fixed the issue happening when an image-file has not been set yet. there could be another segfault in there.
Created attachment 2137 check the file_menu to not be null The problem here is: (xfce4-menu-plugin:8499): libxfce4menu-CRITICAL **: xfce_menu_new: assertion `filename != NULL && g_path_is_absolute (filename)' failed I attach a simpler patch.
(In reply to comment #5) > Created an attachment (id=2137) [details] > check the file_menu to not be null > > The problem here is: > > (xfce4-menu-plugin:8499): libxfce4menu-CRITICAL **: xfce_menu_new: assertion > `filename != NULL && g_path_is_absolute (filename)' failed > > I attach a simpler patch. To be a bit more clear, the assertion is caught because file_menu is set to "" and is passed as argument to build a new menu, so the patch verify that it is an absolute path. When the user cancels the file chooser dialog, the patch reinits the file_menu with the path of the old menu.
Hmm, should really just figure out why the filename sometimes gets set to the empty string and make it not do that. Why should we require that it's an absolute path, anyway?
Ok, I think I fixed this in a slightly different way. Please test this; I couldn't reproduce the crash here.
Not fixed at all for me here. Exactly same problem remains. My issue here is not with an empty string as the menu file, but rather with /home/squisher/.config/xfce4/desktop/menu.xml . I'll attach it. For some reason my menu buttons had this as the default for the custom menu when upgrading from 4.4. And in any case, the plugin should not crash just because an invalid xml file is selected, should it?
Created attachment 2150 xml file which makes the menu plugin crash
(In reply to comment #4) > Steps to reproduce: > > 1) Use Custom Menu File > 2) Open the file-chooser dialog > 3) Press cancel > > I dunno if I fixed the issue happening when an image-file has not been set yet. > there could be another segfault in there. Maybe I should have been more explicit for what I was experiencing: 1) Open properties of xfce menu plugin 2) Select custom menu file radio button -> crash if menu plugin was added in 4.4 (because the file below is selected by default), otherwise: 3) Select /home/squisher/.config/xfce4/desktop/menu.xml 4) Press OK -> crash
David: that's not a valid menu file for 4.6. Of course it shouldn't crash, though. If it is, that's a problem in libxfce4menu, I'd think. If you can't provide a backtrace, I can't really help...
On a related note, my gentoo which was upgraded from 4.4 to 4.6 also had an invalid menu file by default, so I do think this is critical to fix. I tried getting a backtrace last time, but somehow wasn't able to. I'll give it another shot tonight.
I don't agree. This is a minor issue; if you give it valid input, it won't crash. If Gentoo is installing an invalid menu file, you need to file a bug with them. Let's get RC2 out and think about fixing this for final. Still can't do anything without a backtrace.
(In reply to comment #14) > I don't agree. This is a minor issue; if you give it valid input, it won't > crash. If Gentoo is installing an invalid menu file, you need to file a bug > with them. Let's get RC2 out and think about fixing this for final. Still > can't do anything without a backtrace. It definitely shouldn't crash. I'll try to reproduce it with the test application from libxfce4menu and the .menu file.
This is fixed in revision 29445: * libxfce4mixer/xfce-menu.c: Fix crash when reading invalid menu files with characters outside the root <Menu> element. Of course this even works with documents which have no <Menu> element at all. It would even better if libxfce4menu would detect that the menu files is invalid and return a proper GError for that. But that would require a new string and since we're in string freeze this simple crash fix will have to do for now.