GPG Blocks / Hangs, Unable to kill keyboxd

On Silverblue 39
                  Version: 39.20231227.0 (2023-12-27T00:38:35Z)
               BaseCommit: 08d66e8ec3fc31b837936fa8dd63c773f997414e447744c8e4d99e2b4acfca51
             GPGSignature: Valid signature by E8F23996F23218640CB44CBE75CF5AC418B8E74C
      RemovedBasePackages: libavfilter-free libavformat-free libpostproc-free libavutil-free libswresample-free libswscale-free libavcodec-free 6.0.1-2.fc39
                           nano-default-editor 7.2-4.fc39
          LayeredPackages: 'gcc-c++' autoconf automake binutils bison byacc ccache cmake
                           cscope ctags elfutils f39-backgrounds-extras-gnome ffmpeg flex
                           gdb glibc-devel gstreamer1-plugin-openh264
                           gstreamer1-plugins-bad-freeworld gstreamer1-plugins-ugly indent
                           libfido2-devel libtool libusb1-devel libvirt-devel libxml2-devel
                           ltrace make PackageKit-gstreamer-plugin perf
                           python3-cryptography python3-devel python3-pip python3-qt5
                           rpmfusion-free-release rpmfusion-nonfree-release steam-devices
                           strace systemd-devel valgrind vim-default-editor virt-manager
                           wireguard-tools yt-dlp zlib-devel

When running gpg -K, gpg hangs:

$ gpg -vvv -K --debug-level guru --debug-all
gpg: reading options from '[cmdline]'
gpg: reading options from '/var/home/cameron/.gnupg/common.conf'
gpg: using character set 'utf-8'
gpg: enabled debug flags: packet mpi crypto filter iobuf memory cache memstat trust hashing ipc clock lookup extprog
gpg: enabled compatibility flags:
gpg: DBG: [no clock] start
gpg: using pgp trust model
gpg: key F1C05C09C196D2D9: accepted as trusted key

^C
gpg: signal Interrupt caught ... exiting

The hostname in the lockfile matches my hostname:

$ cat .gnupg/gnupg_spawn_keyboxd_sentinel.lock
      4660
fedora.fritz.box
$ hostname
fedora.fritz.box

But the process id for keyboxd do not match.

If I delete the ~/.gnupg/gnupg_spawn_keyboxd_sentinel.lock and reboot, the problem dosen’t fix itself.

gpgconf --kill keyboxd hangs as well.

