Bug 510321 - kwalletmanager5 crashes in the background with SIGSEGV due to nullptr dereference in KWalletEditor::updateFolderList()
Summary: kwalletmanager5 crashes in the background with SIGSEGV due to nullptr derefer...
Status: RESOLVED FIXED
Alias: None
Product: kwalletmanager
Classification: Applications
Component: general (other bugs)
Version First Reported In: 25.08.1
Platform: Arch Linux Linux
: NOR crash
Target Milestone: ---
Assignee: Valentin Rusu
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-10-06 20:15 UTC by Michael Prager
Modified: 2025-11-01 09:29 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
full stack trace (11.59 KB, text/vnd.kde.kcrash-report)
2025-10-06 20:15 UTC, Michael Prager
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Prager 2025-10-06 20:15:22 UTC
Created attachment 185565 [details]
full stack trace

SUMMARY
I had a couple of crashes of kwalletmanager5 lately. I'm not exactly sure what causes it or how to reproduce. It seems rather random to me. But I took a look at the stack trace, relevant part here:

> Application: Passwortverwaltung (kwalletmanager5), signal: Segmentation fault
> Content of s_kcrashErrorMessage: std::unique_ptr<char []> = {get() = <optimized out>}
> [...]
> Core was generated by `/usr/bin/kwalletmanager5 --kwalletd'.
> Program terminated with signal SIGSEGV, Segmentation fault.
> #0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=11, no_tid=no_tid@entry=0) at pthread_kill.c:44
> 44	      return INTERNAL_SYSCALL_ERROR_P (ret) ? INTERNAL_SYSCALL_ERRNO (ret) : 0;
> [Current thread is 1 (Thread 0x7f4b3e27ba80 (LWP 19700))]
> [...]
> Thread 1 (Thread 0x7f4b3e27ba80 (LWP 19700)):
> [KCrash Handler]
> #5  0x00005628dfe75b72 in KWalletEditor::updateFolderList (this=0x5628f12e3160, checkEntries=false) at /usr/src/debug/kwalletmanager/kwalletmanager-25.08.1/src/manager/kwalleteditor.cpp:331

I identified a nullptr dereference at the crashing code line:

https://invent.kde.org/utilities/kwalletmanager/-/blob/master/src/manager/kwalleteditor.cpp#L331

The member variable `_w` is null here. I can see that other methods which access this member have an explicit null check before using it. So I assume that this is simply missing here.

STEPS TO REPRODUCE
tbd

OBSERVED RESULT
Background crash of the kwalletmanager5 process.

EXPECTED RESULT
No crash obviously.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.4.5
KDE Frameworks Version: 6.18.0
Qt Version: 6.9.2
Kernel Version: 6.16.10-zen1-1-zen (64-bit)
Graphics Platform: Wayland

ADDITIONAL INFORMATION
Full stack trace is attached
Comment 1 Michael Prager 2025-10-06 21:08:37 UTC
PR started here: https://invent.kde.org/utilities/kwalletmanager/-/merge_requests/65
Comment 2 michaelk83 2025-11-01 09:29:24 UTC
The MR was merged, so this can be closed.