Page MenuHome GnuPG

Kleopatra: Segfault on start/import
Open, HighPublic

Description

To reproduce:

  1. Delete the gnupg home dir (at least I always tested in a clean state)
  2. Import the usual testcerts (one combined import operation): all-pgp, all-smime, sec pgp/smime certs of ted/edward, root cert => Kleopatra often (not always) crashes after trusting the root cert
    • debugview: kleopatra.exe <process started at 09:07:46.672 has terminated with 0xc0000005 (EXCEPTION_ACCESS_VIOLATION)>

Findings:

  • No problem on gpg4win 5.0.1 (tested 5 times)
  • The choice of imported certs does not seem to matter (happened with different and distinct subgroups of the certs listed above), more the amount of certs (probably timing)
  • Probable some race condition involved, as Kleopatra often segfaults already on start (not import) via gdb
  • It looks like it has to do with the filewatcher (@svuorela had a look at the gdb crash output)
  • pinentry debugview:
    • Loading the "qt_" catalog failed for locale QLocale(German, Latin, Germany) (another issue?)
  • kleopatra procmon:
    • shortly after the crash, keyboxd unlocked pubring.db, might be coincidence or a hint
    • some broken "reg create" on some filepath (many times):

      RegCreateKey HKLM\SOFTWARE\Gpg4Win\C:/Program Files/Gpg4win/share/color-schemes/BreezeLight.colors ACCESS DENIED Desired Access: Read
    • the breeze icons seem to be read quite often (no idea, if this is normal)
    • right before and after the crash (some process was still continuing a bit), lots of C:\Windows\Fonts files were read (also not sure if that's expected, but I haven't seen this yet)

LOGS

Debugview

[...]
101	18.655010	9136	kleopatra.exe	org.kde.pim.libkleo: KeyCache::RefreshKeysJob start
102	18.847589	6928	pinentry.exe	Loading the "qt_" catalog failed for locale QLocale(German, Latin, Germany)
103	20.441559	6928	pinentry.exe	<process started at 09:12:09.622 has terminated with exit code 0>
104	20.507922	1540	pinentry.exe	Loading the "qt_" catalog failed for locale QLocale(German, Latin, Germany)
105	21.588317	1540	pinentry.exe	<process started at 09:12:11.296 has terminated with exit code 0>
106	25.727152	9136	kleopatra.exe	org.kde.pim.libkleo: Kleo::KeyCache::RefreshKeysJob(0x25c581d5a40) RefreshKeysJob::done
107	25.737103	9136	kleopatra.exe	org.kde.pim.libkleo: Kleo::FileSystemWatcher(0x25c54cdd2c0) - checking for new files in "C:/Users/g10/AppData/Roaming/gnupg"
108	25.739426	9136	kleopatra.exe	org.kde.pim.libkleo: Kleo::FileSystemWatcher(0x25c54cdd2c0) - found new file "C:/Users/g10/AppData/Roaming/gnupg/trustlist.txt"
109	25.740245	9136	kleopatra.exe	org.kde.pim.libkleo: Kleo::FileSystemWatcher(0x25c54cdd2c0) - watching "C:/Users/g10/AppData/Roaming/gnupg/trustlist.txt"
110	25.742395	9136	kleopatra.exe	org.kde.pim.libkleo: Kleo::FileSystemWatcher(0x25c54cdd2c0) - checking for new files in "C:/Users/g10/AppData/Roaming/gnupg/private-keys-v1.d"
111	25.744219	9136	kleopatra.exe	org.kde.pim.libkleo: Kleo::FileSystemWatcher(0x25c54cdd2c0) - found new file "C:/Users/g10/AppData/Roaming/gnupg/private-keys-v1.d/0D260BD2025388018FA914A59C941060259E7360.key"
112	25.744339	9136	kleopatra.exe	org.kde.pim.libkleo: Kleo::FileSystemWatcher(0x25c54cdd2c0) - found new file "C:/Users/g10/AppData/Roaming/gnupg/private-keys-v1.d/10EA99B65693AD207A4081C6DFF465E44DFD49BF.key"
113	25.744421	9136	kleopatra.exe	org.kde.pim.libkleo: Kleo::FileSystemWatcher(0x25c54cdd2c0) - found new file "C:/Users/g10/AppData/Roaming/gnupg/private-keys-v1.d/1A63F7F35AB5F31A7BE34555DE616C0A2E48F32E.key"
114	25.744506	9136	kleopatra.exe	org.kde.pim.libkleo: Kleo::FileSystemWatcher(0x25c54cdd2c0) - found new file "C:/Users/g10/AppData/Roaming/gnupg/private-keys-v1.d/1D47E09B2406AD9F3F4CDB3A770D8726DAA7D309.key"
115	25.744592	9136	kleopatra.exe	org.kde.pim.libkleo: Kleo::FileSystemWatcher(0x25c54cdd2c0) - found new file "C:/Users/g10/AppData/Roaming/gnupg/private-keys-v1.d/7A62F95F55D026E06FD7449D6830D395AB44665E.key"
116	25.744675	9136	kleopatra.exe	org.kde.pim.libkleo: Kleo::FileSystemWatcher(0x25c54cdd2c0) - found new file "C:/Users/g10/AppData/Roaming/gnupg/private-keys-v1.d/CAC536AACCFBF06B7482A87BDC72EFD9760777B3.key"
117	25.744763	9136	kleopatra.exe	org.kde.pim.libkleo: Kleo::FileSystemWatcher(0x25c54cdd2c0) - found new file "C:/Users/g10/AppData/Roaming/gnupg/private-keys-v1.d/FA53C09B98FC771C31A96B05CE04FDCE84B1013D.key"
118	25.748278	9136	kleopatra.exe	org.kde.pim.libkleo: Kleo::FileSystemWatcher(0x25c54cdd2c0) - watching "C:/Users/g10/AppData/Roaming/gnupg/private-keys-v1.d/0D260BD2025388018FA914A59C941060259E7360.key"
119	25.748398	9136	kleopatra.exe	org.kde.pim.libkleo: Kleo::FileSystemWatcher(0x25c54cdd2c0) - watching "C:/Users/g10/AppData/Roaming/gnupg/private-keys-v1.d/10EA99B65693AD207A4081C6DFF465E44DFD49BF.key"
120	25.748478	9136	kleopatra.exe	org.kde.pim.libkleo: Kleo::FileSystemWatcher(0x25c54cdd2c0) - watching "C:/Users/g10/AppData/Roaming/gnupg/private-keys-v1.d/1A63F7F35AB5F31A7BE34555DE616C0A2E48F32E.key"
121	25.748561	9136	kleopatra.exe	org.kde.pim.libkleo: Kleo::FileSystemWatcher(0x25c54cdd2c0) - watching "C:/Users/g10/AppData/Roaming/gnupg/private-keys-v1.d/1D47E09B2406AD9F3F4CDB3A770D8726DAA7D309.key"
122	25.748646	9136	kleopatra.exe	org.kde.pim.libkleo: Kleo::FileSystemWatcher(0x25c54cdd2c0) - watching "C:/Users/g10/AppData/Roaming/gnupg/private-keys-v1.d/7A62F95F55D026E06FD7449D6830D395AB44665E.key"
123	25.748729	9136	kleopatra.exe	org.kde.pim.libkleo: Kleo::FileSystemWatcher(0x25c54cdd2c0) - watching "C:/Users/g10/AppData/Roaming/gnupg/private-keys-v1.d/CAC536AACCFBF06B7482A87BDC72EFD9760777B3.key"
124	25.748813	9136	kleopatra.exe	org.kde.pim.libkleo: Kleo::FileSystemWatcher(0x25c54cdd2c0) - watching "C:/Users/g10/AppData/Roaming/gnupg/private-keys-v1.d/FA53C09B98FC771C31A96B05CE04FDCE84B1013D.key"
125	32.948474	9136	kleopatra.exe	<process started at 09:07:46.672 has terminated with 0xc0000005 (EXCEPTION_ACCESS_VIOLATION)>

