Bug 25361 - Alacarte crashes at startup on all GNOME sessions
Summary: Alacarte crashes at startup on all GNOME sessions
Status: NEW
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 9
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: GNOME maintainers
QA Contact:
URL:
Whiteboard:
Keywords:
: 32902 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-08-26 19:39 CEST by Luis Menina
Modified: 2024-03-14 03:57 CET (History)
7 users (show)

See Also:
Source RPM: alacarte-3.44.2-1.mga9.src.rpm
CVE:
Status comment:


Attachments

Description Luis Menina 2019-08-26 19:39:31 CEST
Description of problem:
Alacarte crashes at startup.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. Run Alacarte
2. Alacarte crashes with the following message:

gi.repository.GLib.Error: g-io-error-quark: Failed to look up menu_file for "gnome-applications.menu"


I have tracked down the problem to GMenu not being able to find the gnome-applications.menu file because the XDG_CONFIG_DIRS environment variable is not set.

It seems it's supposed to be exported from /etc/gnome/gnomerc, but I can't find any place where this script is called. I know the way the session was supposed to change in Mageia 7, so this may be related.
Luis Menina 2019-08-26 19:39:52 CEST

Severity: normal => critical

Comment 1 Lewis Smith 2019-08-26 21:10:16 CEST
@Luis
Thank you for your very helpful report and diagnostic.
(But this does not merit 'critical' severity; you can live without Alacarte).
Can you please add what Mageia ISO you installed from, and/or what desktop you are using. This is a Gnome thing, but perhaps not exclusive to it.

No registered maintainer for this package, so assigning to the Gnome people; CC'ing Olav because you seen this several times before.

Assignee: bugsquad => gnome
Severity: critical => normal
CC: (none) => olav

Comment 2 Luis Menina 2019-09-01 17:10:36 CEST
(In reply to Lewis Smith from comment #1)
> Thank you for your very helpful report and diagnostic.
> (But this does not merit 'critical' severity; you can live without Alacarte).

You're confusing "priority" and "severity". The severity field is for the impact on the end user. "critical" is for bugs that have the most impact: crashers, or ones that cause some data loss. This bug is a systematic crasher, so on an end-user and Alacarte maintainer point of view, this is critical.

Of course I can live without Alacarte, haven't run it for years before last week (and will probably won't for a few more years). But we're not the ones who are supposed to say the user wether what they're doing is useful or not.

> Can you please add what Mageia ISO you installed from, and/or what desktop
> you are using. This is a Gnome thing, but perhaps not exclusive to it.

I did an online upgrade from Mageia 6 to Mageia 7, following the instructions on the mageia wiki. I also checked that asking for an update would tell me that no more updates are available.

> No registered maintainer for this package, so assigning to the Gnome people;
> CC'ing Olav because you seen this several times before.

I mostly reported that bug because XDG_CONFIG_DIRS not being set correctly might have an impact on other GNOME software relying on it. I don't know if Alacarte is the only one or if others look at XDG_CONFIG_DIRS, maybe Olav would know ?
Comment 3 Cyril Levet 2020-01-05 12:51:29 CET
I confirm this bug on a fresh install of Mageia 7 GNOME.

CC: (none) => cyril.levet0780

Comment 4 Lewis Smith 2020-05-17 21:57:21 CEST
Bug 26633 duplicates this one.

CC: (none) => lewyssmith

Comment 5 Lewis Smith 2020-05-17 22:16:52 CEST
 https://bugs.mageia.org/show_bug.cgi?id=12153#c3
 https://bugs.mageia.org/show_bug.cgi?id=26633#c0
indicate that "symlinking /etc/xdg/gnome/menus/gnome-applications.menu to /etc/xdg/menus/" fixes this.
Comment 6 Aurelien Oudelet 2021-07-06 13:16:28 CEST
Mageia 7 is EOL since July 1st 2021.
There will not have any further bugfix for this release.

You are encouraged to upgrade to Mageia 8 as soon as possible.

