Bug 504678 - KWalletManager freezes if (first?) wallet creation is aborted
Summary: KWalletManager freezes if (first?) wallet creation is aborted
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kwallet
Classification: Frameworks and Libraries
Component: general (other bugs)
Version First Reported In: 6.14.0
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: Valentin Rusu
URL:
Keywords:
: 503556 (view as bug list)
Depends on:
Blocks:
 
Reported: 2025-05-22 20:04 UTC by michaelk83
Modified: 2025-06-05 12:16 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.15
Sentry Crash Report: https://crash-reports.kde.org/organizations/kde/issues/156997/events/db94e19d86164d28be95631d4a2460dd/


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description michaelk83 2025-05-22 20:04:34 UTC
SUMMARY
KWalletManager stops responding when (first?) wallet creation is aborted without completing the wizard. Subsequent attempts to start KWalletManager take ~50 sec until the GUI shows up, and then the GUI displays an error. Killing ksecretd and kwalletd resolves the problem.

STEPS TO REPRODUCE
1. Boot into KDE Neon User Edition live DVD (neon-user-20250511-0744.iso).
2. Start KWalletManager. Confirm the prompt to enable the KDE Wallet system (click OK).
3. In KWalletManager, select File -> New Wallet...
4. Enter wallet name: test1
5. On the wallet type selection page, click Cancel. (KWalletManager stops responding.)
6. Kill KWalletManager, then try starting KWalletManager again. (Takes ~50 sec, shows an error.)
7. Kill ksecretd and kwalletd, then start KWalletManager one more time. (Starts without an error.)

OBSERVED RESULT
- In step 5, KWalletManager becomes Not Responding as soon as the wizard is cancelled.
- In step 6, KWalletManager takes ~50 sec to show up, then shows "An error occurred when connecting to the KWallet service: Did not receive a reply."
- No error in step 7.

EXPECTED RESULT
KWalletManager remains responsive, and can be started and restarted without problems.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: KDE Neon User Edition 20250511-0744 (live DVD)
KDE Frameworks Version: 6.14

ADDITIONAL INFORMATION
After canceling the wizard:

neon@neon:~$ cat ~/.config/kwalletrc
[Wallet]
Default Wallet=test1
Enabled=true

neon@neon:~$ ls -lAh ~/.local/share/kwalletd/
total 0

neon@neon:~$ journalctl --since -15m | grep kwallet
May 22 17:42:29 neon dbus-daemon[1640]: [session uid=1000 pid=1640] Activating service name='org.kde.kwalletd6' requested by ':1.65' (uid=1000 pid=3943 comm="kwalletmanager5" label="unconfined")
May 22 17:42:30 neon dbus-daemon[1640]: [session uid=1000 pid=1640] Activating service name='org.kde.secretservicecompat' requested by ':1.67' (uid=1000 pid=4007 comm="/usr/bin/kwalletd6" label="unconfined")
May 22 17:42:30 neon dbus-daemon[1640]: [session uid=1000 pid=1640] Successfully activated service 'org.kde.kwalletd6'
May 22 17:42:30 neon kwalletd6[4007]: qt.dbus.integration: QDBusConnection: name 'org.kde.secretservicecompat' had owner '' but we thought it was ':1.68'
May 22 17:42:30 neon kwalletd6[4007]: Secret Service availability changed: Available
May 22 17:43:55 neon ksecretd[4027]: Using kwallet without parent window!
May 22 17:45:42 neon kwalletd6[4007]: received unexpected result type ao from Completed signal instead of expected o
May 22 17:45:42 neon kwalletd6[4007]: g_task_return_error: assertion 'error != NULL' failed
May 22 17:45:42 neon kwalletd6[4007]: GTask secret_service_real_prompt_async (source object: 0x55dbc3131e50, source tag: 0x72d486739c40) finalized without ever returning (using g_task_return_*()). This potentially indicates a bug in the program.
May 22 17:46:25 neon systemd-coredump[4181]: Process 3943 (kwalletmanager5) of user 1000 dumped core.
May 22 17:46:25 neon drkonqi-coredump-processor[4182]: "/usr/bin/kwalletmanager5" 3943 "/var/lib/systemd/coredump/core.kwalletmanager5.1000.b3d7f14f59fc421e894b8ae6729ef7a3.3943.1747935984000000.zst"
May 22 17:46:25 neon drkonqi-coredump-processor[2013]: "/usr/bin/kwalletmanager5" 3943 "/var/lib/systemd/coredump/core.kwalletmanager5.1000.b3d7f14f59fc421e894b8ae6729ef7a3.3943.1747935984000000.zst"
Comment 1 michaelk83 2025-05-28 08:59:43 UTC
Bug 501135 sounds similar, though I think not the same case. This one is during wallet creation and not during boot. Rebooting would restart ksecretd and kwalletd, which resolves this issue. Also, I'm not seeing the "Assertion `b->cipherType() ..." that was reported in 501135.

I suspect this one is caused by the 6.14 refactor, possibly libsecret hanging when it can't load the partially "created" wallet when KWalletManager tries to refresh the wallets list. That would be similar to what we found in Bug 504656:
https://invent.kde.org/frameworks/kwallet/-/merge_requests/120#note_1225108
Comment 2 Nate Graham 2025-05-28 15:55:40 UTC
Can reproduce with those steps, even if it's not the first wallet.
Comment 3 Bug Janitor Service 2025-05-29 12:30:47 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kwallet/-/merge_requests/122
Comment 4 Marco Martin 2025-05-29 12:44:16 UTC
Git commit 4e7362e5751a79496fca370345af3c1885ff0250 by Marco Martin.
Committed on 29/05/2025 at 12:16.
Pushed by mart into branch 'master'.

Don't freeze when the create wallet dialog is dismissed

libsecret doesn't like invalid dbus object paths as
the second parameter of the signal Completed of the Prompt
interface, and will cause a freeze with a nested glib
event loop stuck in secret_collection_create_sync

use an object path parameter identical to what gnome-keychain
uses, which is just a path to "/"

M  +3    -1    src/runtime/ksecretd/kwalletfreedesktopprompt.cpp

https://invent.kde.org/frameworks/kwallet/-/commit/4e7362e5751a79496fca370345af3c1885ff0250
Comment 5 michaelk83 2025-06-05 12:16:34 UTC
*** Bug 503556 has been marked as a duplicate of this bug. ***