Procmon

[...]
09:12:16,6111424	kleopatra.exe	9136	QueryBasicInformationFile	C:\Users\g10\AppData\Roaming\gnupg\private-keys-v1.d\FA53C09B98FC771C31A96B05CE04FDCE84B1013D.key	SUCCESS	CreationTime: 27.02.2026 09:12:09, LastAccessTime: 27.02.2026 09:12:12, LastWriteTime: 27.02.2026 09:12:09, ChangeTime: 27.02.2026 09:12:09, FileAttributes: A
09:12:16,6111696	kleopatra.exe	9136	CloseFile	C:\Users\g10\AppData\Roaming\gnupg\private-keys-v1.d\FA53C09B98FC771C31A96B05CE04FDCE84B1013D.key	SUCCESS	
09:12:16,6116692	kleopatra.exe	9136	CreateFile	C:\Users\g10\AppData\Roaming\gnupg\public-keys.d	SUCCESS	Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened
09:12:16,6117190	kleopatra.exe	9136	QueryNetworkOpenInformationFile	C:\Users\g10\AppData\Roaming\gnupg\public-keys.d	SUCCESS	CreationTime: 27.02.2026 09:07:52, LastAccessTime: 27.02.2026 09:12:16, LastWriteTime: 27.02.2026 09:12:02, ChangeTime: 27.02.2026 09:12:02, AllocationSize: 01.01.1601 01:00:00, EndOfFile: 01.01.1601 01:00:00, FileAttributes: D
09:12:16,6117479	kleopatra.exe	9136	CloseFile	C:\Users\g10\AppData\Roaming\gnupg\public-keys.d	SUCCESS	
09:12:16,6120517	kleopatra.exe	9136	ReadFile	C:\Windows\System32\kernel32.dll	SUCCESS	Offset: 446.464, Length: 4.096, I/O Flags: Non-cached, Paging I/O, Synchronous Paging I/O, Priority: Normal
09:12:16,6139598	kleopatra.exe	9136	ReadFile	C:\Windows\System32\kernel32.dll	SUCCESS	Offset: 434.176, Length: 32.768, I/O Flags: Non-cached, Paging I/O, Synchronous Paging I/O, Priority: Normal
09:12:16,6157102	kleopatra.exe	9136	QueryNameInformationFile	C:\Program Files\Gpg4win\bin\kleopatra.exe	SUCCESS	Name: \Program Files\Gpg4win\bin\kleopatra.exe
09:12:16,8480965	gpg-agent.exe	2212	CreateFile	C:\Users\g10\AppData\Roaming	SUCCESS	Desired Access: Read Data/List Directory, Synchronize, Disposition: Open, Options: Directory, Synchronous IO Non-Alert, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened
09:12:16,8482473	gpg-agent.exe	2212	QueryDirectory	C:\Users\g10\AppData\Roaming\gnupg	SUCCESS	FileInformationClass: FileBothDirectoryInformation, Filter: gnupg, 2: gnupg
09:12:16,8484825	gpg-agent.exe	2212	CloseFile	C:\Users\g10\AppData\Roaming	SUCCESS	
09:12:17,3495921	DebugView++.1.8.0.103.exe	4120	Thread Exit		SUCCESS	Thread ID: 7868, User Time: 0.0000000, Kernel Time: 0.0000000
09:12:17,3496031	DebugView++.1.8.0.103.exe	4120	Thread Exit		SUCCESS	Thread ID: 7832, User Time: 0.0000000, Kernel Time: 0.0000000
09:12:17,4499768	kleopatra.exe	9136	Process Create	C:\WINDOWS\system32\WerFault.exe	SUCCESS	PID: 5336, Command line: C:\WINDOWS\system32\WerFault.exe -u -p 9136 -s 3092
09:12:17,8650057	keyboxd.exe	9056	CreateFile	C:\Users\g10\AppData\Roaming	SUCCESS	Desired Access: Read Data/List Directory, Synchronize, Disposition: Open, Options: Directory, Synchronous IO Non-Alert, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened
09:12:17,8651437	keyboxd.exe	9056	QueryDirectory	C:\Users\g10\AppData\Roaming\gnupg	SUCCESS	FileInformationClass: FileBothDirectoryInformation, Filter: gnupg, 2: gnupg
09:12:17,8652614	keyboxd.exe	9056	CloseFile	C:\Users\g10\AppData\Roaming	SUCCESS	
09:12:18,1794970	gpg-agent.exe	2212	Thread Exit		SUCCESS	Thread ID: 4300, User Time: 0.0000000, Kernel Time: 0.0000000
09:12:20,8516560	gpg-agent.exe	2212	CreateFile	C:\Users\g10\AppData\Roaming	SUCCESS	Desired Access: Read Data/List Directory, Synchronize, Disposition: Open, Options: Directory, Synchronous IO Non-Alert, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened
09:12:20,8517344	gpg-agent.exe	2212	QueryDirectory	C:\Users\g10\AppData\Roaming\gnupg	SUCCESS	FileInformationClass: FileBothDirectoryInformation, Filter: gnupg, 2: gnupg
09:12:20,8518078	gpg-agent.exe	2212	CloseFile	C:\Users\g10\AppData\Roaming	SUCCESS	
09:12:21,8741267	keyboxd.exe	9056	CreateFile	C:\Users\g10\AppData\Roaming	SUCCESS	Desired Access: Read Data/List Directory, Synchronize, Disposition: Open, Options: Directory, Synchronous IO Non-Alert, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened
09:12:21,8742984	keyboxd.exe	9056	QueryDirectory	C:\Users\g10\AppData\Roaming\gnupg	SUCCESS	FileInformationClass: FileBothDirectoryInformation, Filter: gnupg, 2: gnupg
09:12:21,8744579	keyboxd.exe	9056	CloseFile	C:\Users\g10\AppData\Roaming	SUCCESS	
09:12:23,7006953	kleopatra.exe	9136	Thread Exit		SUCCESS	Thread ID: 6864, User Time: 0.0000000, Kernel Time: 0.0000000
09:12:23,7007733	kleopatra.exe	9136	Thread Exit		SUCCESS	Thread ID: 9072, User Time: 0.0468750, Kernel Time: 0.0156250
09:12:23,7007854	kleopatra.exe	9136	Thread Exit		SUCCESS	Thread ID: 484, User Time: 0.0156250, Kernel Time: 0.0000000
[...]