$ strace gpgconf --kill keyboxd
execve("/usr/bin/gpgconf", ["gpgconf", "--kill", "keyboxd"], 0x7ffe8abd7c10 /* 46 vars */) = 0
brk(NULL)                               = 0x5588fbd16000
arch_prctl(0x3001 /* ARCH_??? */, 0x7ffe0b02a6a0) = -1 EINVAL (Invalid argument)
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
newfstatat(3, "", {st_mode=S_IFREG|0644, st_size=66107, ...}, AT_EMPTY_PATH) = 0
mmap(NULL, 66107, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f283d653000
close(3)                                = 0
openat(AT_FDCWD, "/lib64/libgcrypt.so.20", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0\0\0\0\0\0\0\0"..., 832) = 832
newfstatat(3, "", {st_mode=S_IFREG|0755, st_size=1292576, ...}, AT_EMPTY_PATH) = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f283d651000
mmap(NULL, 1282424, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f283d517000
mmap(0x7f283d526000, 946176, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xf000) = 0x7f283d526000
mmap(0x7f283d60d000, 237568, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xf6000) = 0x7f283d60d000
mmap(0x7f283d647000, 36864, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x12f000) = 0x7f283d647000
mmap(0x7f283d650000, 376, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f283d650000
close(3)                                = 0
openat(AT_FDCWD, "/lib64/libgpg-error.so.0", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0\0\0\0\0\0\0\0"..., 832) = 832
newfstatat(3, "", {st_mode=S_IFREG|0755, st_size=157664, ...}, AT_EMPTY_PATH) = 0
mmap(NULL, 151944, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f283d4f1000
mmap(0x7f283d4f5000, 94208, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x4000) = 0x7f283d4f5000
mmap(0x7f283d50c000, 36864, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1b000) = 0x7f283d50c000
mmap(0x7f283d515000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x24000) = 0x7f283d515000
close(3)                                = 0
openat(AT_FDCWD, "/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 \203\2\0\0\0\0\0"..., 832) = 832
pread64(3, "\6\0\0\0\4\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0"..., 784, 64) = 784
newfstatat(3, "", {st_mode=S_IFREG|0755, st_size=2420152, ...}, AT_EMPTY_PATH) = 0
pread64(3, "\6\0\0\0\4\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0"..., 784, 64) = 784
mmap(NULL, 1973104, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f283d30f000
mmap(0x7f283d335000, 1441792, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x26000) = 0x7f283d335000
mmap(0x7f283d495000, 319488, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x186000) = 0x7f283d495000
mmap(0x7f283d4e3000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1d3000) = 0x7f283d4e3000
mmap(0x7f283d4e9000, 31600, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f283d4e9000
close(3)                                = 0
mmap(NULL, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f283d30c000
arch_prctl(ARCH_SET_FS, 0x7f283d30c740) = 0
set_tid_address(0x7f283d30ca10)         = 5877
set_robust_list(0x7f283d30ca20, 24)     = 0
rseq(0x7f283d30d060, 0x20, 0, 0x53053053) = 0
mprotect(0x7f283d4e3000, 16384, PROT_READ) = 0
mprotect(0x7f283d515000, 4096, PROT_READ) = 0
mprotect(0x7f283d647000, 20480, PROT_READ) = 0
mprotect(0x5588fbcdd000, 4096, PROT_READ) = 0
mprotect(0x7f283d696000, 8192, PROT_READ) = 0
prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
munmap(0x7f283d653000, 66107)           = 0
getrandom("\x73\x2e\x0b\x41\x54\x07\xde\x56", 8, GRND_NONBLOCK) = 8
brk(NULL)                               = 0x5588fbd16000
brk(0x5588fbd37000)                     = 0x5588fbd37000
access("/etc/gcrypt/fips_enabled", F_OK) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/proc/sys/crypto/fips_enabled", O_RDONLY) = 3
newfstatat(3, "", {st_mode=S_IFREG|0444, st_size=0, ...}, AT_EMPTY_PATH) = 0
read(3, "0\n", 1024)                    = 2
close(3)                                = 0
fcntl(0, F_GETFD)                       = 0
fcntl(1, F_GETFD)                       = 0
fcntl(2, F_GETFD)                       = 0
openat(AT_FDCWD, "/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
newfstatat(3, "", {st_mode=S_IFREG|0644, st_size=224366320, ...}, AT_EMPTY_PATH) = 0
mmap(NULL, 224366320, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f282fc00000
close(3)                                = 0
readlink("/proc/self/exe", "/usr/bin/gpgconf", 255) = 16
access("/usr/bin/gpgconf.ctl", F_OK)    = -1 ENOENT (No such file or directory)
access("/etc/gcrypt/fips_enabled", F_OK) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/proc/sys/crypto/fips_enabled", O_RDONLY) = 3
newfstatat(3, "", {st_mode=S_IFREG|0444, st_size=0, ...}, AT_EMPTY_PATH) = 0
read(3, "0\n", 1024)                    = 2
close(3)                                = 0
openat(AT_FDCWD, "/etc/gcrypt/hwf.deny", O_RDONLY) = -1 ENOENT (No such file or directory)
clone(child_stack=NULL, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f283d30ca10) = 5878
wait4(5878, 0x7ffe0b02a3a4, 0, NULL)    = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGWINCH {si_signo=SIGWINCH, si_code=SI_KERNEL} ---
wait4(5878, 0x7ffe0b02a3a4, 0, NULL)    = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGWINCH {si_signo=SIGWINCH, si_code=SI_KERNEL} ---
wait4(5878, 0x7ffe0b02a3a4, 0, NULL)    = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGWINCH {si_signo=SIGWINCH, si_code=SI_KERNEL} ---
wait4(5878, 0x7ffe0b02a3a4, 0, NULL)    = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGWINCH {si_signo=SIGWINCH, si_code=SI_KERNEL} ---
wait4(5878, 0x7ffe0b02a3a4, 0, NULL)    = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGWINCH {si_signo=SIGWINCH, si_code=SI_KERNEL} ---
wait4(5878, 0x7ffe0b02a3a4, 0, NULL)    = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGWINCH {si_signo=SIGWINCH, si_code=SI_KERNEL} ---
wait4(5878, 0x7ffe0b02a3a4, 0, NULL)    = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGWINCH {si_signo=SIGWINCH, si_code=SI_KERNEL} ---
wait4(5878, 0x7ffe0b02a3a4, 0, NULL)    = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGWINCH {si_signo=SIGWINCH, si_code=SI_KERNEL} ---
wait4(5878, 0x7ffe0b02a3a4, 0, NULL)    = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGWINCH {si_signo=SIGWINCH, si_code=SI_KERNEL} ---
wait4(5878, 0x7ffe0b02a3a4, 0, NULL)    = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGWINCH {si_signo=SIGWINCH, si_code=SI_KERNEL} ---
wait4(5878, 0x7ffe0b02a3a4, 0, NULL)    = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGWINCH {si_signo=SIGWINCH, si_code=SI_KERNEL} ---
wait4(5878, 0x7ffe0b02a3a4, 0, NULL)    = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGWINCH {si_signo=SIGWINCH, si_code=SI_KERNEL} ---
wait4(5878, 0x7ffe0b02a3a4, 0, NULL)    = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGWINCH {si_signo=SIGWINCH, si_code=SI_KERNEL} ---
wait4(5878, 0x7ffe0b02a3a4, 0, NULL)    = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGWINCH {si_signo=SIGWINCH, si_code=SI_KERNEL} ---
wait4(5878, ^C0x7ffe0b02a3a4, 0, NULL)    = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
strace: Process 5877 detached
$ ps auxf | grep keyboxd
cameron     5891  0.0  0.0 222432  2080 pts/0    S+   16:26   0:00  |       \_ grep --color=auto keyboxd
cameron     4671  0.0  0.0 225884  1600 ?        Ss   16:18   0:00  \_ keyboxd --homedir /var/home/cameron/.gnupg --daemon
$ gdb --pid  4671
(gdb) bt
#0  0x00007fe395d02fce in __GI___select (nfds=nfds@entry=0, readfds=readfds@entry=0x0, writefds=writefds@entry=0x0, exceptfds=exceptfds@entry=0x0, 
    timeout=timeout@entry=0x7ffc0bc35420) at ../sysdeps/unix/sysv/linux/select.c:69
#1  0x0000557df0c3df65 in dotlock_take_unix (h=0x557df2c2ee90, timeout=-1) at ../common/dotlock.c:1204
#2  0x0000557df0c3e1f1 in dotlock_take (h=<optimized out>, timeout=-1) at ../common/dotlock.c:1296
#3  0x0000557df0c42f7d in create_or_open_database (filename=0x557df2c2e630 "/var/home/cameron/.gnupg/public-keys.d/pubring.db")
    at /usr/src/debug/gnupg2-2.4.3-4.fc39.x86_64/kbx/backend-sqlite.c:559
#4  be_sqlite_add_resource (readonly=0, ctrl=<optimized out>, filename=0x557df2c2e630 "/var/home/cameron/.gnupg/public-keys.d/pubring.db", 
    r_hd=<synthetic pointer>) at /usr/src/debug/gnupg2-2.4.3-4.fc39.x86_64/kbx/backend-sqlite.c:676
#5  kbxd_set_database.constprop.0.isra.0 (readonly=0, filename_arg=0x557df0c497f1 "pubring.db", ctrl=<optimized out>)
    at /usr/src/debug/gnupg2-2.4.3-4.fc39.x86_64/kbx/frontend.c:142
#6  0x0000557df0c2f095 in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/gnupg2-2.4.3-4.fc39.x86_64/kbx/keyboxd.c:848
(gdb) 

This is most annoying and I do not wish to move away from keyboxd.

Looks like the only solution is to disable the use of keyboxd… this is a frustration as my keys are stored in the keyboxd, and I cannot export them without fist accessing gpg… hmmm.