Visual Studio Code, Slack and other electrons apps crash due to XDG_CONFIG_DIRS keeps getting expanded every login

Bug #1764355 reported by azmo on 2018-04-16
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
gnome-session (Ubuntu)
Undecided
Unassigned
xorg (Ubuntu)
Undecided
Unassigned

Bug Description

Ubuntu Version: 18.04
gnome-session-common Version: 3.28.1-0ubuntu1

What's expected to happen: $XDG_CONFIG_DIRS is the same on every login
What happens instead: $XDG_CONFIG_DIRS gets expanded on every login

It seems that $XDG_CONFIG_DIRS gets expanded by two entries on every login.

On first login it looks like this:

/etc/xdg/xdg-ubuntu:/etc/xdg/xdg-ubuntu:/etc/xdg

On second login it gets expanded by the same two entries in front:

/etc/xdg/xdg-ubuntu:/etc/xdg/xdg-ubuntu:/etc/xdg/xdg-ubuntu:/etc/xdg/xdg-ubuntu:/etc/xdg

On third login, two more entries get added:

/etc/xdg/xdg-ubuntu:/etc/xdg/xdg-ubuntu:/etc/xdg/xdg-ubuntu:/etc/xdg/xdg-ubuntu:/etc/xdg/xdg-ubuntu:/etc/xdg/xdg-ubuntu:/etc/xdg

At this point Visual Studio Code, which lead me to this, no longer starts and just throw a Segmentation fault/Core Dump.

I suspect this behaviour is triggered by /etc/profile.d/xdg_dirs_desktop_session.sh adding more stuff to $XDG_CONFIG_DIRS on every login.

ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: gnome-session-common 3.28.1-0ubuntu1
ProcVersionSignature: Ubuntu 4.15.0-15.16-generic 4.15.15
Uname: Linux 4.15.0-15-generic x86_64
ApportVersion: 2.20.9-0ubuntu4
Architecture: amd64
CurrentDesktop: ubuntu:GNOME
Date: Mon Apr 16 11:30:09 2018
Dependencies:

InstallationDate: Installed on 2018-04-15 (1 days ago)
InstallationMedia: Ubuntu 18.04 LTS "Bionic Beaver" - Beta amd64 (20180404)
PackageArchitecture: all
SourcePackage: gnome-session
UpgradeStatus: No upgrade log present (probably fresh install)

azmo (gordonschulz) wrote :
description: updated
Tony Arnold (tony-arnold) wrote :

This issue also applies to version 17.10. In my case, I am using gnome desktop and the path /etx/xdg/xdg-gnome-xorg gets prepended to $XDG_CONFIG_DIRS on every login.

Once the $XDG_CONFIG_DIRS gets beyond a certain length, applications such as slack-desktop fails with a segmentation violation on start up.

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gnome-session (Ubuntu):
status: New → Confirmed
Didier Roche (didrocks) wrote :

The I think then an old session is hanging around.

How long are you waiting before logging out and back in again?

Please, try the following:
- login, and wait for *at least* a minute so that everything that is lazy loaded shutdown
- logout, and login back in
- check XDG_CONFIG_DIRS
/!\ Ensure that no tty (no other session with the same user name) is running while doing it.

Regardless, we should indeed protect the profile.d script to not append XDG_CONFIG_DIRS unconditionnally.

Didier Roche (didrocks) on 2018-04-19
summary: + Visual Studio Code, Slack and other electrons apps crash due to
XDG_CONFIG_DIRS keeps getting expanded every login
Didier Roche (didrocks) wrote :

Note that XDG_DATA_DIRS is expanded as well, we should protect against it.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gnome-session - 3.28.1-0ubuntu2

---------------
gnome-session (3.28.1-0ubuntu2) bionic; urgency=medium

  * debian/xdg_dirs_desktop_session.sh, debian/55gnome-session_gnomerc:
    - protect against multiple additions of the same paths to
      XDG_CONFIG_DIRS and XDG_DATA_DIRS, resulting to duplication on
      consecutive logout/logins due to older session hanging in and env
      being reused.
      Some consequences is that electron application crashes (LP: #1764355)

 -- Didier Roche <email address hidden> Thu, 19 Apr 2018 16:43:50 +0200

Changed in gnome-session (Ubuntu):
status: Confirmed → Fix Released
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package xorg - 1:7.7+19ubuntu7

---------------
xorg (1:7.7+19ubuntu7) bionic; urgency=medium

  [ Simon Quigley ]
  * 60x11-common_xdg_path: If $XDG_CONFIG_DIRS is nonempty, don't discard the
    contents.

  [ Didier Roche ]
  * 60x11-common_xdg_path:
    - protect against multiple additions of the same paths to
      XDG_CONFIG_DIRS and XDG_DATA_DIRS, resulting to duplication on
      consecutive logout/logins due to older session hanging in and env
      being reused.
      Some consequences is that electron application crashes (LP: #1764355)
    - remove readdition of defaults if XDG_CONFIG_DIRS isn't empty to respect
      user's selection (same logic than wayland session).

 -- Timo Aaltonen <email address hidden> Thu, 19 Apr 2018 17:47:42 +0300

Changed in xorg (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers