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

[BUG]: Frequent crashes when entering fullscreen on Ubuntu with Vulkan #12099

Open
iMineLink opened this issue Dec 17, 2024 · 1 comment
Open

Comments

@iMineLink
Copy link
Contributor

Describe the Bug

Often, when entering fullscreen by double-clicking on the game window using Vulkan on Ubuntu, the PCSX2 process crashes.
This issue seems to be related to frequent swap chain creation failures when transitioning to fullscreen. The subsequent destruction of the ad-hoc created Vulkan surface triggers a segmentation fault.
Commenting out the destruction of such surface allows for graceful handling of the swap chain creation failure, but most likely causes the leak of the unused surface.
Note that the GPU I'm testing this on is quite old: it's an NVIDIA GTX 770 running on driver 470.256.02.

Reproduction Steps

Open a game.
Double-click on game window.
If PCSX2 did not crash already, try again double clicking back and forth until it does.

Expected Behavior

No crash.
Graceful swap chain creation failure handling would allow the user to retry going fullscreen: the issue happens frequently but not all the times.

PCSX2 Revision

v2.3.54

Operating System

Linux (64bit) - Specify distro below

If Linux - Specify Distro

Ubuntu 22.04.5 LTS

Logs & Dumps

Below the PCSX2 log and stack trace (collected from a debug build) at the moment of the crash:

[    5.4716] acquireRenderWindow() recreate=false fullscreen=true render_to_main=false surfaceless=false
[    5.5168] Surface refresh rate: 60 hz
[    5.5192] Creating a swap chain with 2 images in present mode VK_PRESENT_MODE_IMMEDIATE_KHR
[    5.5605] (CreateSwapChain) vkCreateSwapchainKHR failed:  (-3: VK_ERROR_INITIALIZATION_FAILED)
[    5.5606] Failed to create swap chain
*************** Unhandled SIGSEGV at 0x737a4057783c ***************
  0x005aa998b31ac1 _ZN12CrashHandlerL12LogCallstackEiPKv [/home/ubuntu/Downloads/pcsx2/common/CrashHandler.cpp:284]
  0x005aa998b31a01 _ZN12CrashHandler18CrashSignalHandlerEiP9siginfo_tPv [/home/ubuntu/Downloads/pcsx2/common/CrashHandler.cpp:315]
  0x005aa998b689d9 _ZN16PageFaultHandlerL13SignalHandlerEiP9siginfo_tPv [/home/ubuntu/Downloads/pcsx2/common/Linux/LnxHostSys.cpp:341]
  0x00737b85e4251f [./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0]
  0x00737a4057783c wsi_DestroySurfaceKHR [../src/vulkan/wsi/wsi_common.c:289]
  0x00737b800f32fc terminator_DestroySurfaceKHR [./loader/wsi.c:197]
  0x005aa9985dee1d _ZN11VKSwapChain20DestroyVulkanSurfaceEP12VkInstance_TP10WindowInfoP14VkSurfaceKHR_T [/home/ubuntu/Downloads/pcsx2/pcsx2/GS/Renderers/Vulkan/VKSwapChain.cpp:132]
  0x005aa99857d536 _ZN10GSDeviceVK12UpdateWindowEv [/home/ubuntu/Downloads/pcsx2/pcsx2/GS/Renderers/Vulkan/GSDeviceVK.cpp:2186]
  0x005aa9980b46ac _Z21GSUpdateDisplayWindowv [/home/ubuntu/Downloads/pcsx2/pcsx2/GS/GS.cpp:535]
  0x005aa997ee2740 _ZZN4MTGS19UpdateDisplayWindowEvENK3$_2clEv [/home/ubuntu/Downloads/pcsx2/pcsx2/MTGS.cpp:965]
  0x005aa997ee270c _ZSt13__invoke_implIvRZN4MTGS19UpdateDisplayWindowEvE3$_2JEET_St14__invoke_otherOT0_DpOT1_ [/usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/invoke.h:61]
  0x005aa997ee26ac _ZSt10__invoke_rIvRZN4MTGS19UpdateDisplayWindowEvE3$_2JEENSt9enable_ifIX16is_invocable_r_vIT_T0_DpT1_EES4_E4typeEOS5_DpOS6_ [/usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/invoke.h:111]
  0x005aa997ee25dc _ZNSt17_Function_handlerIFvvEZN4MTGS19UpdateDisplayWindowEvE3$_2E9_M_invokeERKSt9_Any_data [/usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/std_function.h:290]
  0x005aa997b190f4 _ZNKSt8functionIFvvEEclEv [/usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/std_function.h:590]
  0x005aa997ee0ddd _ZN4MTGSL8MainLoopEv [/home/ubuntu/Downloads/pcsx2/pcsx2/MTGS.cpp:513]
  0x005aa997ede644 _ZN4MTGSL16ThreadEntryPointEv [/home/ubuntu/Downloads/pcsx2/pcsx2/MTGS.cpp:183]
  0x005aa997b5dd16 _ZSt13__invoke_implIvRPFvvEJEET_St14__invoke_otherOT0_DpOT1_ [/usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/invoke.h:61]
  0x005aa997b5dcbc _ZSt10__invoke_rIvRPFvvEJEENSt9enable_ifIX16is_invocable_r_vIT_T0_DpT1_EES4_E4typeEOS5_DpOS6_ [/usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/invoke.h:111]
  0x005aa997b5dbdc _ZNSt17_Function_handlerIFvvEPS0_E9_M_invokeERKSt9_Any_data [/usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/std_function.h:290]
  0x005aa997b190f4 _ZNKSt8functionIFvvEEclEv [/usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/std_function.h:590]
  0x005aa998b69555 _ZN9Threading6Thread10ThreadProcEPv [/home/ubuntu/Downloads/pcsx2/common/Linux/LnxThreads.cpp:229]
  0x00737b85e94ac2 start_thread [./nptl/pthread_create.c:442]
  0x00737b85f2684f [../sysdeps/unix/sysv/linux/x86_64/clone3.S:81]
  0xffffffffffffffff
*******************************************************************
Aborting application.
Aborted (core dumped)
@iMineLink
Copy link
Contributor Author

Crosslinking the bug report filed on the NVIDIA forums for potential related driver issue investigation: https://forums.developer.nvidia.com/t/bug-vulkan-frequent-fullscreen-swap-chain-creation-failure-causes-segfault-on-surface-destruction/317451

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

No branches or pull requests

2 participants