Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vkconfig: segfaults while handling segfault, forever #2167

Closed
dominikh opened this issue Nov 13, 2024 · 5 comments · Fixed by #2169
Closed

vkconfig: segfaults while handling segfault, forever #2167

dominikh opened this issue Nov 13, 2024 · 5 comments · Fixed by #2169

Comments

@dominikh
Copy link

With Vulkan Configurator version 2.6.2 installed on NixOS, when running vkconfig (or vkconfig gui), vkconfig produces no output on stderr or stdout, and no GUI appears. The process doesn't respond to SIGINT. Attaching strace to the process shows that it is repeatedly recreating the configuration in ~/.config/LunarG/vkconfig.conf, seemingly in an infinite loop.

The following should be one full repeating segment (but it might span two iterations, i.e. the segment might not be aligned with the iteration boundary). Just in case, here's the full trace as well:
strace.tar.gz

[pid 1718120] newfstatat(AT_FDCWD, "/etc/localtime", {st_mode=S_IFREG|0444, st_size=2298, ...}, 0) = 0
[pid 1718120] newfstatat(AT_FDCWD, "/etc/localtime", {st_mode=S_IFREG|0444, st_size=2298, ...}, 0) = 0
[pid 1718120] newfstatat(AT_FDCWD, "/etc/localtime", {st_mode=S_IFREG|0444, st_size=2298, ...}, 0) = 0
[pid 1718120] access("/home/dominikh/.config/LunarG/vkconfig.conf", F_OK) = 0
[pid 1718120] access("/home/dominikh/.config/LunarG/vkconfig.conf", W_OK) = 0
[pid 1718120] statx(AT_FDCWD, "/home/dominikh/.config/LunarG/vkconfig.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, {stx_mask=STATX_ALL|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0644, stx_size=822, ...}) = 0
[pid 1718120] statx(AT_FDCWD, "/home/dominikh/.config/LunarG/vkconfig.conf", AT_STATX_SYNC_AS_STAT|AT_SYMLINK_NOFOLLOW|AT_NO_AUTOMOUNT, STATX_ALL, {stx_mask=STATX_ALL|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0644, stx_size=822, ...}) = 0
[pid 1718120] openat(AT_FDCWD, "/home/dominikh/.config/LunarG", O_RDWR|O_CLOEXEC|O_TMPFILE, 0600) = 14
[pid 1718120] statx(AT_FDCWD, "/home/dominikh/.config/LunarG/vkconfig.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, {stx_mask=STATX_ALL|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0644, stx_size=822, ...}) = 0
[pid 1718120] access("/home/dominikh/.config/LunarG/vkconfig.conf", R_OK) = 0
[pid 1718120] access("/home/dominikh/.config/LunarG/vkconfig.conf", W_OK) = 0
[pid 1718120] access("/home/dominikh/.config/LunarG/vkconfig.conf", X_OK) = -1 EACCES (Permission denied)
[pid 1718120] fchmod(14, 0644)          = 0
[pid 1718120] statx(14, "", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT|AT_EMPTY_PATH, STATX_ALL, {stx_mask=STATX_ALL|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0644, stx_size=0, ...}) = 0
[pid 1718120] write(14, "[General]\nActiveApplication=\nAct"..., 822) = 822
[pid 1718120] lseek(14, 0, SEEK_SET)    = 0
[pid 1718120] fdatasync(14)             = 0
[pid 1718120] linkat(AT_FDCWD, "/proc/self/fd/14", AT_FDCWD, "/home/dominikh/.config/LunarG/vkconfig.conf", AT_SYMLINK_FOLLOW) = -1 EEXIST (File exists)
[pid 1718120] linkat(AT_FDCWD, "/proc/self/fd/14", AT_FDCWD, "/home/dominikh/.config/LunarG/vkconfig.conf.RKJtdr", AT_SYMLINK_FOLLOW) = 0
[pid 1718120] close(14)                 = 0
[pid 1718120] rename("/home/dominikh/.config/LunarG/vkconfig.conf.RKJtdr", "/home/dominikh/.config/LunarG/vkconfig.conf") = 0
[pid 1718120] statx(AT_FDCWD, "/home/dominikh/.config/LunarG/vkconfig.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, {stx_mask=STATX_ALL|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0644, stx_size=822, ...}) = 0
[pid 1718120] newfstatat(AT_FDCWD, "/etc/localtime", {st_mode=S_IFREG|0444, st_size=2298, ...}, 0) = 0
[pid 1718120] newfstatat(AT_FDCWD, "/etc/localtime", {st_mode=S_IFREG|0444, st_size=2298, ...}, 0) = 0
[pid 1718120] newfstatat(AT_FDCWD, "/etc/localtime", {st_mode=S_IFREG|0444, st_size=2298, ...}, 0) = 0
[pid 1718120] close(13)                 = 0
[pid 1718120] unlink("/home/dominikh/.config/LunarG/vkconfig.conf.lock") = 0
[pid 1718120] access("/home/dominikh/.config/LunarG.conf", F_OK) = -1 ENOENT (No such file or directory)
[pid 1718120] statx(AT_FDCWD, "/home/dominikh/.config/LunarG.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffe7f06b8a0) = -1 ENOENT (No such file or directory)
[pid 1718120] statx(AT_FDCWD, "/home/dominikh/.config/LunarG.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffe7f06b840) = -1 ENOENT (No such file or directory)
[pid 1718120] access("/etc/xdg/LunarG/vkconfig.conf", F_OK) = -1 ENOENT (No such file or directory)
[pid 1718120] statx(AT_FDCWD, "/etc/xdg/LunarG/vkconfig.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffe7f06b8a0) = -1 ENOENT (No such file or directory)
[pid 1718120] statx(AT_FDCWD, "/etc/xdg/LunarG/vkconfig.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffe7f06b840) = -1 ENOENT (No such file or directory)
[pid 1718120] access("/home/dominikh/.nix-profile/etc/xdg/LunarG/vkconfig.conf", F_OK) = -1 ENOENT (No such file or directory)
[pid 1718120] statx(AT_FDCWD, "/home/dominikh/.nix-profile/etc/xdg/LunarG/vkconfig.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffe7f06b8a0) = -1 ENOENT (No such file or directory)
[pid 1718120] statx(AT_FDCWD, "/home/dominikh/.nix-profile/etc/xdg/LunarG/vkconfig.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffe7f06b840) = -1 ENOENT (No such file or directory)
[pid 1718120] access("/nix/profile/etc/xdg/LunarG/vkconfig.conf", F_OK) = -1 ENOENT (No such file or directory)
[pid 1718120] statx(AT_FDCWD, "/nix/profile/etc/xdg/LunarG/vkconfig.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffe7f06b8a0) = -1 ENOENT (No such file or directory)
[pid 1718120] statx(AT_FDCWD, "/nix/profile/etc/xdg/LunarG/vkconfig.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffe7f06b840) = -1 ENOENT (No such file or directory)
[pid 1718120] access("/home/dominikh/.local/state/nix/profile/etc/xdg/LunarG/vkconfig.conf", F_OK) = -1 ENOENT (No such file or directory)
[pid 1718120] statx(AT_FDCWD, "/home/dominikh/.local/state/nix/profile/etc/xdg/LunarG/vkconfig.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffe7f06b8a0) = -1 ENOENT (No such file or directory)
[pid 1718120] statx(AT_FDCWD, "/home/dominikh/.local/state/nix/profile/etc/xdg/LunarG/vkconfig.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffe7f06b840) = -1 ENOENT (No such file or directory)
[pid 1718120] access("/etc/profiles/per-user/dominikh/etc/xdg/LunarG/vkconfig.conf", F_OK) = -1 ENOENT (No such file or directory)
[pid 1718120] statx(AT_FDCWD, "/etc/profiles/per-user/dominikh/etc/xdg/LunarG/vkconfig.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffe7f06b8a0) = -1 ENOENT (No such file or directory)
[pid 1718120] statx(AT_FDCWD, "/etc/profiles/per-user/dominikh/etc/xdg/LunarG/vkconfig.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffe7f06b840) = -1 ENOENT (No such file or directory)
[pid 1718120] access("/nix/var/nix/profiles/default/etc/xdg/LunarG/vkconfig.conf", F_OK) = -1 ENOENT (No such file or directory)
[pid 1718120] statx(AT_FDCWD, "/nix/var/nix/profiles/default/etc/xdg/LunarG/vkconfig.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffe7f06b8a0) = -1 ENOENT (No such file or directory)
[pid 1718120] statx(AT_FDCWD, "/nix/var/nix/profiles/default/etc/xdg/LunarG/vkconfig.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffe7f06b840) = -1 ENOENT (No such file or directory)
[pid 1718120] access("/run/current-system/sw/etc/xdg/LunarG/vkconfig.conf", F_OK) = -1 ENOENT (No such file or directory)
[pid 1718120] statx(AT_FDCWD, "/run/current-system/sw/etc/xdg/LunarG/vkconfig.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffe7f06b8a0) = -1 ENOENT (No such file or directory)
[pid 1718120] statx(AT_FDCWD, "/run/current-system/sw/etc/xdg/LunarG/vkconfig.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffe7f06b840) = -1 ENOENT (No such file or directory)
[pid 1718120] access("/etc/xdg/LunarG.conf", F_OK) = -1 ENOENT (No such file or directory)
[pid 1718120] statx(AT_FDCWD, "/etc/xdg/LunarG.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffe7f06b8a0) = -1 ENOENT (No such file or directory)
[pid 1718120] statx(AT_FDCWD, "/etc/xdg/LunarG.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffe7f06b840) = -1 ENOENT (No such file or directory)
[pid 1718120] access("/home/dominikh/.nix-profile/etc/xdg/LunarG.conf", F_OK) = -1 ENOENT (No such file or directory)
[pid 1718120] statx(AT_FDCWD, "/home/dominikh/.nix-profile/etc/xdg/LunarG.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffe7f06b8a0) = -1 ENOENT (No such file or directory)
[pid 1718120] statx(AT_FDCWD, "/home/dominikh/.nix-profile/etc/xdg/LunarG.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffe7f06b840) = -1 ENOENT (No such file or directory)
[pid 1718120] access("/nix/profile/etc/xdg/LunarG.conf", F_OK) = -1 ENOENT (No such file or directory)
[pid 1718120] statx(AT_FDCWD, "/nix/profile/etc/xdg/LunarG.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffe7f06b8a0) = -1 ENOENT (No such file or directory)
[pid 1718120] statx(AT_FDCWD, "/nix/profile/etc/xdg/LunarG.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffe7f06b840) = -1 ENOENT (No such file or directory)
[pid 1718120] access("/home/dominikh/.local/state/nix/profile/etc/xdg/LunarG.conf", F_OK) = -1 ENOENT (No such file or directory)
[pid 1718120] statx(AT_FDCWD, "/home/dominikh/.local/state/nix/profile/etc/xdg/LunarG.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffe7f06b8a0) = -1 ENOENT (No such file or directory)
[pid 1718120] statx(AT_FDCWD, "/home/dominikh/.local/state/nix/profile/etc/xdg/LunarG.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffe7f06b840) = -1 ENOENT (No such file or directory)
[pid 1718120] access("/etc/profiles/per-user/dominikh/etc/xdg/LunarG.conf", F_OK) = -1 ENOENT (No such file or directory)
[pid 1718120] statx(AT_FDCWD, "/etc/profiles/per-user/dominikh/etc/xdg/LunarG.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffe7f06b8a0) = -1 ENOENT (No such file or directory)
[pid 1718120] statx(AT_FDCWD, "/etc/profiles/per-user/dominikh/etc/xdg/LunarG.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffe7f06b840) = -1 ENOENT (No such file or directory)
[pid 1718120] access("/nix/var/nix/profiles/default/etc/xdg/LunarG.conf", F_OK) = -1 ENOENT (No such file or directory)
[pid 1718120] statx(AT_FDCWD, "/nix/var/nix/profiles/default/etc/xdg/LunarG.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffe7f06b8a0) = -1 ENOENT (No such file or directory)
[pid 1718120] statx(AT_FDCWD, "/nix/var/nix/profiles/default/etc/xdg/LunarG.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffe7f06b840) = -1 ENOENT (No such file or directory)
[pid 1718120] access("/run/current-system/sw/etc/xdg/LunarG.conf", F_OK) = -1 ENOENT (No such file or directory)
[pid 1718120] statx(AT_FDCWD, "/run/current-system/sw/etc/xdg/LunarG.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffe7f06b8a0) = -1 ENOENT (No such file or directory)
[pid 1718120] statx(AT_FDCWD, "/run/current-system/sw/etc/xdg/LunarG.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffe7f06b840) = -1 ENOENT (No such file or directory)
[pid 1718120] statx(AT_FDCWD, "/home/dominikh/.config/LunarG/vkconfig.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, {stx_mask=STATX_ALL|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0644, stx_size=822, ...}) = 0
[pid 1718120] newfstatat(AT_FDCWD, "/etc/localtime", {st_mode=S_IFREG|0444, st_size=2298, ...}, 0) = 0
[pid 1718120] newfstatat(AT_FDCWD, "/etc/localtime", {st_mode=S_IFREG|0444, st_size=2298, ...}, 0) = 0
[pid 1718120] newfstatat(AT_FDCWD, "/etc/localtime", {st_mode=S_IFREG|0444, st_size=2298, ...}, 0) = 0
[pid 1718120] access("/home/dominikh/.config/LunarG.conf", F_OK) = -1 ENOENT (No such file or directory)
[pid 1718120] statx(AT_FDCWD, "/home/dominikh/.config/LunarG.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffe7f06b7a0) = -1 ENOENT (No such file or directory)
[pid 1718120] statx(AT_FDCWD, "/home/dominikh/.config/LunarG.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffe7f06b740) = -1 ENOENT (No such file or directory)
[pid 1718120] access("/etc/xdg/LunarG/vkconfig.conf", F_OK) = -1 ENOENT (No such file or directory)
[pid 1718120] statx(AT_FDCWD, "/etc/xdg/LunarG/vkconfig.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffe7f06b7a0) = -1 ENOENT (No such file or directory)
[pid 1718120] statx(AT_FDCWD, "/etc/xdg/LunarG/vkconfig.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffe7f06b740) = -1 ENOENT (No such file or directory)
[pid 1718120] access("/home/dominikh/.nix-profile/etc/xdg/LunarG/vkconfig.conf", F_OK) = -1 ENOENT (No such file or directory)
[pid 1718120] statx(AT_FDCWD, "/home/dominikh/.nix-profile/etc/xdg/LunarG/vkconfig.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffe7f06b7a0) = -1 ENOENT (No such file or directory)
[pid 1718120] statx(AT_FDCWD, "/home/dominikh/.nix-profile/etc/xdg/LunarG/vkconfig.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffe7f06b740) = -1 ENOENT (No such file or directory)
[pid 1718120] access("/nix/profile/etc/xdg/LunarG/vkconfig.conf", F_OK) = -1 ENOENT (No such file or directory)
[pid 1718120] statx(AT_FDCWD, "/nix/profile/etc/xdg/LunarG/vkconfig.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffe7f06b7a0) = -1 ENOENT (No such file or directory)
[pid 1718120] statx(AT_FDCWD, "/nix/profile/etc/xdg/LunarG/vkconfig.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffe7f06b740) = -1 ENOENT (No such file or directory)
[pid 1718120] access("/home/dominikh/.local/state/nix/profile/etc/xdg/LunarG/vkconfig.conf", F_OK) = -1 ENOENT (No such file or directory)
[pid 1718120] statx(AT_FDCWD, "/home/dominikh/.local/state/nix/profile/etc/xdg/LunarG/vkconfig.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffe7f06b7a0) = -1 ENOENT (No such file or directory)
[pid 1718120] statx(AT_FDCWD, "/home/dominikh/.local/state/nix/profile/etc/xdg/LunarG/vkconfig.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffe7f06b740) = -1 ENOENT (No such file or directory)
[pid 1718120] access("/etc/profiles/per-user/dominikh/etc/xdg/LunarG/vkconfig.conf", F_OK) = -1 ENOENT (No such file or directory)
[pid 1718120] statx(AT_FDCWD, "/etc/profiles/per-user/dominikh/etc/xdg/LunarG/vkconfig.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffe7f06b7a0) = -1 ENOENT (No such file or directory)
[pid 1718120] statx(AT_FDCWD, "/etc/profiles/per-user/dominikh/etc/xdg/LunarG/vkconfig.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffe7f06b740) = -1 ENOENT (No such file or directory)
[pid 1718120] access("/nix/var/nix/profiles/default/etc/xdg/LunarG/vkconfig.conf", F_OK) = -1 ENOENT (No such file or directory)
[pid 1718120] statx(AT_FDCWD, "/nix/var/nix/profiles/default/etc/xdg/LunarG/vkconfig.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffe7f06b7a0) = -1 ENOENT (No such file or directory)
[pid 1718120] statx(AT_FDCWD, "/nix/var/nix/profiles/default/etc/xdg/LunarG/vkconfig.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffe7f06b740) = -1 ENOENT (No such file or directory)
[pid 1718120] access("/run/current-system/sw/etc/xdg/LunarG/vkconfig.conf", F_OK) = -1 ENOENT (No such file or directory)
[pid 1718120] statx(AT_FDCWD, "/run/current-system/sw/etc/xdg/LunarG/vkconfig.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffe7f06b7a0) = -1 ENOENT (No such file or directory)
[pid 1718120] statx(AT_FDCWD, "/run/current-system/sw/etc/xdg/LunarG/vkconfig.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffe7f06b740) = -1 ENOENT (No such file or directory)
[pid 1718120] access("/etc/xdg/LunarG.conf", F_OK) = -1 ENOENT (No such file or directory)
[pid 1718120] statx(AT_FDCWD, "/etc/xdg/LunarG.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffe7f06b7a0) = -1 ENOENT (No such file or directory)
[pid 1718120] statx(AT_FDCWD, "/etc/xdg/LunarG.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffe7f06b740) = -1 ENOENT (No such file or directory)
[pid 1718120] access("/home/dominikh/.nix-profile/etc/xdg/LunarG.conf", F_OK) = -1 ENOENT (No such file or directory)
[pid 1718120] statx(AT_FDCWD, "/home/dominikh/.nix-profile/etc/xdg/LunarG.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffe7f06b7a0) = -1 ENOENT (No such file or directory)
[pid 1718120] statx(AT_FDCWD, "/home/dominikh/.nix-profile/etc/xdg/LunarG.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffe7f06b740) = -1 ENOENT (No such file or directory)
[pid 1718120] access("/nix/profile/etc/xdg/LunarG.conf", F_OK) = -1 ENOENT (No such file or directory)
[pid 1718120] statx(AT_FDCWD, "/nix/profile/etc/xdg/LunarG.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffe7f06b7a0) = -1 ENOENT (No such file or directory)
[pid 1718120] statx(AT_FDCWD, "/nix/profile/etc/xdg/LunarG.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffe7f06b740) = -1 ENOENT (No such file or directory)
[pid 1718120] access("/home/dominikh/.local/state/nix/profile/etc/xdg/LunarG.conf", F_OK) = -1 ENOENT (No such file or directory)
[pid 1718120] statx(AT_FDCWD, "/home/dominikh/.local/state/nix/profile/etc/xdg/LunarG.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffe7f06b7a0) = -1 ENOENT (No such file or directory)
[pid 1718120] statx(AT_FDCWD, "/home/dominikh/.local/state/nix/profile/etc/xdg/LunarG.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffe7f06b740) = -1 ENOENT (No such file or directory)
[pid 1718120] access("/etc/profiles/per-user/dominikh/etc/xdg/LunarG.conf", F_OK) = -1 ENOENT (No such file or directory)
[pid 1718120] statx(AT_FDCWD, "/etc/profiles/per-user/dominikh/etc/xdg/LunarG.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffe7f06b7a0) = -1 ENOENT (No such file or directory)
[pid 1718120] statx(AT_FDCWD, "/etc/profiles/per-user/dominikh/etc/xdg/LunarG.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffe7f06b740) = -1 ENOENT (No such file or directory)
[pid 1718120] access("/nix/var/nix/profiles/default/etc/xdg/LunarG.conf", F_OK) = -1 ENOENT (No such file or directory)
[pid 1718120] statx(AT_FDCWD, "/nix/var/nix/profiles/default/etc/xdg/LunarG.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffe7f06b7a0) = -1 ENOENT (No such file or directory)
[pid 1718120] statx(AT_FDCWD, "/nix/var/nix/profiles/default/etc/xdg/LunarG.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffe7f06b740) = -1 ENOENT (No such file or directory)
[pid 1718120] access("/run/current-system/sw/etc/xdg/LunarG.conf", F_OK) = -1 ENOENT (No such file or directory)
[pid 1718120] statx(AT_FDCWD, "/run/current-system/sw/etc/xdg/LunarG.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffe7f06b7a0) = -1 ENOENT (No such file or directory)
[pid 1718120] statx(AT_FDCWD, "/run/current-system/sw/etc/xdg/LunarG.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffe7f06b740) = -1 ENOENT (No such file or directory)
[pid 1718120] write(5, "\1\0\0\0\0\0\0\0", 8) = 8
[pid 1718120] access("/home/dominikh/.config/LunarG/vkconfig.conf", F_OK) = 0
[pid 1718120] openat(AT_FDCWD, "/home/dominikh/.config/LunarG/vkconfig.conf", O_RDWR|O_CREAT|O_CLOEXEC, 0666) = 13
[pid 1718120] close(13)                 = 0
[pid 1718120] openat(AT_FDCWD, "/home/dominikh/.config/LunarG/vkconfig.conf.lock", O_RDWR|O_CREAT|O_EXCL|O_CLOEXEC, 0666) = 13
[pid 1718120] flock(13, LOCK_EX|LOCK_NB) = 0
[pid 1718120] openat(AT_FDCWD, "/proc/sys/kernel/random/boot_id", O_RDONLY|O_CLOEXEC) = 14
[pid 1718120] read(14, "34897098-4b42-4c02-928d-d0d7fd00"..., 36) = 36
[pid 1718120] close(14)                 = 0
[pid 1718120] openat(AT_FDCWD, "/var/lib/dbus/machine-id", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
[pid 1718120] openat(AT_FDCWD, "/usr/local/var/lib/dbus/machine-id", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
[pid 1718120] uname({sysname="Linux", nodename="chulak", ...}) = 0
[pid 1718120] getpid()                  = 1718120
[pid 1718120] readlink("/proc/1718120/exe", "/nix/store/b7qrryb39hxx3z8lfi7fp"..., 256) = 95
[pid 1718120] getpid()                  = 1718120
[pid 1718120] write(13, "1718120\n.vkconfig-wrapped\nchulak"..., 71) = 71
[pid 1718120] fdatasync(13)             = 0
[pid 1718120] access("/home/dominikh/.config/LunarG/vkconfig.conf", F_OK) = 0
[pid 1718120] statx(AT_FDCWD, "/home/dominikh/.config/LunarG/vkconfig.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, {stx_mask=STATX_ALL|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0644, stx_size=822, ...}) = 0

@dominikh
Copy link
Author

The contents of the written vkconfig.conf:

[General]
ActiveApplication=
ActiveConfiguration=Validation
FirstTimeRun=true
LayersMode=1
LoaderMessage=0
STATE_Applicationlist=false
STATE_PerApplication=false
STATE_SystemTray=false
crashed=true
default_configuration_files=@Invalid()
geometry=@ByteArray()
lastExecutablePath=
lastExportPath=
lastImportPath=
lastLauncherLogFile=
lastLayersPaths=
lastWorkingDirPath=
launcherCollapsed=@ByteArray()
launcherOnClear=@ByteArray()
layerGeometry=@ByteArray()
splitter1State=@ByteArray()
splitter2State=@ByteArray()
splitter3State=@ByteArray()
splitterLayerState=@ByteArray()
vkConfigVersion=2.2.3
vkconfig2_6_geometry=@ByteArray()
vkconfig2_6_splitter1State=@ByteArray()
vkconfig2_6_splitter2State=@ByteArray()
vkconfig2_6_splitter3State=@ByteArray()
vkconfig2_6_windowState=@ByteArray()
vulkan_sdk=
windowState=@ByteArray()

crashed=true seems notable. Are we crashing while writing the configuration, which causes us to write the configuration, and so on?

@dominikh
Copy link
Author

gdb with a release build:

Temporary breakpoint 1, 0x0000000000429ec0 in main ()
(gdb) cont
Continuing.
[New Thread 0x7ffff29b96c0 (LWP 1813445)]
[New Thread 0x7ffff21b86c0 (LWP 1813446)]
[New Thread 0x7ffff19b76c0 (LWP 1813447)]

Thread 1 "vkconfig" received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
(gdb) bt
#0  0x0000000000000000 in ?? ()
#1  0x0000000000469ee7 in CreateInstance(QLibrary&, VkInstance_T*&, bool) ()
#2  0x00000000004304ce in Configurator::UpdateDevices() ()
#3  0x0000000000430adb in Configurator::Init() ()
#4  0x000000000044d65e in run_gui(int, char**, CommandLine const&) ()
#5  0x0000000000429f52 in main ()
(gdb) nexti
0x000000000044ec20 in SurrenderConfiguration(int) ()
(gdb) cont
Continuing.

Thread 1 "vkconfig" received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
(gdb) bt
#0  0x0000000000000000 in ?? ()
#1  0x0000000000469ee7 in CreateInstance(QLibrary&, VkInstance_T*&, bool) ()
#2  0x00000000004304ce in Configurator::UpdateDevices() ()
#3  0x0000000000430adb in Configurator::Init() ()
#4  0x000000000044d65e in run_gui(int, char**, CommandLine const&) ()
#5  0x0000000000429f52 in main ()

Running a debug build:

vkconfig: /home/dominikh/config-foo/source/vkconfig/vulkan_util.cpp:93: VkResult CreateInstance(QLibrary&, VkInstance_T*&, bool): Assertion `vkEnumerateInstanceExtensionProperties' failed.
Aborted (core dumped)

There are two problems here. One is that we're indeed segfaulting continuously, getting stuck in a loop of segfault -> surrender config -> segfault -> .... The other problem is that on the path shown in the backtrace, CreateInstance assumes that the vulkan shared library has been loaded successfully, but UpdateDevices doesn't actually ensure this. The only thing keeping us from calling a null function pointer is the debug-only assert.

@dominikh dominikh changed the title vkconfig: hangs when starting GUI vkconfig: segfaults while handling segfault, forever Nov 13, 2024
@christophe-lunarg
Copy link
Contributor

Hi,

Do you have an installed Vulkan Loader and driver?
Can you run vulkancapsviewer https://vulkan.gpuinfo.org/download.php and upload a report to GPUInfo.org and share a link to that report so that I better understand your system?

@dominikh
Copy link
Author

Do you have an installed Vulkan Loader and driver?

In the context of this bug, no. The dlopen call failed to find libvulkan.so (for reasons that are external to vkconfig). That's what led to the segfault and subsequent infinite loop.

In this call stack,

Thread 1 "vkconfig" received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
(gdb) bt
#0  0x0000000000000000 in ?? ()
#1  0x0000000000469ee7 in CreateInstance(QLibrary&, VkInstance_T*&, bool) ()
#2  0x00000000004304ce in Configurator::UpdateDevices() ()
#3  0x0000000000430adb in Configurator::Init() ()
#4  0x000000000044d65e in run_gui(int, char**, CommandLine const&) ()
#5  0x0000000000429f52 in main ()

nobody checks that QLibrary::load succeeds. CreateInstance resolves vkEnumerateInstanceExtensionProperties and calls it, which segfaults when the library couldn't be loaded. There's an assert, but that gets skipped in release builds. In other words, vkconfig doesn't gracefully handle the lack of a working loader and crashes.

The segfault leads to a second bug, where vkconfig ends up doing SurrenderConfiguration -> segfault -> SurrenderConfiguration -> segfault -> ... forever.

@christophe-lunarg
Copy link
Contributor

You are correct that Vulkan Loader not being installed was not handle correctly in Vulkan Configurator 2. I could reproduce the crash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants