RPCS3 / rpcs3

PlayStation 3 emulator and debugger
https://rpcs3.net/
GNU General Public License v2.0
15.43k stars 1.92k forks source link

Debug Builds of Games with "liblv2dbg" Crash on launch/Debugging flag #5632

Open Hopefullyidontgetbanned opened 5 years ago

Hopefullyidontgetbanned commented 5 years ago

Debug Builds of games like Need For Speed Rivals & LittleBigPlanet can be modified to boot on rpcs3, however they crash on as soon as they are booted. however i presume a certain flag in RPCS3 is missing that allows it to boot or not. This flag i assume is not defined which leads to rpcs3 crashing.

For Example in an E3 Debug Build of NFS Rivals or in earlier builds of LBP3, Booting Leads to a Memory Access violation. but has a warning that when looked into further reveals whats wrong.

U {PPU[0x1000000] Thread (main_thread) [0x01f9061c]} sys_prx TODO: _sys_prx_register_module() E {PPU[0x1000000] Thread (main_thread) [0x0024bea0]} sys_mmapper: sys_mmapper_allocate_address(size=0x40000000, flags=0x20f, alignment=0x10000000, alloc_addr=*0xd0040910) E {PPU[0x1000000] Thread (main_thread) [0x0024c0bc]} sys_mmapper: sys_mmapper_allocate_address(size=0x10000000, flags=0x40f, alignment=0x10000000, alloc_addr=*0xd0040914) E {PPU[0x1000000] Thread (main_thread) [0x01fd3e0c]} 'sys_fs_open' failed with 0x80010006 : CELL_ENOENT, “/dev_hdd0/data/bootflag.dat” [1] S {PPU[0x1000000] Thread (main_thread) [0x01f909ac]} PPU: LLVM: Loaded module v1-tane-qE8TVP0gG3c290GV4ptCCn-000000-sandybridge.obj S {PPU[0x1000000] Thread (main_thread) [0x01f909ac]} sys_prx: Loaded module: /dev_flash/sys/external/liblv2dbg_for_cex.sprx U {PPU[0x1000000] Thread (main_thread) [0x02070038]} HLE TODO: Unimplemented syscall sys_dbg_disable_floating_point_enabled_exception -> CELL_OK S {PPU[0x1000000] Thread (main_thread) [0x01f909ac]} PPU: LLVM: Loaded module v1-tane-2my7r7Nd2rncZdtcuT9g60-000000-sandybridge.obj S {PPU[0x1000000] Thread (main_thread) [0x01f909ac]} PPU: LLVM: Loaded module v1-tane-aaAKL9HJRRAWFrQ1t0vFNk-000000-sandybridge.obj S {PPU[0x1000000] Thread (main_thread) [0x01f909ac]} sys_prx: Loaded module: /dev_flash/sys/external/libnet.sprx S {PPU[0x1000000] Thread (main_thread) [0x01f909ac]} PPU: LLVM: Loaded module v1-tane-ZAhea3FFhakpfMa36ZvaNx-000000-sandybridge.obj S {PPU[0x1000000] Thread (main_thread) [0x01f909ac]} sys_prx: Loaded module: /dev_flash/sys/external/librtc.sprx F {PPU[0x1000000] Thread (main_thread) [0x0102eda4]} MEM: Access violation reading location 0x10000000

RPCS3.log

What The Log is referring to: https://www.psdevwiki.com/ps3/Bootflag.dat

Essentially its a flag that sets liblvl2dbg as enabled or disabled. This is used for debug builds however final or close to final builds don't check it.

Specs & Config:

RPCS3 v0.0.6-7788-4c593959 Alpha | HEAD | Windows Intel(R) Xeon(R) CPU E5-2680 0 @‍ 2.70GHz | 8 Threads | 31.96 GiB RAM | AVX GPU: GeForce GTX 1060 6GB (417.71)

CPU Settings PPU ‍Decoder: ‍ ‍ ‍ ‍ ‍Recompiler ‍(LLVM) SPU ‍Decoder: ‍ ‍ ‍Recompiler ‍(ASMJIT) SPU ‍Lower ‍Thread ‍Priority: ‍ ‍ ‍ ‍ ‍[ ‍] SPU ‍Loop ‍Detection: ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍[x] Thread ‍Scheduler: ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍[x] SPU ‍Threads: ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍Auto SPU ‍Block ‍Size: ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍Safe Accurate ‍xfloat: ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍[ ‍] Force ‍CPU ‍Blit: ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍[ ‍] Lib ‍Loader: ‍ ‍Load ‍liblv2.sprx ‍only GPU Settings Renderer: ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍Vulkan Aspect ‍ratio: ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍16:9 Resolution: ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍1280x720 Resolution ‍Scale: ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍400 Resolution ‍Scale ‍Threshold: ‍ ‍ ‍ ‍ ‍16 Write ‍Color ‍Buffers: ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍[ ‍] Anisotropic ‍Filter: ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍16 Frame ‍Limit: ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍Off Disable ‍Async ‍Shaders: ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍[ ‍] Disable ‍Vertex ‍Cache: ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍[ ‍]

elad335 commented 5 years ago

Can those builds run on CEX console or DEX/DECR only?

Hopefullyidontgetbanned commented 5 years ago

But the behavior in rpcs3 leads to a fatal error that crashes the emulator instead of process. Which doesn't occur on a real ps3.

Hopefullyidontgetbanned commented 5 years ago

This flag isn't set in rpcs3 when dex firmwares are installed

Futile2Code commented 5 years ago

