hrydgard / ppsspp

A PSP emulator for Android, Windows, Mac and Linux, written in C++. Want to contribute? Join us on Discord at https://discord.gg/5NJB6dD or just send pull requests / issues. For discussion use the forums at forums.ppsspp.org.
https://www.ppsspp.org
Other
11.43k stars 2.19k forks source link

crash when turning off/on the monitor #17910

Open gucio321 opened 1 year ago

gucio321 commented 1 year ago

Game or games this happens in

not applicable

What area of the game / PPSSPP

I have an external monitor connected to my PC (like every PC has :smile:). When I turn the monitor off (with power button) and then I turn it back on, PPSSPP crashes with segfault.

What should happen

everything should work

Logs

VulkanMayBeAvailable: Device allowed ('SDL:Linux')
VulkanMayBeAvailable: Library loaded ('libvulkan.so')
VulkanMayBeAvailable: Enumerating instance extensions
VulkanMayBeAvailable: Instance extension count: 23
VulkanMaybeAvailable: Instance extension found: VK_KHR_device_group_creation (00000001)
VulkanMaybeAvailable: Instance extension found: VK_KHR_display (00000017)
VulkanMaybeAvailable: Instance extension found: VK_KHR_external_fence_capabilities (00000001)
VulkanMaybeAvailable: Instance extension found: VK_KHR_external_memory_capabilities (00000001)
VulkanMaybeAvailable: Instance extension found: VK_KHR_external_semaphore_capabilities (00000001)
VulkanMaybeAvailable: Instance extension found: VK_KHR_get_display_properties2 (00000001)
VulkanMaybeAvailable: Instance extension found: VK_KHR_get_physical_device_properties2 (00000002)
VulkanMaybeAvailable: Instance extension found: VK_KHR_get_surface_capabilities2 (00000001)
VulkanMaybeAvailable: Instance extension found: VK_KHR_surface (00000019)
VulkanMaybeAvailable: Instance extension found: VK_KHR_surface_protected_capabilities (00000001)
VulkanMaybeAvailable: Instance extension found: VK_KHR_wayland_surface (00000006)
VulkanMaybeAvailable: Instance extension found: VK_KHR_xcb_surface (00000006)
VulkanMaybeAvailable: Instance extension found: VK_KHR_xlib_surface (00000006)
VulkanMaybeAvailable: Instance extension found: VK_EXT_acquire_drm_display (00000001)
VulkanMaybeAvailable: Instance extension found: VK_EXT_acquire_xlib_display (00000001)
VulkanMaybeAvailable: Instance extension found: VK_EXT_debug_report (0000000a)
VulkanMaybeAvailable: Instance extension found: VK_EXT_debug_utils (00000002)
VulkanMaybeAvailable: Instance extension found: VK_EXT_direct_mode_display (00000001)
VulkanMaybeAvailable: Instance extension found: VK_EXT_display_surface_counter (00000001)
VulkanMaybeAvailable: Instance extension found: VK_EXT_swapchain_colorspace (00000004)
VulkanMaybeAvailable: Instance extension found: VK_EXT_surface_maintenance1 (00000001)
VulkanMaybeAvailable: Instance extension found: VK_KHR_portability_enumeration (00000001)
VulkanMaybeAvailable: Instance extension found: VK_LUNARG_direct_driver_loading (00000001)
VulkanMayBeAvailable: Calling vkCreateInstance
VulkanMayBeAvailable: Vulkan test instance created successfully.
VulkanMayBeAvailable: Eligible device found: 'Intel(R) UHD Graphics 770 (ADL-S GT1)'
VulkanMayBeAvailable: Ineligible device found and ignored: 'llvmpipe (LLVM 16.0.6, 256 bits)'
VulkanMayBeAvailable: Found working Vulkan API!
VulkanMayBeAvailable: Destroying instance
DEBUG: Vulkan might be available.
Info: We compiled against SDL version 2.26.3 and we are linking against SDL version 2.26.3. :)
ThreadManager::Init(compute threads: 10, all: 20)
02:13:983 Core/Config.cpp:328 I[G3D]: Longest display side: 1920 pixels. Choosing scale 2
02:13:991 UI/BackgroundAudio.cpp:510 E[SYSTEM]: Failed to load the default sample for UI sound 5
02:13:991 UI/BackgroundAudio.cpp:510 E[SYSTEM]: Failed to load the default sample for UI sound 6
OpenGL 2.0 or higher.
loading control pad mappings from gamecontrollerdb.txt: SUCCESS!
found control pad: Sony PLAYSTATION(R)3 Controller, loading mapping: SUCCESS, mapping is:
0300afd34c0500006802000011810000,Sony PLAYSTATION(R)3 Controller,platform:Linux,x:b3,a:b0,b:b1,y:b2,back:b8,guide:b10,start:b9,dpleft:b15,dpdown:b14,dpright:b16,dpup:b13,leftshoulder:b4,lefttrigger:a2,rightshoulder:b6,rightshoulder:b5,righttrigger:a5,leftstick:b7,leftstick:b11,rightstick:b12,leftx:a0,lefty:a1,rightx:a3,righty:a4,
pad 1 has been assigned to control pad: Sony PLAYSTATION(R)3 Controller
found control pad: Sony PLAYSTATION(R)3 Controller, loading mapping: SUCCESS, mapping is:
0300afd34c0500006802000011810000,Sony PLAYSTATION(R)3 Controller,platform:Linux,x:b3,a:b0,b:b1,y:b2,back:b8,guide:b10,start:b9,dpleft:b15,dpdown:b14,dpright:b16,dpup:b13,leftshoulder:b4,lefttrigger:a2,rightshoulder:b6,rightshoulder:b5,righttrigger:a5,leftstick:b7,leftstick:b11,rightstick:b12,leftx:a0,lefty:a1,rightx:a3,righty:a4,
Segmentation fault (core dumped)