@reporter, if this bug still apply with Mageia 8, please let us know it.

@packager, if you work on the Mageia 7 version of your package, please check the Mageia 8 package if issue is also present. In this case, please fix the Mageia 8 version instead.

This bug report will be closed OLD if there is no further notice within 1st September 2021.
Comment 7 Cyril Levet 2021-07-06 19:45:06 CEST
This bug is still valid in Mageia 8.
Marja Van Waes 2021-07-06 22:33:19 CEST

Version: 7 => 8
CC: (none) => marja11

Comment 8 sturmvogel 2024-02-27 15:50:28 CET
*** Bug 32902 has been marked as a duplicate of this bug. ***

CC: (none) => eduardomestresaez

sturmvogel 2024-02-27 15:50:55 CET

Source RPM: alacarte-3.11.91-10.mga7.src.rpm => alacarte-3.44.2-1.mga9.src.rpm
Version: 8 => 9

Comment 9 David GEIGER 2024-03-10 16:52:15 CET
It works here on my Cauldron with alacarte-3.50.0.

CC: (none) => geiger.david68210

Comment 10 Lewis Smith 2024-03-10 21:18:47 CET
Thank you for poking this, David.

on M9 LXDE:
 alacarte-3.44.2-1.mga9
installed it, fired it up, it does not crash; its GUI looks correct.
OTOH it does throw errors:
 $ alacarte

(alacarte:16955): Gtk-CRITICAL **: 21:21:21.376: gtk_accel_label_set_accel_closure: assertion 'gtk_accel_group_from_accel_closure (accel_closure) != NULL' failed

(alacarte:16955): Gtk-CRITICAL **: 21:21:21.376: gtk_accel_label_set_accel_closure: assertion 'gtk_accel_group_from_accel_closure (accel_closure) != NULL' faile

If somebody else can confirm that this application works for M9 (dead easy to install and start), it looks like the Mageia 9 version works, and this old bug can be closed FIXED.
Comment 11 Eduardo Mestre 2024-03-10 22:04:04 CET
<pre>[eduardo@ideafix ~]$ cat /etc/mageia-release 
Mageia release 9 (Official) for x86_64
[eduardo@ideafix ~]$ rpm -q alacarte
alacarte-3.44.2-1.mga9
[eduardo@ideafix ~]$ alacarte

(alacarte:35988): Gtk-<span style="color:#A347BA"><b>CRITICAL</b></span> **: <span style="color:#12488B">21:53:28.638</span>: gtk_accel_label_set_accel_closure: assertion &apos;gtk_accel_group_from_accel_closure (accel_closure) != NULL&apos; failed

(alacarte:35988): Gtk-<span style="color:#A347BA"><b>CRITICAL</b></span> **: <span style="color:#12488B">21:53:28.639</span>: gtk_accel_label_set_accel_closure: assertion &apos;gtk_accel_group_from_accel_closure (accel_closure) != NULL&apos; failed
Traceback (most recent call last):
  File &quot;/usr/bin/alacarte&quot;, line 24, in &lt;module&gt;
    main()
  File &quot;/usr/lib/python3.10/site-packages/Alacarte/MainWindow.py&quot;, line 464, in main
    app.setMenuBasename(basename)
  File &quot;/usr/lib/python3.10/site-packages/Alacarte/MainWindow.py&quot;, line 62, in setMenuBasename
    self.editor = MenuEditor(menu_basename)
  File &quot;/usr/lib/python3.10/site-packages/Alacarte/MenuEditor.py&quot;, line 36, in __init__
    self.load()
  File &quot;/usr/lib/python3.10/site-packages/Alacarte/MenuEditor.py&quot;, line 49, in load
    if not self.tree.load_sync():
gi.repository.GLib.GError: g-io-error-quark: Failed to look up menu_file for &quot;gnome-applications.menu&quot;
 (0)
[eduardo@ideafix ~]$</pre>

This is on Mageia 9 with Gnome over Wayland. In Mageia 9 LXDE over X11 works OK. 

I think it's a Wayland related issue.
Comment 12 David GEIGER 2024-03-11 06:45:21 CET
As it is a Wayland related issue this could be reported upstream at https://gitlab.gnome.org/GNOME/alacarte/-/issues

Summary: Alacarte crashes at startup => Alacarte crashes at startup only on Wayland

Comment 13 Luis Menina 2024-03-12 17:55:17 CET
This is not a wayland issue, Eduardo tested with a whole different desktop (LXDE). If you test with a GNOME X11 session you have the same error.

I tested with alacarte-3.44.2-1.mga9.
Comment 14 David GEIGER 2024-03-12 18:23:02 CET
(In reply to Eduardo Mestre from comment #11)
> 
> This is on Mageia 9 with Gnome over Wayland. In Mageia 9 LXDE over X11 works
> OK. 
> 
> I think it's a Wayland related issue.

I read this from Eduardo!
Comment 15 Luis Menina 2024-03-12 18:43:15 CET
Sure, I'm just saying testing a GNOME bug on LXDE won't give you a relevant result. The issue is that alacarte can't find the `gnome_applications.menu` file.

Proof of that:

> strace -fff alacarte 2>&1 | grep menu
> [...]
> [pid  8964] readlink("/home/luis/.config/menus", 0x7ffceb550c60, 1023) = -1 EINVAL (Argument invalide)
> [pid  8964] readlink("/home/luis/.config/menus/gnome-applications.menu", 0x7ffceb550c60, 1023) = -1 ENOENT (Aucun fichier ou dossier de ce type)
> [pid  8964] readlink("/etc/xdg/menus", 0x7ffceb550c60, 1023) = -1 EINVAL (Argument invalide)
> [pid  8964] readlink("/etc/xdg/menus/gnome-applications.menu", 0x7ffceb550c60, 1023) = -1 ENOENT (Aucun fichier ou dossier de ce type)
> [pid  8964] write(2, "    self.editor = MenuEditor(men"..., 44    self.editor = MenuEditor(menu_basename)
> [pid  8964] write(2, "gi.repository.GLib.GError: g-io-"..., 107gi.repository.GLib.GError: g-io-error-quark: Failed to look up menu_file for "gnome-applications.menu"

It's looking at:
- /etc/xdg/menus
- /etc/xdg/menus/gnome-applications.menu

But it needs to find (mind the "gnome" dir in the path):
- /etc/xdg/gnome/menus/gnome-applications.menu

This is why in Comment #5 we're told that a symlink fixes the problem.
Another way might be to use XDG_CONFIG_DIRS, but I don't know what's the prefered way.
Comment 16 Luis Menina 2024-03-12 18:50:40 CET
> man alacarte
>
> ENVIRONMENT
>       XDG_CONFIG_DIRS
>           alacarte looks in the menus subdirectory of these directories for menu files. The default location for menu files is /etc/xdg/menus.

Running this in a terminal works for me:
> XDG_CONFIG_DIRS=/etc/xdg/gnome alacarte
Luis Menina 2024-03-12 19:03:29 CET

Summary: Alacarte crashes at startup only on Wayland => Alacarte crashes at startup on all GNOME sessions

Comment 17 Luis Menina 2024-03-12 19:04:53 CET
Could someone with an LXDE session paste the result of the following command here? I'm running low on disk space. Thanks.

> env | grep XDG
Comment 18 Luis Menina 2024-03-12 19:06:45 CET
FWIW, it's also crashing in the IceWM session, so LXDE seems to be an outlier.
Comment 19 Lewis Smith 2024-03-12 20:17:44 CET
To settle the dust, I have just painfully tried this as follows:
Cinnamon, IceWM, LXDE, LxQt, Mate, Plasma X11, Xfce:
 2 GTK errors, but it starts OK.
Gnome (Wayland), Gnome (Xorg):
 errors as comment 11, does not start.

This does not accord with comment 18, but I am sure this *is* a Gnome problem.
For each desktop, I scanned ENV for - curses - 'ayland' or 'X11'; it should be 'x11' which is what I see here on Xfce:
 $ env | grep XDG
 XDG_SESSION_TYPE=x11
 XDG_CONFIG_DIRS=/etc/xdg

Sigh, will try again both Gnome variants.
Comment 20 Lewis Smith 2024-03-12 20:24:05 CET
Here under straight 'Gnome' from LightDM, which - surprise - is running X11:
 $ env | grep XDG
 XDG_SESSION_TYPE=x11
 XDG_CONFIG_DIRS=/etc/xdg/mate:/etc/xdg
and fails as noted above.

Blast, need to try another display Manager to get Wayland.
Comment 21 Lewis Smith 2024-03-12 20:32:28 CET
Back again, GDM to straight 'Gnome'; this time under Wayland:
 $ env | grep XDG
 XDG_SESSION_TYPE=wayland           at last      
note *no* XDG_CONFIG_DIRS.
It fails as per comment 11, does not start.

Next to try Gnome X11 ex GDM.
Comment 22 Lewis Smith 2024-03-12 20:39:13 CET
Here finally from GDM to Gnome on X11:
 XDG_SESSION_TYPE=x11
and again, *no XDG_CONFIG_DIRS*.

(In reply to Luis Menina from comment #18)
> FWIW, it's also crashing in the IceWM session
Can you check this variable, $ env | grep XDG

It may be that the crash comes just from this ENV variable XDG_CONFIG_DIRS not being set.
Comment 23 Luis Menina 2024-03-13 19:07:20 CET
> It may be that the crash comes just from this ENV variable XDG_CONFIG_DIRS not being set.

The crash comes from the .menu file not being found. Now the question is: are we supposed to change the filesystem layout adding symlinks so that the file is found using alacarte's default configured paths? Because otherwise, all sessions would need to have XDG_CONFIG_DIR set to have alacarte not crash. The problem with the latter is that as it's an XDG setting, it may interact with other xdg-compatible applications (breaking them).
Comment 24 Luis Menina 2024-03-13 20:28:23 CET
This is what is at the beginning of the `/etc/gnome/gnomerc` file.

> if [ "$MGA_MENU_STYLE" = "upstream" ]; then
> 	if  [ -z "$XDG_CONFIG_DIRS" ]; then
>  	    export XDG_CONFIG_DIRS="/etc/xdg/gnome:/etc/xdg"
> 	else
> 	    export XDG_CONFIG_DIRS="/etc/xdg/gnome:$XDG_CONFIG_DIRS"
> 	fi
> else
> 	if  [ -z "$XDG_CONFIG_DIRS" ]; then
>  	    export XDG_CONFIG_DIRS="/etc/xdg:/etc/xdg/gnome"
> 	else
> 	    export XDG_CONFIG_DIRS="$XDG_CONFIG_DIRS:/etc/xdg/gnome"
> 	fi
> fi

So if XDG_CONFIG_DIRS is not defined, it's supposed to define it. However it's been a long time (I found this bug almost 5 years ago on Mageia 7) and I don't know with the way the session changed in all those years if this file should be sourced somewhere. Grepping in the /etc dir, though, seems to indicate that nothing loads that file.
Comment 25 Dave Hodgins 2024-03-14 01:08:55 CET
$ cat /usr/bin/startgnome
#!/usr/bin/sh
if [ -x ~/.gnomerc ]; then 
 exec ~/.gnomerc
else
 exec /etc/gnome/gnomerc
fi

CC: (none) => davidwhodgins

Comment 26 Luis Menina 2024-03-14 03:07:01 CET
Isn't startgnome a relic of the past? I mean, it might be provided for backards compatibility with old systems, but AFAIK, this is has been superseded by systemd handling the session ages ago.
Comment 27 Dave Hodgins 2024-03-14 03:57:51 CET
Possibly. I normally use run level 3 and startx.

Note You need to log in before you can comment on or make changes to this bug.