Getting ".ksecretd-wrapped crashed" using unlocking wallet with login / LUKS password on Unstable

I’ve been following the wiki instructions for unlocking the KDE Wallet using the LUKS decryption key via Systemd. Specifically, my config contains the following:

systemd.services.plasmalogin.serviceConfig.KeyringMode = "inherit";
security.pam.services.plasmalogin-autologin.rules.auth = {
  systemd_loadkey = {
    order = 0;
    control = "optional";
    modulePath = "${pkgs.systemd}/lib/security/pam_systemd_loadkey.so";
  };
  plasmalogin = {
    order = 1;
    control = "include";
    modulePath = "plasmalogin";
  };
};

This was working fine for me when I was using NixOS 26.05. Recently, I switched my system over to NixOS Unstable, after which I got warnings on boot that .ksecretd-wrapped crashed, and my wallet does not automatically unlock (requiring my password the first time an application requests it). I confirmed that removing the above from my config stops the crash, but also completely disables the auto-unlocking. The crash log I get from KDE’s Crashed Processes Viewer doesn’t seem to reveal anything particularly useful from what I can tell, so I’m at a loss as to how to troubleshoot this. I tried the wiki’s suggestion to clear the QML cache, but that didn’t affect the issue.

Has anybody else encountered this issue / successfully setup this sort of auto-login on Unstable? Any suggestions on what I should try to troubleshoot this?

EDIT: Realized I should include the crash log in question. As I mentioned, I didn’t notice anything noteworthy, but maybe someone here can find something I missed.