Platform

Linux / BSD

Mobile phone model or graphics card

Intel AlderLake-S GT1

PPSSPP version affected

(current master) b9b7342ffd818fb837b34d904157c5e6639e120b

Last working version

No response

Graphics backend (3D API)

Vulkan

Checklist

gucio321 commented 1 year ago

and it seems to be OpenGL image

hch12907 commented 1 year ago

Is this on X11 or Wayland? (You can check that with echo $DISPLAY $WAYLAND_DISPLAY)

Edit: also, do you mind telling which DE or WM you are using (GNOME/KDE/Sway/i3/...)?

gucio321 commented 1 year ago

Its wayland

hch12907 commented 1 year ago

Can you run it using gdb and give me the backtrace?

Run gdb PPSSPPSDL in the terminal, inside gdb enter run, then once PPSSPP crashes you run bt for backtrace.

gucio321 commented 1 year ago

Ok will do that, but tomorrow

gucio321 commented 1 year ago

@hch12907 here is gdb output:

Thread 1 "PPSSPPSDL" received signal SIGSEGV, Segmentation fault.
0x00007ffff7db9b0c in decoration_frame_configure (frame=0x1b7e440, configuration=0x23c79d0, user_data=0x1a06fb0) at /usr/src/debug/SDL2-2.26.3-1.fc38.x86_64/src/video/wayland/SDL_waylandwindow.c:823
823         driverdata = (SDL_WaylandOutputData *) SDL_GetDisplayForWindow(window)->driverdata;                                                                                                                                               
(gdb) bt
#0  0x00007ffff7db9b0c in decoration_frame_configure (frame=0x1b7e440, configuration=0x23c79d0, user_data=0x1a06fb0) at /usr/src/debug/SDL2-2.26.3-1.fc38.x86_64/src/video/wayland/SDL_waylandwindow.c:823
#1  0x00007ffff6b0a9cc in xdg_surface_configure (user_data=0x1b7e440, xdg_surface=<optimized out>, serial=313) at ../src/libdecor.c:347
#2  0x00007ffff6af8be6 in ffi_call_unix64 () at ../src/x86/unix64.S:104
#3  0x00007ffff6af54bf in ffi_call_int (cif=cif@entry=0x7fffffffb590, fn=<optimized out>, rvalue=<optimized out>, avalue=<optimized out>, closure=closure@entry=0x0) at ../src/x86/ffi64.c:673
#4  0x00007ffff6af818e in ffi_call (cif=cif@entry=0x7fffffffb590, fn=<optimized out>, rvalue=rvalue@entry=0x0, avalue=avalue@entry=0x7fffffffb660) at ../src/x86/ffi64.c:710
#5  0x00007ffff6b27f0e in wl_closure_invoke (closure=closure@entry=0x19e7c80, target=<optimized out>, target@entry=0x1b7e370, opcode=opcode@entry=0, data=<optimized out>, flags=1) at ../src/connection.c:1025
#6  0x00007ffff6b28793 in dispatch_event (display=display@entry=0x19ddd20, queue=0x19dde10) at ../src/wayland-client.c:1631
#7  0x00007ffff6b28a3c in dispatch_queue (queue=0x19dde10, display=0x19ddd20) at ../src/wayland-client.c:1777
#8  wl_display_dispatch_queue_pending (display=display@entry=0x19ddd20, queue=queue@entry=0x19dde10) at ../src/wayland-client.c:2019
#9  0x00007ffff6b28aa0 in wl_display_dispatch_pending (display=display@entry=0x19ddd20) at ../src/wayland-client.c:2082
#10 0x00007ffff6ce493a in libdecor_plugin_cairo_dispatch (plugin=<optimized out>, timeout=0) at ../src/plugins/cairo/libdecor-cairo.c:515
#11 0x00007ffff7eaa51f in Wayland_PumpEvents (_this=<optimized out>) at /usr/src/debug/SDL2-2.26.3-1.fc38.x86_64/src/video/wayland/SDL_waylandevents.c:369
#12 0x00007ffff7de26f0 in SDL_PumpEventsInternal (push_sentinel=push_sentinel@entry=SDL_TRUE) at /usr/src/debug/SDL2-2.26.3-1.fc38.x86_64/src/events/SDL_events.c:867
#13 0x00007ffff7de2ade in SDL_WaitEventTimeout_REAL (event=0x7fffffffbce0, timeout=0) at /usr/src/debug/SDL2-2.26.3-1.fc38.x86_64/src/events/SDL_events.c:1046
#14 0x0000000000484c98 in main ()
(gdb) 
hch12907 commented 1 year ago

Seems like the bug is in SDL, not PPSSPP.

And it seems like this bug will be reproducible in GNOME only because of its lack of xdg_decoration_v1 support - hence the libdecor_plugin_cairo_dispatch in backtrace. Unfortunately I can't really test it here (KDE & Sway both support it).

gucio321 commented 1 year ago

would it help if I created a Dockerfile with reproduction of this issue?

hrydgard commented 1 year ago

Maybe, but you're probably better off reporting to gnome or SDL, as indeed, this does not look like a bug in PPSSPP.

gucio321 commented 1 year ago

ref: