gsm_util_export_user_environment should log an error if the UnsetAndSetEnvironment D-Bus call failed
gnome-session version this issue has been seen with
Expected behaviour you didn't see
Working gnome session upon logging in from gdm
Unexpected behaviour you saw
After gdm login, a black screen with a stationary mouse pointer.
Steps to reproduce the problem
Put something like the following lines into
/etc/profile.d/trigger-the-bug.shor some test user's
~/.bashrcexporting environment variables which contain
\rcharacters. E.g. (using vi's way of displaying the carriage return character as
CR="^M" export CR CRLF="^M " export CRLF
(For help with debugging, but not necessary to reproduce the issue:) As the test user in a virtual console, launch
busctl monitor --user > busctl-monitor--user.log.
From gdm, log in as that user into a "Gnome" or "Gnome on Xorg" session.
Screen goes black, mouse pointer stops moving, and nothing happens any more.
As @bberg has diagnosed on my system, the following now happens:
gdmstarts a login shell, which will pick up the environment variables containing
that login shell starts the
gnome-session-binaryuploads the environment to the D-Bus bus name
UnsetAndSetEnvironment, containing information essential for launching the Gnome session
\rcharacters somewhere in the new environment and therefore rejects the whole environment update, including those environment variables with essential information
gnome-session-binaryprocess asks systemd to launch
gnome-session-binary --systemd-service --session=gnome, which uses the environment which should have but does not have the environment variables with essential information
gnome-session-binary --systemd-service --session=gnomeis now missing essential environment variables like
XDG_SESSION_TYPE, so the
XDG_SESSION_TYPEbeing equal to
No service has been launched, nothing is done further, the screen stays black. The End.
gnome-session-binary were to log the failed
UnsetAndSetEnvironment D-Bus call in
gsm_util_export_user_environment() (like for example
dbus-broker-launch does), we could have diagnosed this issue quicker.