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.4k stars 2.19k forks source link

Segmentation fault with Vulkan backend in raspberry pi OS bullseye 32 bit on raspberry pi 4/400 #19612

Open fac3l3ss79 opened 2 weeks ago

fac3l3ss79 commented 2 weeks ago

Game or games this happens in

None

What area of the game / PPSSPP

When I execute version 1.18 I get a segmentation fault with Vulkan backend in raspberry pi OS bullseye 32 bit on raspberry pi4/400. Vulkan backend works as expected with 1.17.1

What should happen

PPSSPP should work with Vulkan backend

Logs

No response

Platform

Raspberry Pi

Mobile device model or graphics card (GPU)

Raspberry pi 4/400

PPSSPP version affected

1.18.1

Last working version

1.17.1

Graphics backend (3D API)

Vulkan

Checklist

hrydgard commented 2 weeks ago

can you run it in gdb and get a stack trace of the crash?

fac3l3ss79 commented 2 weeks ago

can you run it in gdb and get a stack trace of the crash?

Thread 1 "PPSSPPSDL" received signal SIGSEGV, Segmentation fault. 0x00000000 in ?? () (gdb) backtrace

0 0x00000000 in ?? ()

1 0x00518d14 in VulkanContext::CreateInstance(VulkanContext::CreateInfo const&)

()

2 0x00590cc4 in SDLVulkanGraphicsContext::Init(SDL_Window&, int, int, int, int, int, std::__cxx11::basic_string<char, std::char_traits, std::allocator >) ()

3 0x00058174 in main ()

(gdb)

hrydgard commented 2 weeks ago

hm that's very early, maybe extension loading or something... any chance you can do a debug build so we can get line numbers?

fac3l3ss79 commented 1 week ago

hm that's very early, maybe extension loading or something... any chance you can do a debug build so we can get line numbers?

Here you go:

(gdb) backtrace

0 0x00000000 in ?? ()

1 0xaa52e418 in ?? ()

from /lib/arm-linux-gnueabihf/libVkLayer_khronos_validation.so

2 0x00883334 in VulkanContext::CreateInstance (this=0x1d339e0, info=...)

at /home/pi/ppsspp/Common/GPU/Vulkan/VulkanContext.cpp:286

3 0x00977b84 in SDLVulkanGraphicsContext::Init (this=0x1d18140,

window=@0xbeffe3dc: 0x1d35b68, x=536805376, y=536805376, w=960, h=544, 
mode=268447777, error_message=0xbeffe3c4)
at /home/pi/ppsspp/SDL/SDLVulkanGraphicsContext.cpp:73

4 0x0096f928 in main (argc=1, argv=0xbefff2b4)

at /home/pi/ppsspp/SDL/SDLMain.cpp:1394

(gdb)

hrydgard commented 1 week ago

That means it crashes here:

https://github.com/hrydgard/ppsspp/blob/0f50225f8e741c2f8a3a35cfd3b7d9dd0a16b34f/Common/GPU/Vulkan/VulkanContext.cpp#L286

vkGetPhysicalDeviceProperties2(physical_devices_[i], &props2);

, and since the callstack starts with 0000000, it likely called a null pointer.

However, we do guard that call with an if, on line 277, so this is really strange.

Actually, I see on the line before that the Khronos validation layer is active. That should mean that you made a debug build. Maybe the validation layers don't work correctly on 32-bit ARM for some reason? It's probably not a well tested platform.

Try to make a release build insetad. It will also run much faster.

./b.sh --release