gdb

Note: Crash already on start (not import)

(gdb) run
[...]
warning: org.kde.pim.libkleo: Kleo::KeyCache::RefreshKeysJob(0x334b530) RefreshKeysJob::done
[Thread 6592.0x153c exited with code 0]
[New Thread 6592.0x968]
warning: org.kde.pim.libkleo: Kleo::FileSystemWatcher(0xf42010) - checking for new files in "C:/Users/g10/AppData/Roaming/gnupg"
warning: org.kde.pim.libkleo: Kleo::FileSystemWatcher(0xf42010) - found new file "C:/Users/g10/AppData/Roaming/gnupg/trustdb.gpg"
warning: org.kde.pim.libkleo: Kleo::FileSystemWatcher(0xf42010) - watching "C:/Users/g10/AppData/Roaming/gnupg/trustdb.gpg"
warning: org.kde.pim.libkleo: Kleo::FileSystemWatcher(0xf42010) - checking for new files in "C:/Users/g10/AppData/Roaming/gnupg/private-keys-v1.d"
warning: org.kde.pim.libkleo: Kleo::FileSystemWatcher(0xf42010) - checking for new files in "C:/Users/g10/AppData/Roaming/gnupg/public-keys.d"
warning: org.kde.pim.libkleo: Kleo::FileSystemWatcher(0xf42010) - found new file "C:/Users/g10/AppData/Roaming/gnupg/public-keys.d/pubring.db"
warning: org.kde.pim.libkleo: Kleo::FileSystemWatcher(0xf42010) - watching "C:/Users/g10/AppData/Roaming/gnupg/public-keys.d/pubring.db"

Thread 1 received signal SIGSEGV, Segmentation fault.
0x00007ffba4c69bf5 in libKPim6Libkleo!_ZNK4Kleo17FileSystemWatcher5delayEv ()
   from C:\Program Files\Gpg4win\bin\libKPim6Libkleo.dll

(gdb) thread apply all bt

Thread 38 (Thread 6592.0x968 "QWindowsFileSystemWatcherEngineThread"):
#0  0x00007ffbe8d025a4 in ntdll!ZwWaitForMultipleObjects () from C:\WINDOWS\SYSTEM32\ntdll.dll
#1  0x00007ffbe6302533 in WaitForMultipleObjectsEx () from C:\WINDOWS\System32\KernelBase.dll
#2  0x00007ffbe6302401 in WaitForMultipleObjects () from C:\WINDOWS\System32\KernelBase.dll
#3  0x00007ffb993b4f73 in QFileSystemWatcher::qt_metacall(QMetaObject::Call, int, void**) () from C:\Program Files\Gpg4win\bin\Qt6Core.dll
#4  0x00007ffb993535ca in QThread::setTerminationEnabled(bool) () from C:\Program Files\Gpg4win\bin\Qt6Core.dll
#5  0x00007ffbe72fe8d7 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll
#6  0x00007ffbe8c2c40c in ntdll!RtlUserThreadStart () from C:\WINDOWS\SYSTEM32\ntdll.dll
#7  0x0000000000000000 in ?? ()

Thread 36 (Thread 6592.0x2710):
#0  0x00007ffbe8d01ad4 in ntdll!ZwWaitForSingleObject () from C:\WINDOWS\SYSTEM32\ntdll.dll
#1  0x00007ffbe62fbc5f in WaitForSingleObjectEx () from C:\WINDOWS\System32\KernelBase.dll
#2  0x00007ffba48e3ce6 in libgpgme-45!gpgme_error_from_errno () from C:\Program Files\Gpg4win\bin\libgpgme-45.dll
#3  0x00007ffba48e5fc1 in libgpgme-45!gpgme_error_from_errno () from C:\Program Files\Gpg4win\bin\libgpgme-45.dll
#4  0x00007ffbe72fe8d7 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll
#5  0x00007ffbe8c2c40c in ntdll!RtlUserThreadStart () from C:\WINDOWS\SYSTEM32\ntdll.dll
#6  0x0000000000000000 in ?? ()

Thread 32 (Thread 6592.0x16d0):
#0  0x00007ffbe8d01b14 in ntdll!ZwReadFile () from C:\WINDOWS\SYSTEM32\ntdll.dll
#1  0x00007ffbe63028dd in ReadFile () from C:\WINDOWS\System32\KernelBase.dll
#2  0x00007ffba48e49c2 in libgpgme-45!gpgme_error_from_errno () from C:\Program Files\Gpg4win\bin\libgpgme-45.dll
#3  0x00007ffbe72fe8d7 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll
#4  0x00007ffbe8c2c40c in ntdll!RtlUserThreadStart () from C:\WINDOWS\SYSTEM32\ntdll.dll
#5  0x0000000000000000 in ?? ()

Thread 28 (Thread 6592.0x1ffc "Thread (pooled)"):
#0  0x00007ffbe8d01ad4 in ntdll!ZwWaitForSingleObject () from C:\WINDOWS\SYSTEM32\ntdll.dll
#1  0x00007ffbe62fbc5f in WaitForSingleObjectEx () from C:\WINDOWS\System32\KernelBase.dll
#2  0x00007ffb99325959 in QWaitCondition::wait(QMutex*, QDeadlineTimer) () from C:\Program Files\Gpg4win\bin\Qt6Core.dll
#3  0x00007ffb99293081 in QThreadPool::startOnReservedThread(QRunnable*) () from C:\Program Files\Gpg4win\bin\Qt6Core.dll
#4  0x00007ffb993535ca in QThread::setTerminationEnabled(bool) () from C:\Program Files\Gpg4win\bin\Qt6Core.dll
#5  0x00007ffbe72fe8d7 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll
#6  0x00007ffbe8c2c40c in ntdll!RtlUserThreadStart () from C:\WINDOWS\SYSTEM32\ntdll.dll
#7  0x0000000000000000 in ?? ()

Thread 27 (Thread 6592.0x794 "Thread (pooled)"):
#0  0x00007ffbe8d01ad4 in ntdll!ZwWaitForSingleObject () from C:\WINDOWS\SYSTEM32\ntdll.dll
#1  0x00007ffbe62fbc5f in WaitForSingleObjectEx () from C:\WINDOWS\System32\KernelBase.dll
#2  0x00007ffb99325959 in QWaitCondition::wait(QMutex*, QDeadlineTimer) () from C:\Program Files\Gpg4win\bin\Qt6Core.dll
#3  0x00007ffb99293081 in QThreadPool::startOnReservedThread(QRunnable*) () from C:\Program Files\Gpg4win\bin\Qt6Core.dll
#4  0x00007ffb993535ca in QThread::setTerminationEnabled(bool) () from C:\Program Files\Gpg4win\bin\Qt6Core.dll
#5  0x00007ffbe72fe8d7 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll
#6  0x00007ffbe8c2c40c in ntdll!RtlUserThreadStart () from C:\WINDOWS\SYSTEM32\ntdll.dll
#7  0x0000000000000000 in ?? ()