Here is RPCS3.log and TTY.log that you requested, same game (Need for Speed Most Wanted 2012 debug E3), except with render set to null this time. (THIS TIME, I BOOTED IT AS IS, NO MODIFICATIONS IN ITS FOLDER) From TTY.log the game loads everything just fine except to the last point where it loads some ui music and stuff, and it just stops there. If I turn on renderer (OpenGL), the same lines (in yellow). Did RPCS3 run out of "CPU"? running the game reveals that all of my threads are used at 100% when the game starts. It should be a problem with RPCS3 (or hardware, if you will). RPCS3.log TTY.log Going to fully check that there are no software issues before going to upgrade my laptop. Thanks and take your time.

Hopefullyidontgetbanned commented 5 years ago

Here is RPCS3.log and TTY.log that you requested, same game (Need for Speed Most Wanted 2012 debug E3), except with render set to null this time. (THIS TIME, I BOOTED IT AS IS, NO MODIFICATIONS IN ITS FOLDER) From TTY.log the game loads everything just fine except to the last point where it loads some ui music and stuff, and it just stops there. If I turn on renderer (OpenGL), the same lines (in yellow). Did RPCS3 run out of "CPU"? running the game reveals that all of my threads are used at 100% when the game starts. It should be a problem with RPCS3 (or hardware, if you will). RPCS3.log TTY.log Going to fully check that there are no software issues before going to upgrade my laptop. Thanks and take your time.

mmm, mind sharing where you got that prototype so i can test it

Futile2Code commented 5 years ago

LoL I thought it was Hopefullyidontgetbanned@users.noreply.github.com Anyway I resent it to your other email, check it I am mbayou75@gmail.com I'm not active on Discord much btw.

Hopefullyidontgetbanned commented 5 years ago

ok so i have everything i need to test it more.

for this experiment i'll use LittleBigPlanet 3 Alpha (note: i changed the title id of LBP3 for ease but it doesn't really matter, the og title id was BCES01663) Also Replace the Alpha's files with these: https://www.mediafire.com/file/z4w1i1dxdf6vmfv/LBP3+Alpha+RPCS3+Files.rar

Logs: https://cdn.discordapp.com/attachments/542097115778777138/565370110739611649/Alpha_Logs.7z

Before patching the eboot i get this:

E LDR: Invalid or unsupported file format: D:/Miscellenous/RPCS3_VHDD/dev_hdd0/game/ALPA01663/USRDIR/EBOOT.BIN

After using unfself and make_fself to patch the eboot to work with rpcs3 it does boot but fails with a file-system mounting error

E {PPU[0x1000001] Thread (bringup) [0x010d3e0c]} 'sys_fs_open' failed with 0x80010006 : CELL_ENOENT, “/dev_hdd0/data/bootflag.dat” [2] E {PPU[0x1000000] Thread (main_thread) [0x0085f5bc]} cellSysutil: Filesystem mounting failed. (8001002b) F {PPU[0x1000000] Thread (main_thread) [0x00d64fa4]} MEM: Access violation reading location 0x8

However the tty is much more interesting: After buckets initialised 27008kb remaining After memory init 27008kb remaining LittleBigPlanet revision 'LBP3_r513946' build date:Sep 7 2013time: 01:53:10 argc 1 argv[0]=/dev_hdd0/game/ALPA01663/USRDIR/EBOOT.BIN sys_crash_dump_set_user_log_area 0 = 0 Available user heap: 27656192 bytes of 185597952 bytes This executable was built with BUILD_MODE = 3 ( 0.001) INIT Initing NetworkBootstrap... [ OK ] 0.038s, 27008kb remaining ( 0.039) INIT Initing PRX... [ OK ] 0.232s, 27008kb remaining ( 0.271) INIT Initing PerformanceTimers... [ OK ] 0.000s, 27008kb remaining ( 0.271) INIT Initing CrashReport... InitCrashReport: Checking for crash report uploader wwsCrashReportPlatformInit: failed to get core dump params. Error 0x8001042c. Make sure lv2 exception handler and core dump feature are enabled in XMB wwsCrashReportCreate: platform-specific initialization failed CRASHREPORT Error - Creating CrashReport object : WWS_CRASHREPORT_ERROR_DENIED [Fail]SetWantQuit() at 0.30 0.30 UpdateWantQuit() at 0.30 0.30 closing... Closing PerformanceTimers... 0.000 s @ 0.302 Closing PRX... 0.000 s @ 0.302 Closing NetworkBootstrap... 0.000 s @ 0.302 We waited 5.02 seconds for the quit event!

Essentially we can avoid this by deleting wws_crashreport_uploader.self see the bootflag for liblvl2dbg is set in both cex and dex according to the dev wiki but only libsysmodule.sprx has this flag on CEX.

Basically This executable was built with BUILD_MODE = 3 means that the game was compiled with the debug config.

RPCS3 behaves correctly when using CEX however it does not work correctly when using DEX firmwares. I assume because RPCS3 is HLE that this could be added to CEX. I'm Sorry If this was word salady but i can try to explain it more if you guys need specifics. A lot of these are assumptions from what i can gather.

elad335 commented 5 years ago

After some research if /dev_hdd0/data/bootflag.dat is found, the game loads liblv2dbg_for_dex.sprx instead of liblv2dbg_for_cex.sprx, which is only found in debug firmware. So its an issue about unsupported debug firmwares.

Hopefullyidontgetbanned commented 5 years ago

After some research if /dev_hdd0/data/bootflag.dat is found, the game loads liblv2dbg_for_dex.sprx instead of liblv2dbg_for_cex.sprx, which is only found in debug firmware. So its an issue about unsupported debug firmwares.

could something like that be implemented on supported firmwares on rpcs3 for convenience?

Stretchsterz commented 4 years ago

Is there any fix for LBP3 r513946 now?