! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Switching the menu plugin from default to custom menu file removes the plugin...
Status:
RESOLVED: FIXED
Product:
Xfdesktop
Component:
General

Comments

Description David Mohr 2009-01-31 04:52:09 CET
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.
Comment 1 David Mohr 2009-01-31 05:16:57 CET
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".
Comment 2 David Mohr 2009-01-31 05:18:11 CET
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.
Comment 3 Stephan Arts editbugs 2009-01-31 07:33:15 CET
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.
Comment 4 Stephan Arts editbugs 2009-01-31 07:43:50 CET
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.
Comment 5 Mike Massonnet editbugs 2009-01-31 12:42:08 CET
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.
Comment 6 Mike Massonnet editbugs 2009-01-31 12:47:57 CET
(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.
Comment 7 Brian J. Tarricone (not reading bugmail) 2009-02-02 06:01:38 CET
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?
Comment 8 Brian J. Tarricone (not reading bugmail) 2009-02-02 06:28:24 CET
Ok, I think I fixed this in a slightly different way.  Please test this; I couldn't reproduce the crash here.
Comment 9 David Mohr 2009-02-03 16:17:50 CET
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?
Comment 10 David Mohr 2009-02-03 16:18:59 CET
Created attachment 2150 
xml file which makes the menu plugin crash
Comment 11 David Mohr 2009-02-03 16:21:26 CET
(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
Comment 12 Brian J. Tarricone (not reading bugmail) 2009-02-03 19:47:06 CET
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...
Comment 13 David Mohr 2009-02-03 19:52:07 CET
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.
Comment 14 Brian J. Tarricone (not reading bugmail) 2009-02-03 20:04:36 CET
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.
Comment 15 Jannis Pohlmann editbugs 2009-02-03 22:23:54 CET
(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.
Comment 16 Jannis Pohlmann editbugs 2009-02-03 23:07:08 CET
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.

Bug #4879

Reported by:
David Mohr
Reported on: 2009-01-31
Last modified on: 2009-07-14

People

Assignee:
Brian J. Tarricone (not reading bugmail)
CC List:
4 users

Version

Version:
4.5.99.1 (4.6 rc 1)

Attachments

Additional information