Thread 26 (Thread 6592.0xf10 "Thread (pooled)"):
#0  0x00007ffbe8d01ad4 in ntdll!ZwWaitForSingleObject () from C:\WINDOWS\SYSTEM32\ntdll.dll
#1  0x00007ffbe62fbc5f in WaitForSingleObjectEx () from C:\WINDOWS\System32\KernelBase.dll
#2  0x00007ffb99325959 in QWaitCondition::wait(QMutex*, QDeadlineTimer) () from C:\Program Files\Gpg4win\bin\Qt6Core.dll
#3  0x00007ffb99293081 in QThreadPool::startOnReservedThread(QRunnable*) () from C:\Program Files\Gpg4win\bin\Qt6Core.dll
#4  0x00007ffb993535ca in QThread::setTerminationEnabled(bool) () from C:\Program Files\Gpg4win\bin\Qt6Core.dll
#5  0x00007ffbe72fe8d7 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll
#6  0x00007ffbe8c2c40c in ntdll!RtlUserThreadStart () from C:\WINDOWS\SYSTEM32\ntdll.dll
#7  0x0000000000000000 in ?? ()

Thread 25 (Thread 6592.0x1e98):
#0  0x00007ffbe8d025a4 in ntdll!ZwWaitForMultipleObjects () from C:\WINDOWS\SYSTEM32\ntdll.dll
#1  0x00007ffbe6302533 in WaitForMultipleObjectsEx () from C:\WINDOWS\System32\KernelBase.dll
#2  0x00007ffbe856ddae in combase!RoClearError () from C:\WINDOWS\System32\combase.dll
#3  0x00007ffbe8566caf in combase!RoParameterizedTypeExtraGetTypeSignature () from C:\WINDOWS\System32\combase.dll
#4  0x00007ffbe8566b59 in combase!RoParameterizedTypeExtraGetTypeSignature () from C:\WINDOWS\System32\combase.dll
#5  0x00007ffbe72fe8d7 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll
#6  0x00007ffbe8c2c40c in ntdll!RtlUserThreadStart () from C:\WINDOWS\SYSTEM32\ntdll.dll
#7  0x0000000000000000 in ?? ()

Thread 16 (Thread 6592.0x156c):
#0  0x00007ffbe8d025a4 in ntdll!ZwWaitForMultipleObjects () from C:\WINDOWS\SYSTEM32\ntdll.dll
#1  0x00007ffbbfe6ff36 in joySetThreshold () from C:\WINDOWS\SYSTEM32\winmm.dll
#2  0x00007ffbe72fe8d7 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll
#3  0x00007ffbe8c2c40c in ntdll!RtlUserThreadStart () from C:\WINDOWS\SYSTEM32\ntdll.dll
#4  0x0000000000000000 in ?? ()

Thread 15 (Thread 6592.0x2424):
#0  0x00007ffbe8d01b74 in ntdll!ZwRemoveIoCompletion () from C:\WINDOWS\SYSTEM32\ntdll.dll
#1  0x00007ffbe47a908e in Tcpip6_WSHGetSockaddrType () from C:\WINDOWS\system32\mswsock.dll
#2  0x00007ffbe72fe8d7 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll
#3  0x00007ffbe8c2c40c in ntdll!RtlUserThreadStart () from C:\WINDOWS\SYSTEM32\ntdll.dll
#4  0x0000000000000000 in ?? ()

Thread 13 (Thread 6592.0x1430 "QWindowsFileSystemWatcherEngineThread"):
#0  0x00007ffbe8d025a4 in ntdll!ZwWaitForMultipleObjects () from C:\WINDOWS\SYSTEM32\ntdll.dll
#1  0x00007ffbe6302533 in WaitForMultipleObjectsEx () from C:\WINDOWS\System32\KernelBase.dll
#2  0x00007ffbe6302401 in WaitForMultipleObjects () from C:\WINDOWS\System32\KernelBase.dll
#3  0x00007ffb993b4f73 in QFileSystemWatcher::qt_metacall(QMetaObject::Call, int, void**) () from C:\Program Files\Gpg4win\bin\Qt6Core.dll
#4  0x00007ffb993535ca in QThread::setTerminationEnabled(bool) () from C:\Program Files\Gpg4win\bin\Qt6Core.dll
#5  0x00007ffbe72fe8d7 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll
#6  0x00007ffbe8c2c40c in ntdll!RtlUserThreadStart () from C:\WINDOWS\SYSTEM32\ntdll.dll
#7  0x0000000000000000 in ?? ()

Thread 6 (Thread 6592.0x7b8):
#0  0x00007ffbe8d05704 in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\WINDOWS\SYSTEM32\ntdll.dll
#1  0x00007ffbe8c15e0e in ntdll!RtlSetThreadSubProcessTag () from C:\WINDOWS\SYSTEM32\ntdll.dll
#2  0x00007ffbe72fe8d7 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll
#3  0x00007ffbe8c2c40c in ntdll!RtlUserThreadStart () from C:\WINDOWS\SYSTEM32\ntdll.dll
#4  0x0000000000000000 in ?? ()

Thread 5 (Thread 6592.0x1078):
#0  0x00007ffbe8d05704 in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\WINDOWS\SYSTEM32\ntdll.dll
#1  0x00007ffbe8c15e0e in ntdll!RtlSetThreadSubProcessTag () from C:\WINDOWS\SYSTEM32\ntdll.dll
#2  0x00007ffbe72fe8d7 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll
#3  0x00007ffbe8c2c40c in ntdll!RtlUserThreadStart () from C:\WINDOWS\SYSTEM32\ntdll.dll
#4  0x0000000000000000 in ?? ()

Thread 4 (Thread 6592.0x1be8):
#0  0x00007ffbe8d05704 in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\WINDOWS\SYSTEM32\ntdll.dll
#1  0x00007ffbe8c15e0e in ntdll!RtlSetThreadSubProcessTag () from C:\WINDOWS\SYSTEM32\ntdll.dll
#2  0x00007ffbe72fe8d7 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll
#3  0x00007ffbe8c2c40c in ntdll!RtlUserThreadStart () from C:\WINDOWS\SYSTEM32\ntdll.dll
#4  0x0000000000000000 in ?? ()

Thread 3 (Thread 6592.0x1f80):
#0  0x00007ffbe8d05704 in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\WINDOWS\SYSTEM32\ntdll.dll
#1  0x00007ffbe8c15e0e in ntdll!RtlSetThreadSubProcessTag () from C:\WINDOWS\SYSTEM32\ntdll.dll
#2  0x00007ffbe72fe8d7 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll
#3  0x00007ffbe8c2c40c in ntdll!RtlUserThreadStart () from C:\WINDOWS\SYSTEM32\ntdll.dll
#4  0x0000000000000000 in ?? ()

Thread 2 (Thread 6592.0x13a4):
#0  0x00007ffbe8d05704 in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\WINDOWS\SYSTEM32\ntdll.dll
#1  0x00007ffbe8c15e0e in ntdll!RtlSetThreadSubProcessTag () from C:\WINDOWS\SYSTEM32\ntdll.dll
#2  0x00007ffbe72fe8d7 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll
#3  0x00007ffbe8c2c40c in ntdll!RtlUserThreadStart () from C:\WINDOWS\SYSTEM32\ntdll.dll
#4  0x0000000000000000 in ?? ()

Thread 1 (Thread 6592.0xcf8):
#0  0x00007ffba4c69bf5 in libKPim6Libkleo!_ZNK4Kleo17FileSystemWatcher5delayEv () from C:\Program Files\Gpg4win\bin\libKPim6Libkleo.dll
#1  0x00007ffba4c6dc44 in libKPim6Libkleo!_ZN4Kleo17FileSystemWatcher7Private18onDirectoryChangedERK7QString () from C:\Program Files\Gpg4win\bin\libKPim6Libkleo.dll
#2  0x00007ffba4c6e6b1 in libKPim6Libkleo!_ZN4Kleo17FileSystemWatcher10setEnabledEb () from C:\Program Files\Gpg4win\bin\libKPim6Libkleo.dll
#3  0x00007ffba4c3b961 in libKPim6Libkleo!_ZN4Kleo8KeyCache7Private14refreshJobDoneERKN5GpgME13KeyListResultE () from C:\Program Files\Gpg4win\bin\libKPim6Libkleo.dll
#4  0x00007ffb9947d78b in operator<<(QDebug, QPermission const&) () from C:\Program Files\Gpg4win\bin\Qt6Core.dll
#5  0x00007ffba4c39827 in libKPim6Libkleo!_ZN4Kleo8KeyCache14RefreshKeysJob7Private7jobDoneERKN5GpgME13KeyListResultE () from C:\Program Files\Gpg4win\bin\libKPim6Libkleo.dll
#6  0x00007ffb9947da59 in operator<<(QDebug, QPermission const&) () from C:\Program Files\Gpg4win\bin\Qt6Core.dll
#7  0x00007ffba336678b in libqgpgmeqt6-15!_ZN6QGpgME14ListAllKeysJob6resultERKN5GpgME13KeyListResultERKSt6vectorINS1_3KeyESaIS6_EESA_RK7QStringRKNS1_5ErrorE () from C:\Program Files\Gpg4win\bin\libqgpgmeqt6-15.dll
#8  0x00007ffba340d610 in libqgpgmeqt6-15!_ZN6QGpgME13WKDRefreshJob11qt_metacallEN11QMetaObject4CallEiPPv () from C:\Program Files\Gpg4win\bin\libqgpgmeqt6-15.dll
#9  0x00007ffb991c0835 in QMetaCallEvent::placeMetaCall(QObject*) () from C:\Program Files\Gpg4win\bin\Qt6Core.dll
#10 0x00007ffb991c4fdb in QObject::event(QEvent*) () from C:\Program Files\Gpg4win\bin\Qt6Core.dll
#11 0x00007ffb98a558cc in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from C:\Program Files\Gpg4win\bin\Qt6Widgets.dll
#12 0x00007ffb991856a8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from C:\Program Files\Gpg4win\bin\Qt6Core.dll
#13 0x00007ffb99189478 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from C:\Program Files\Gpg4win\bin\Qt6Core.dll
#14 0x00007ffb951fa832 in QWindowsGuiEventDispatcher::sendPostedEvents() () from C:\Program Files\Gpg4win\bin\Qt6Gui.dll
#15 0x00007ffb99342cfc in QEventDispatcherWin32::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from C:\Program Files\Gpg4win\bin\Qt6Core.dll
#16 0x00007ffb951fa809 in QWindowsGuiEventDispatcher::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from C:\Program Files\Gpg4win\bin\Qt6Gui.dll
#17 0x00007ffb99190825 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from C:\Program Files\Gpg4win\bin\Qt6Core.dll
#18 0x00007ffba4c360f4 in libKPim6Libkleo!_ZNK4Kleo8KeyCache7Private20ensureCachePopulatedEv () from C:\Program Files\Gpg4win\bin\libKPim6Libkleo.dll
#19 0x00007ffba4c38f01 in libKPim6Libkleo!_ZNK4Kleo8KeyCache4keysEv () from C:\Program Files\Gpg4win\bin\libKPim6Libkleo.dll
#20 0x00007ffba4c474fa in libKPim6Libkleo!_ZN4Kleo20AbstractKeyListModel7Private18updateFromKeyCacheEv () from C:\Program Files\Gpg4win\bin\libKPim6Libkleo.dll
#21 0x00007ffba4c478cd in libKPim6Libkleo!_ZN4Kleo20AbstractKeyListModel11useKeyCacheEbNS_7KeyList7OptionsE () from C:\Program Files\Gpg4win\bin\libKPim6Libkleo.dll
#22 0x00007ff7466b9bd5 in ?? ()
#23 0x00007ffb991c0835 in QMetaCallEvent::placeMetaCall(QObject*) () from C:\Program Files\Gpg4win\bin\Qt6Core.dll
#24 0x00007ffb991c4fdb in QObject::event(QEvent*) () from C:\Program Files\Gpg4win\bin\Qt6Core.dll
#25 0x00007ffb98a558cc in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from C:\Program Files\Gpg4win\bin\Qt6Widgets.dll
#26 0x00007ffb991856a8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from C:\Program Files\Gpg4win\bin\Qt6Core.dll
#27 0x00007ffb99189478 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from C:\Program Files\Gpg4win\bin\Qt6Core.dll
#28 0x00007ffb951fa832 in QWindowsGuiEventDispatcher::sendPostedEvents() () from C:\Program Files\Gpg4win\bin\Qt6Gui.dll
#29 0x00007ffb99342cfc in QEventDispatcherWin32::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from C:\Program Files\Gpg4win\bin\Qt6Core.dll
#30 0x00007ffb951fa809 in QWindowsGuiEventDispatcher::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from C:\Program Files\Gpg4win\bin\Qt6Gui.dll
#31 0x00007ffb99190825 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from C:\Program Files\Gpg4win\bin\Qt6Core.dll
#32 0x00007ffb9918e8b6 in QCoreApplication::exec() () from C:\Program Files\Gpg4win\bin\Qt6Core.dll
#33 0x00007ff7466b7d72 in ?? ()
#34 0x00007ff746707b75 in ?? ()
#35 0x00007ff7463f12ee in ?? ()
#36 0x00007ff7463f13e6 in ?? ()
#37 0x00007ffbe72fe8d7 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll
#38 0x00007ffbe8c2c40c in ntdll!RtlUserThreadStart () from C:\WINDOWS\SYSTEM32\ntdll.dll
#39 0x0000000000000000 in ?? ()

