NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
16.48k stars 12.98k forks source link

SDDM Greeter crashes in some combination used with kwin #311450

Open Svenum opened 1 month ago

Svenum commented 1 month ago

Describe the bug

If kwin is the compositor of sddm you only get a black screen after boot. It worked fine before I updated my nixos flake.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Enable sddm like this:
    service.displayManager.sddm = {
      enable = true;
      wayland = {
        enable = true;
        compositor = "kwin";
      };
      autoNumlock = true;
    };
  2. Build config nixos-rebuild boot
  3. Reboot system

Expected behavior

The Login screen should appear and CTRL + F1 - CTRL + F6 should give an terminal output.

Additional context

output of journalctl -b -1 -u display-manager.service:

Mai 13 21:06:33 Yon systemd[1]: Started Display Manager.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
Mai 13 21:06:33 Yon sddm[1545]: Initializing...
Mai 13 21:06:33 Yon sddm[1545]: Starting...
Mai 13 21:06:33 Yon sddm[1545]: Logind interface found
Mai 13 21:06:33 Yon sddm[1545]: Adding new display...
Mai 13 21:06:33 Yon sddm[1545]: Loaded empty theme configuration
Mai 13 21:06:33 Yon sddm[1545]: Using VT 7
Mai 13 21:06:33 Yon sddm[1545]: Display server started.
Mai 13 21:06:33 Yon sddm[1545]: Socket server starting...
Mai 13 21:06:33 Yon sddm[1545]: Socket server started.
Mai 13 21:06:33 Yon sddm[1545]: Loading theme configuration from "/run/current-system/sw/share/sddm/themes/breeze/theme.conf"
Mai 13 21:06:33 Yon sddm[1545]: Greeter starting...
Mai 13 21:06:33 Yon sddm-helper[1550]: Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8.
                                       Qt depends on a UTF-8 locale, and has switched to "C.UTF-8" instead.
                                       If this causes problems, reconfigure your locale. See the locale(1) manual
                                       for more information.
Mai 13 21:06:33 Yon sddm-helper[1550]: [PAM] Starting...
Mai 13 21:06:33 Yon sddm-helper[1550]: [PAM] Authenticating...
Mai 13 21:06:33 Yon sddm-helper[1550]: [PAM] returning.
Mai 13 21:06:33 Yon sddm[1545]: Greeter session started successfully
Mai 13 21:06:35 Yon sddm[1545]: Message received from greeter: Connect
Mai 13 21:06:56 Yon sddm[1545]: Error from greeter session: "Process crashed"
Mai 13 21:06:56 Yon sddm[1545]: Auth: sddm-helper (--socket /tmp/sddm-auth-28334843-3453-40d7-b871-f96a6180049c --id 2 --start /nix/store/4vr0hbjmbnmr8k5gv4mdwfvc36csr6pr-sddm-wrapped/bin/sddm-greeter-qt6 --socket /tmp/sddm--UJfsPi --theme /run/current-system/sw/share/sddm/themes/breeze --user sddm --display-server /nix/store/rizf7g8a5w26lxamz1f5d41knd01pivk-kwin-6.0.4.1/bin/kwin_wayland --no-global-shortcuts --no-kactivities --no-lockscreen --locale1 --greeter) crashed (exit code 1)
Mai 13 21:06:56 Yon sddm[1545]: Error from greeter session: "Process crashed"
Mai 13 21:06:56 Yon sddm[1545]: Auth: sddm-helper exited with 1
Mai 13 21:06:56 Yon sddm[1545]: Greeter stopped. SDDM::Auth::HELPER_AUTH_ERROR
Mai 13 21:06:56 Yon systemd[1]: Stopping Display Manager...
Mai 13 21:06:56 Yon sddm[1545]: Signal received: SIGTERM
Mai 13 21:06:56 Yon sddm[1545]: Socket server stopping...
Mai 13 21:06:56 Yon sddm[1545]: Socket server stopped.
Mai 13 21:06:56 Yon systemd[1]: display-manager.service: Deactivated successfully.
Mai 13 21:06:56 Yon systemd[1]: Stopped Display Manager.

Notify maintainers

@SuperSandro2000 @abbradar @ttuegel @k900 @

Metadata

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.8.9, NixOS, 24.05 (Uakari), 24.05.20240512.2057814`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.23.0pre20240502_00ca2b05`
 - channels(root): `"nixos"`
 - nixpkgs: `/nix/store/vsbi6gfwf2bdamw0d0d9xndb1rrxfnbk-source`

Add a :+1: reaction to issues you find important.

SuperSandro2000 commented 1 month ago

Detected locale "C" with character encoding "ANSI_X3.4-1968",

Do you have some none default locale configured?

Do you have some sddm theme?

Are you using sddm with plasma?

Svenum commented 1 month ago

Yes, sddm with plasma and without theme. As locale (i18n.defaultLocale) I use enUS.UTF-8 and for the other LC... envs I use de_DE.UTF-8

tjkirch commented 1 month ago

I have two machines running NixOS with almost identical configurations, but one has an nVidia graphics card (using proprietary driver) and one has an AMD graphics card (using open source driver). Only the nVidia machine has this problem. I'm not sure if that's related or if it's chance.

Detected locale "C" with character encoding "ANSI_X3.4-1968",

Do you have some none default locale configured?

All locale settings are set to en_US.UTF-8 for me, but I saw this warning as well, on both machines.

Do you have some sddm theme? Are you using sddm with plasma?

The only SDDM settings are to use the KWin compositor and Wayland, with Plasma 6.

Svenum commented 1 month ago

Additional Info: My Machine has an AMD GPU

SuperSandro2000 commented 1 month ago

No idea, works on Intel iGPU.

Mai 13 21:06:33 Yon sddm-helper[1550]: [PAM] Starting...
Mai 13 21:06:33 Yon sddm-helper[1550]: [PAM] Authenticating...
Mai 13 21:06:33 Yon sddm-helper[1550]: [PAM] returning.
Mai 13 21:06:33 Yon sddm[1545]: Greeter session started successfully
Mai 13 21:06:35 Yon sddm[1545]: Message received from greeter: Connect
Mai 13 21:06:56 Yon sddm[1545]: Error from greeter session: "Process crashed"
Mai 13 21:06:56 Yon sddm[1545]: Auth: sddm-helper (--socket /tmp/sddm-auth-28334843-3453-40d7-b871-f96a6180049c --id 2 --start /nix/store/4vr0hbjmbnmr8k5gv4mdwfvc36csr6pr-sddm-wrapped/bin/sddm-greeter-qt6 --socket /tmp/sddm--UJfsPi --theme /run/current-system/sw/share/sddm/themes/breeze --user sddm --display-server /nix/store/rizf7g8a5w26lxamz1f5d41knd01pivk-kwin-6.0.4.1/bin/kwin_wayland --no-global-shortcuts --no-kactivities --no-lockscreen --locale1 --greeter) crashed (exit code 1)
Mai 13 21:06:56 Yon sddm[1545]: Error from greeter session: "Process crashed"
Mai 13 21:06:56 Yon sddm[1545]: Auth: sddm-helper exited with 1
Mai 13 21:06:56 Yon sddm[1545]: Greeter stopped. SDDM::Auth::HELPER_AUTH_ERROR

Why is sddm-helper crashing here? We need some log of that.

This should look like

Mai 17 22:48:03 magnesium sddm[1688]: Greeter starting...
Mai 17 22:48:03 magnesium sddm-helper[1718]: Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8.
                                             Qt depends on a UTF-8 locale, and has switched to "C.UTF-8" instead.
                                             If this causes problems, reconfigure your locale. See the locale(1) manual
                                             for more information.
Mai 17 22:48:03 magnesium sddm-helper[1718]: [PAM] Starting...
Mai 17 22:48:03 magnesium sddm-helper[1718]: [PAM] Authenticating...
Mai 17 22:48:03 magnesium sddm-helper[1718]: [PAM] returning.
Mai 17 22:48:04 magnesium sddm[1688]: Greeter session started successfully
Mai 17 22:48:09 magnesium sddm[1688]: Message received from greeter: Connect
Mai 17 22:48:19 magnesium sddm[1688]: Message received from greeter: Login
Mai 17 22:48:19 magnesium sddm[1688]: Reading from "/nix/store/v23ycy8rx18cfbszmd25jn5fcw8yz2wz-desktops/share/wayland-sessions/plasma.desktop"
Mai 17 22:48:19 magnesium sddm[1688]: Session "/nix/store/v23ycy8rx18cfbszmd25jn5fcw8yz2wz-desktops/share/wayland-sessions/plasma.desktop" selected, command: "/nix/store/j0a472qirvpiarg9kwsvqxch2m906i1n-plasma-workspace-6.0.4/libexec/plasma-dbus-run-session-if-needed /nix/store/j0a472qirvpiarg9kwsvqxch2m906i1n-plasma-workspace-6.0.4/bin/startplasma-wayland" for VT 2
Mai 17 22:48:19 magnesium sddm-helper[1898]: Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8.
                                             Qt depends on a UTF-8 locale, and has switched to "C.UTF-8" instead.
                                             If this causes problems, reconfigure your locale. See the locale(1) manual
                                             for more information.
Mai 17 22:48:19 magnesium sddm-helper[1898]: [PAM] Starting...
Mai 17 22:48:19 magnesium sddm-helper[1898]: [PAM] Authenticating...
Mai 17 22:48:19 magnesium sddm-helper[1898]: [PAM] Preparing to converse...
Mai 17 22:48:19 magnesium sddm-helper[1898]: [PAM] Conversation with 1 messages
Mai 17 22:48:19 magnesium sddm-helper[1898]: pam_kwallet5(sddm:auth): pam_kwallet5: pam_sm_authenticate
Mai 17 22:48:19 magnesium sddm-helper[1898]: [PAM] returning.
Svenum commented 1 month ago

Could you tell me how to find logs of sddm-helper? Sddm-helper is not an service as I know.

SuperSandro2000 commented 1 month ago

I couldn't find it either

Svenum commented 1 month ago

I updated my nix flakes again nix flake update and now its working again....<

So feel free to close if others not effected anymore too.

tjkirch commented 1 month ago

I updated my nix flakes again nix flake update and now its working again....<

So feel free to close if others not effected anymore too.

Sadly, it's no better for me after today's update.

sddm-crash

I'd be happy to test any debugging theories; I'm new to Nix and KDE.

SuperSandro2000 commented 1 month ago

You probably need to dig into this yourself which will require a a good knowledge of the linux stack because we are kinda out of ideas.

mrbrownt commented 1 month ago

Have a slightly different sddm configuration

services.displayManager = {
  defaultSession = "plasma";
  sddm = {
    enable = true;
    wayland.enable = true;
  };
};

and have configured localization

i18n.defaultLocale = "en_US.UTF-8";

i18n.extraLocaleSettings = {
  LC_ADDRESS = "en_US.UTF-8";
  LC_IDENTIFICATION = "en_US.UTF-8";
  LC_MEASUREMENT = "en_CA.UTF-8";
  LC_MONETARY = "en_US.UTF-8";
  LC_NAME = "en_US.UTF-8";
  LC_NUMERIC = "en_US.UTF-8";
  LC_PAPER = "en_US.UTF-8";
  LC_TELEPHONE = "en_US.UTF-8";
  LC_TIME = "en_GB.UTF-8";
};

Observed with both nvidia and intel gpus; looking through my logs the C locale warning has been present for months but I've only seen sddm crashing this last week so that may be a red herring?

Steinhagen commented 1 month ago

Having the same issue with the proprietary NVidia driver (GTX 980). The timing this issue is perfectly matching this ticket: https://gist.github.com/Steinhagen/9d4a306acb0d041f6b51f83c1b8f409a

It seems that this issue happens if you either use SDDM with Wayland enabled, or if you start KWin using Wayland. If you use X11, both SDDM and KWin will work as expected.

Steinhagen commented 1 month ago

This issue seems to happen with the latest Linux kernel. Downgrading from linuxPackages_latest to linuxPackages evades the broken Wayland issue for now.

opl- commented 6 days ago

As mentioned here, hardware.nvidia.modesetting.enable = true; makes SDDM start on NVIDIA proprietary driver 555.58 + kernel 6.9.7, but the session ends up being unstable for me as explained here.

Edit: It seems to run well enough now. See https://github.com/NixOS/nixpkgs/issues/323396#issuecomment-2198446315 for my current config.