.ksecretd_wrapped crash log
           PID: 1441 (.ksecretd-wrapp)
           TID: 1441 (.ksecretd-wrapp)
           UID: 1000 (lrflew)
           GID: 100 (users)
        Signal: 11 (SEGV) si_code: SEGV_MAPERR
     Timestamp: Fri 2026-10-30 22:15:29 CDT (11min ago)
  Command Line: /nix/store/cx5ndmcrmmkzcyfm43545s2cp8srcwz6-kwallet-6.31.0/bin/ksecretd --pam-login 9 10
    Executable: /nix/store/cx5ndmcrmmkzcyfm43545s2cp8srcwz6-kwallet-6.31.0/bin/.ksecretd-wrapped
 Control Group: /user.slice/user-1000.slice/session-1.scope
          Unit: session-1.scope
         Slice: user-1000.slice
       Session: 1
     Owner UID: 1000 (lrflew)
       Boot ID: 989ff8cd74ee4abca66d18ad7fc7e8bd
    Machine ID: 630c2d47f53b44e597eff49a2fbbad56
      Hostname: lrflew-framework
       Storage: /var/lib/systemd/coredump/core.\x2eksecretd-wrapp.1000.989ff8cd74ee4abca66d18ad7fc7e8bd.1441.1793416529000000.zst (present)
  Size on Disk: 1.4M
       Message: Process 1441 (.ksecretd-wrapp) of user 1000 dumped core.
                
                Module libunistring.so.5 without build-id.
                Module libselinux.so.1 without build-id.
                Module libpsl.so.5 without build-id.
                Module libssh2.so.1 without build-id.
                Module libidn2.so.0 without build-id.
                Module libnghttp2.so.14 without build-id.
                Module libngtcp2.so.16 without build-id.
                Module libngtcp2_crypto_ossl.so.0 without build-id.
                Module libnghttp3.so.9 without build-id.
                Module libduktape.so.207 without build-id.
                Module liblzma.so.5 without build-id.
                Module libimobiledevice-glue-1.0.so.0 without build-id.
                Module libusbmuxd-2.0.so.7 without build-id.
                Module libpxbackend-1.0.so without build-id.
                Module libkeyutils.so.1 without build-id.
                Module libkrb5support.so.0 without build-id.
                Module libcom_err.so.3 without build-id.
                Module libk5crypto.so.3 without build-id.
                Module libkrb5.so.3 without build-id.
                Module libplist-2.0.so.4 without build-id.
                Module libimobiledevice-1.0.so.6 without build-id.
                Module libproxy.so.1 without build-id.
                Module libgssapi_krb5.so.2 without build-id.
                Module libattr.so.1 without build-id.
                Module libacl.so.1 without build-id.
                Module libXrender.so.1 without build-id.
                Module libXcursor.so.1 without build-id.
                Module libbrotlicommon.so.1 without build-id.
                Module libogg.so.0 without build-id.
                Module libvorbis.so.0 without build-id.
                Module libffi.so.8 without build-id.
                Module libgomp.so.1 without build-id.
                Module libexpat.so.1 without build-id.
                Module libbrotlidec.so.1 without build-id.
                Module libbz2.so.1 without build-id.
                Module libgraphite2.so.3 without build-id.
                Module libpcre2-8.so.0 without build-id.
                Module libltdl.so.7 without build-id.
                Module libvorbisfile.so.3 without build-id.
                Module libXdmcp.so.6 without build-id.
                Module libXau.so.6 without build-id.
                Module libzstd.so.1 without build-id.
                Module libpcre2-16.so.0 without build-id.
                Module libb2.so.1 without build-id.
                Module libdouble-conversion.so.3 without build-id.
                Module libicudata.so.78 without build-id.
                Module libicuuc.so.78 without build-id.
                Module libicui18n.so.78 without build-id.
                Module libGLdispatch.so.0 without build-id.
                Module libXext.so.6 without build-id.
                Module libz.so.1 without build-id.
                Module libfontconfig.so.1 without build-id.
                Module libfreetype.so.6 without build-id.
                Module libmd4c.so.0 without build-id.
                Module libharfbuzz.so.0 without build-id.
                Module libpng16.so.16 without build-id.
                Module libEGL.so.1 without build-id.
                Module libvulkan.so without build-id.
                Module libgpg-error.so.0 without build-id.
                Module libassuan.so.9 without build-id.
                Module libcanberra.so.0 without build-id.
                Module libxcb-keysyms.so.1 without build-id.
                Module libXfixes.so.3 without build-id.
                Module libxcb-res.so.0 without build-id.
                Module libxcb.so.1 without build-id.
                Module libxkbcommon.so.0 without build-id.
                Module libgcc_s.so.1 without build-id.
                Module libstdc++.so.6 without build-id.
                Module libOpenGL.so.0 without build-id.
                Module libGLX.so.0 without build-id.
                Module libX11.so.6 without build-id.
                Module libgcrypt.so.20 without build-id.
                Module libgpgme.so.45 without build-id.
                Module libgpgmepp.so.7 without build-id.
                Stack trace of thread 1441:
                #0  0x00007d218ec89f32 _ZN5Union5Style7matchesERK5QListISt10shared_ptrINS_7ElementEEE (libUnion.so.6 + 0x3ef32)
                #1  0x00007d218ed67e13 _ZN10UnionStyle6polishEP12QApplication (UnionWidgetsStyle.so + 0x71e13)
                #2  0x00007d219e1b163d _ZN12QApplication5styleEv (libQt6Widgets.so.6 + 0x1b163d)
                #3  0x00007d219e1b1ce6 _ZN19QApplicationPrivate10initializeEv (libQt6Widgets.so.6 + 0x1b1ce6)
                #4  0x00007d219e1b3fec _ZN19QApplicationPrivate4initEv (libQt6Widgets.so.6 + 0x1b3fec)
                #5  0x0000589160235fb5 main (.ksecretd-wrapped + 0x26fb5)
                #6  0x00007d219c02b391 __libc_start_call_main (libc.so.6 + 0x2b391)
                #7  0x00007d219c02b4a8 __libc_start_main@@GLIBC_2.34 (libc.so.6 + 0x2b4a8)
                #8  0x0000589160236ca5 _start (.ksecretd-wrapped + 0x27ca5)
                
                Stack trace of thread 1467:
                #0  0x00007d219c0a8472 __syscall_cancel_arch (libc.so.6 + 0xa8472)
                #1  0x00007d219c11c067 ppoll (libc.so.6 + 0x11c067)
                #2  0x00007d219be573b8 g_main_context_iterate_unlocked.isra.0 (libglib-2.0.so.0 + 0x693b8)
                #3  0x00007d219be57bdf g_main_context_iteration (libglib-2.0.so.0 + 0x69bdf)
                #4  0x00007d219cd6375d _ZN20QEventDispatcherGlib13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE (libQt6Core.so.6 + 0x56375d)
                #5  0x00007d219c9ded6b _ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE (libQt6Core.so.6 + 0x1ded6b)
                #6  0x00007d219cb1cce3 _ZN7QThread4execEv (libQt6Core.so.6 + 0x31cce3)
                #7  0x00007d219d157fd4 _ZN22QDBusConnectionManager3runEv (libQt6DBus.so.6 + 0x47fd4)
                #8  0x00007d219cbddd40 _ZN14QThreadPrivate5startEPv (libQt6Core.so.6 + 0x3ddd40)
                #9  0x00007d219c09f751 start_thread (libc.so.6 + 0x9f751)
                #10 0x00007d219c12ba4c __clone3 (libc.so.6 + 0x12ba4c)
                
                Stack trace of thread 1586:
                #0  0x00007d219c0a8472 __syscall_cancel_arch (libc.so.6 + 0xa8472)
                #1  0x00007d219c09bf69 __GI___futex_abstimed_wait_cancelable64 (libc.so.6 + 0x9bf69)
                #2  0x00007d219c09ebd4 pthread_cond_wait@@GLIBC_2.3.2 (libc.so.6 + 0x9ebd4)
                #3  0x00007d219cbe70b3 _ZN14QWaitCondition4waitEP6QMutex14QDeadlineTimer (libQt6Core.so.6 + 0x3e70b3)
                #4  0x00007d21987590ce _ZN15QtWaylandClient11EventThread3runEv (libQt6WaylandClient.so.6 + 0xa60ce)
                #5  0x00007d219cbddd40 _ZN14QThreadPrivate5startEPv (libQt6Core.so.6 + 0x3ddd40)
                #6  0x00007d219c09f751 start_thread (libc.so.6 + 0x9f751)
                #7  0x00007d219c12ba4c __clone3 (libc.so.6 + 0x12ba4c)
                
                Stack trace of thread 1587:
                #0  0x00007d219c0a8472 __syscall_cancel_arch (libc.so.6 + 0xa8472)
                #1  0x00007d219c11b885 __poll (libc.so.6 + 0x11b885)
                #2  0x00007d219875912b _ZN15QtWaylandClient11EventThread3runEv (libQt6WaylandClient.so.6 + 0xa612b)
                #3  0x00007d219cbddd40 _ZN14QThreadPrivate5startEPv (libQt6Core.so.6 + 0x3ddd40)
                #4  0x00007d219c09f751 start_thread (libc.so.6 + 0x9f751)
                #5  0x00007d219c12ba4c __clone3 (libc.so.6 + 0x12ba4c)
                ELF object binary architecture: AMD x86-64

I also use the LUKS decryption key in 26.05, but I also need gnome-keyring. Maybe this will help you:

 security.pam.services = {
    plasmalogin-autologin.text = lib.mkForce ''
      auth     requisite pam_nologin.so
      auth     optional  ${config.systemd.package}/lib/security/pam_systemd_loadkey.so
      auth     optional  ${pkgs.kdePackages.kwallet-pam}/lib/security/pam_kwallet5.so
      auth     optional  ${pkgs.gnome-keyring}/lib/security/pam_gnome_keyring.so
      auth     required  pam_succeed_if.so uid >= 1000 quiet
      auth     required  pam_permit.so
      account  include   plasmalogin
      password include   plasmalogin
      session  include   plasmalogin
    '';
  };

UPDATE: I did another test, this time removing the PAM config changes, but also disabling auto-login. I realized that using the wallet auto-unlocking at all, whether from LUKS unlocking or logging in with PLM, causes the segfault. This removes my PAM changes from being a cause, so this issue is either in nixpkgs or in upstream Plasma. I’m currently working around the issue by removing the password on my wallet, but I’ll check for any bug reports and make one if I don’t find one.

So, another update: after further testing, this does seem like a bad-user-data type issue.

I suspected there might be something weird going on when I noticed a second Plasma-related issue pop up: I noticed that it was taking a lot longer to shut down the machine, and checking journalctl revealed that the Plasma session was not properly terminating after receiving sigterm, and instead only stopped when sent a sigkill signal after a timeout.

As a sanity check, I tried doing a fresh install in a virtual machine using the unstable-branch installer and the default config generated by the graphical installer. I then checked for both issues in the virtual machine, and was unable to reproduce either of them. Since I was unable to reproduce them on a clean install, I don’t think it’s an upstream bug anymore.

Since I was already using separate subvolumes for /home and /nix, I tried just wiping (after backing up) my root subvolume and rebuilding to get rid of any potential system state that could be affecting it, and then testing again. The result is that the long shutdown issue disappeared, but the kwallet crashes persists. This has me thinking that now the issue is something in my home directory. However, there’s a lot in there, and I’d rather not just blindly delete files or backup-and-wipe if I can manage it.

My next step might need to be to reach out to a KDE-specific forum (probably their discourse site) and ask for advice there. If anybody here knows what I should try, feel free to leave me suggestions, though.

So another update on this annoying issue: I’ve made progress, but now I’m even more stumped.

After not getting any response on the KDE forum, I started just guessing. I tried deleting ~/.local/share/kwalletd and rebuilding my wallet, but no change. I tried deleting everything possibly KDE related in ~/.cache, but no change. I tried deleting everything possibly KDE related in ~/.cache and ~/.local, but no change. Finally, I deleted everything possibly KDE related (basically only keeping stuff I knew was for other applications) in ~/.cache, ~/.local, and ~/.config, nuking all my user settings, and finally the segfaults stopped. I have no clue what could have possibly been in ~/.config that might have made the difference, but at least that’s stopped.

However, the other issue came back in force. For a bit, plasmashell was only timing out on shutdown if I previously opened the kwallet, but after fixing the segfault and getting the auto-unlock working again, it’s now happening on every reboot. It’s possibly still kwallet related, given it wasn’t happening before if I don’t unlock kwallet, but there’s nothing else I can think to try deleting to reset kwallet any further. There may also just be something cursed going on with my machine, because I noticed a few instances of pipewire in the crashlog list. This issue isn’t happening on my test VM or when I created a new user account to test, so at this point I may just wipe everything, rebuild, and manually copy back my regular files and re-setup all my apps again. I’m losing patience with this, and the near-silence I’ve gotten to this thread and the one on the KDE forum is disheartening (not blaming anybody in particular; it just doesn’t help when nobody else knows what to do either).