Details

Version
gpg4win-5.0.2 (beta) @ win11

Event Timeline

timegrid created this task.
timegrid created this object with edit policy "Contributor (Project)".

I rechecked the keyboxd locking of pubring.db. On crash via gdb the file was unlocked before, so this doesn't seem to be the problem:

13:07:51,6556924	keyboxd.exe	9952	UnlockFileSingle	C:\Users\g10\AppData\Roaming\gnupg\public-keys.d\pubring.db	SUCCESS	Offset: 1.073.741.826, Length: 510
[...]
13:07:51,9696800	kleopatra.exe	5044	CreateFile	C:\Users\g10\AppData\Roaming\gnupg\public-keys.d\pubring.db	SUCCESS	Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened
13:07:51,9697748	kleopatra.exe	5044	QueryNetworkOpenInformationFile	C:\Users\g10\AppData\Roaming\gnupg\public-keys.d\pubring.db	SUCCESS	CreationTime: 27.02.2026 13:08:07, LastAccessTime: 27.02.2026 13:08:10, LastWriteTime: 27.02.2026 13:08:07, ChangeTime: 27.02.2026 13:08:07, AllocationSize: 01.01.1601 01:00:00, EndOfFile: 01.01.1601 01:00:00, FileAttributes: A
13:07:51,9698225	kleopatra.exe	5044	CloseFile	C:\Users\g10\AppData\Roaming\gnupg\public-keys.d\pubring.db	SUCCESS	
13:07:51,9894572	kleopatra.exe	5044	CreateFile	C:\Users\g10\AppData\Roaming\gnupg\public-keys.d\pubring.db	SUCCESS	Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened
13:07:51,9895551	kleopatra.exe	5044	QueryNetworkOpenInformationFile	C:\Users\g10\AppData\Roaming\gnupg\public-keys.d\pubring.db	SUCCESS	CreationTime: 27.02.2026 13:08:07, LastAccessTime: 27.02.2026 13:08:10, LastWriteTime: 27.02.2026 13:08:07, ChangeTime: 27.02.2026 13:08:07, AllocationSize: 01.01.1601 01:00:00, EndOfFile: 01.01.1601 01:00:00, FileAttributes: A
13:07:51,9896094	kleopatra.exe	5044	CloseFile	C:\Users\g10\AppData\Roaming\gnupg\public-keys.d\pubring.db	SUCCESS	
13:07:51,9897343	kleopatra.exe	5044	FileSystemControl	C:\Users\g10\AppData\Roaming\gnupg\public-keys.d\pubring.db	SUCCESS	Control: FSCTL_QUERY_FILE_REGIONS
13:07:51,9902134	kleopatra.exe	5044	CreateFile	C:\Users\g10\AppData\Roaming\gnupg\public-keys.d\pubring.db	SUCCESS	Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened
13:07:51,9903091	kleopatra.exe	5044	QueryBasicInformationFile	C:\Users\g10\AppData\Roaming\gnupg\public-keys.d\pubring.db	SUCCESS	CreationTime: 27.02.2026 13:08:07, LastAccessTime: 27.02.2026 13:08:10, LastWriteTime: 27.02.2026 13:08:07, ChangeTime: 27.02.2026 13:08:07, FileAttributes: A
13:07:51,9903591	kleopatra.exe	5044	CloseFile	C:\Users\g10\AppData\Roaming\gnupg\public-keys.d\pubring.db	SUCCESS	
13:07:51,9904227	kleopatra.exe	5044	FileSystemControl	C:\Users\g10\AppData\Roaming\gnupg\public-keys.d\pubring.db	SUCCESS	Control: FSCTL_QUERY_FILE_REGIONS
13:07:51,9908231	kleopatra.exe	5044	CreateFile	C:\Users\g10\AppData\Roaming\gnupg\public-keys.d\pubring.db	SUCCESS	Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened
13:07:51,9908881	kleopatra.exe	5044	QueryBasicInformationFile	C:\Users\g10\AppData\Roaming\gnupg\public-keys.d\pubring.db	SUCCESS	CreationTime: 27.02.2026 13:08:07, LastAccessTime: 27.02.2026 13:08:10, LastWriteTime: 27.02.2026 13:08:07, ChangeTime: 27.02.2026 13:08:07, FileAttributes: A
13:07:51,9909283	kleopatra.exe	5044	CloseFile	C:\Users\g10\AppData\Roaming\gnupg\public-keys.d\pubring.db	SUCCESS	
13:07:51,9909782	kleopatra.exe	5044	FileSystemControl	C:\Users\g10\AppData\Roaming\gnupg\public-keys.d\pubring.db	SUCCESS	Control: FSCTL_QUERY_FILE_REGIONS
13:07:51,9913680	kleopatra.exe	5044	CreateFile	C:\Users\g10\AppData\Roaming\gnupg\public-keys.d	SUCCESS	Desired Access: Read Data/List Directory, Synchronize, Disposition: Open, Options: Directory, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened
13:07:51,9914727	kleopatra.exe	5044	NotifyChangeDirectory	C:\Users\g10\AppData\Roaming\gnupg\public-keys.d		Filter: FILE_NOTIFY_CHANGE_FILE_NAME, FILE_NOTIFY_CHANGE_DIR_NAME, FILE_NOTIFY_CHANGE_ATTRIBUTES, FILE_NOTIFY_CHANGE_SIZE, FILE_NOTIFY_CHANGE_LAST_WRITE, FILE_NOTIFY_CHANGE_SECURITY
13:07:51,9915279	kleopatra.exe	5044	CloseFile	C:\Users\g10\AppData\Roaming\gnupg\public-keys.d	SUCCESS	
13:07:52,0501129	gdb.exe	3320	CloseFile	C:\Windows\System32\CoreUIComponents.dll	SUCCESS	
13:07:52,0502782	gdb.exe	3320	CloseFile	C:\Windows\System32\CoreMessaging.dll	SUCCESS	
13:07:52,0503804	gdb.exe	3320	CloseFile	C:\Windows\System32\TextInputFramework.dll	SUCCESS	
13:07:52,0504852	gdb.exe	3320	CloseFile	C:\Windows\System32\twinapi.appcore.dll	SUCCESS	
13:07:52,0506048	gdb.exe	3320	CloseFile	C:\Windows\System32\DataExchange.dll	SUCCESS	
13:07:52,0506885	gdb.exe	3320	CloseFile	C:\Windows\System32\clbcatq.dll	SUCCESS	
13:07:52,0508343	gdb.exe	3320	CloseFile	C:\Windows\System32\directxdatabasehelper.dll	SUCCESS	
13:07:52,0508826	gdb.exe	3320	CloseFile	C:\Windows\System32\rsaenh.dll	SUCCESS	
13:07:52,0509294	gdb.exe	3320	CloseFile	C:\Windows\System32\cryptsp.dll	SUCCESS	
13:07:52,0510115	gdb.exe	3320	CloseFile	C:\Program Files\Gpg4win\bin\Qt6Svg.dll	SUCCESS	
13:07:53,5846347	keyboxd.exe	9952	CreateFile	C:\Users\g10\AppData\Roaming	SUCCESS	Desired Access: Read Data/List Directory, Synchronize, Disposition: Open, Options: Directory, Synchronous IO Non-Alert, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened
13:07:53,5847744	keyboxd.exe	9952	QueryDirectory	C:\Users\g10\AppData\Roaming\gnupg	SUCCESS	FileInformationClass: FileBothDirectoryInformation, Filter: gnupg, 2: gnupg
13:07:53,5848817	keyboxd.exe	9952	CloseFile	C:\Users\g10\AppData\Roaming	SUCCESS	
13:07:54,9020450	gpg-agent.exe	8288	CreateFile	C:\Users\g10\AppData\Roaming	SUCCESS	Desired Access: Read Data/List Directory, Synchronize, Disposition: Open, Options: Directory, Synchronous IO Non-Alert, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened
13:07:54,9021478	gpg-agent.exe	8288	QueryDirectory	C:\Users\g10\AppData\Roaming\gnupg	SUCCESS	FileInformationClass: FileBothDirectoryInformation, Filter: gnupg, 2: gnupg
13:07:54,9022932	gpg-agent.exe	8288	CloseFile	C:\Users\g10\AppData\Roaming	SUCCESS