mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-26 00:05:58 +03:00
[GH-ISSUE #1582] [Debug] <Critical> scalar_memory.cpp: unreachable code #540
Labels
No labels
Bloodborne
bug
contributor wanted
documentation
enhancement
frontend
good first issue
help wanted
linux
pull-request
question
release
verification progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/shadPS4#540
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @gandalth on GitHub (Nov 23, 2024).
Original GitHub issue: https://github.com/shadps4-emu/shadPS4/issues/1582
Originally assigned to: @polybiusproxy on GitHub.
CUSA16194 DIRT 5: shadps4 crashes on startup with this debug information:
[Render.Vulkan] vk_pipeline_cache.cpp:CompileModule:405: Compiling cs shader 0xf69de71c
[Render.Vulkan] vk_pipeline_cache.cpp:CompileModule:405: Compiling cs shader 0x394fe8e8
[Core] stubs.cpp:CommonStub:42: Stub: scePthreadSetaffinity (nid: bt3CTBKmGyI) called, returning zero to 0x90068ae09
[Render.Vulkan] vk_pipeline_cache.cpp:CompileModule:405: Compiling cs shader 0x385a8cf7
[Render.Vulkan] vk_pipeline_cache.cpp:CompileModule:405: Compiling cs shader 0x385a8cf7
[Debug] <Critical> scalar_memory.cpp:operator():49: Unreachable code!
Trace/breakpoint trap
@polybiusproxy commented on GitHub (Nov 23, 2024):
https://github.com/shadps4-emu/shadPS4/blob/main/src/shader_recompiler/frontend/translate/scalar_memory.cpp#L41
Can you debug what is
smrdat the time of the unreachable?@gandalth commented on GitHub (Nov 23, 2024):
Sure, happy to help!
Would I have to recompile in order to do that? My current build (on Linux Debian Testing) has been compiled like this:
cmake .. -DCMAKE_C_COMPILER=clang-19 -DCMAKE_CXX_COMPILER=clang++-19 -DENABLE_DISCORD_RPC=OFF -DENABLE_QT_GUI=ON
Can I use gdb to debug or do you recommend something else?
@polybiusproxy commented on GitHub (Nov 23, 2024):
I'm not quite knowledgeable about Linux, but I'd recommend setting up Visual Studio Code and GDB to make debugging (and most things over all) easier
@gandalth commented on GitHub (Nov 23, 2024):
I recompiled with -DCMAKE_BUILD_TYPE=DEBUG and used ddd/gdb to add a breakpoint.
In ddd, shadps4 receives a SEGFAULT in GAME_MainThread before I reach the UNREACHABLE().
The last smrd I see before that (but does not lead to the UNREACHABLE()) has offset=0, imm=1, count=8.
@polybiusproxy commented on GitHub (Nov 23, 2024):
That one looks correct, but I'm interested in the one that leads to the UNREACHABLE()
@gandalth commented on GitHub (Nov 23, 2024):
This one leads to UNREACHABLE():
smrd.offset = 1
smrd.imm = 0
smrd.count = 4
SQ_SRC_LITERAL = 255
@gandalth commented on GitHub (Nov 27, 2024):
@polybiusproxy : can I help more in finding how we got into the incorrect smrd?
I can easily add more debug output in my local copy.
@Hermiten commented on GitHub (Feb 12, 2025):
Hello, I'm closing this one, this is now tagged with a label and also present in the wiki:
https://github.com/shadps4-emu/shadPS4/wiki/III.-Guide-of%EF%BC%9CCritical%EF%BC%9Elog
Thanks you