Fix startup crash on malformed patch indexes and short CONTENT_ID#4171
Fix startup crash on malformed patch indexes and short CONTENT_ID#4171kernelstub wants to merge 1 commit intoshadps4-emu:mainfrom
Conversation
Prevents early startup termination triggered by `CUSA03173` when auto-patch repositories contain missing/unreadable/malformed `files.json` by adding open checks, JSON parse exception handling, and basic schema validation. Hardens `param.sfo` handling by guarding `CONTENT_ID` substring extraction and falling back to `TITLE_ID` , and by catching invalid `sdk_ver` parsing from `PUBTOOLINFO` with a safe fallback to firmware version. PS: Now it has Clang formating that @georgemorallis asked for, also remove exceptions for Pubtoolinfo and added logging for all cases for `CONTENT_ID`
|
You can close the other PR, this is the correct one. |
|
Looks good to me to merge, tests passed as well^^ |
|
Has this actually been checked against the issues it's supposed to fix? |
Hi, yes @georgemoralis took a look at it, he just said clang formatting was left. Also yes issue fixes crash on the specific game. If you need anything else I can do it at my break, im at work currently. @georgemoralis aderfe ta issues exoum ftiaxti,einaiready gia merge, opote thes kanto^^ |
you didn't answer the question |
I will later then ^^ I'll go in depth for you on how the atoms are built and protons also and from there ill build it up to explaining what this fixes after i find the logs the guy sent on discord ✌🏻 |
|
https://discord.com/channels/1080089157554155590/1258386683691274361/1485075159965634671 |
|
@georgemoralis has a bit of a track record of accepting/making questionable changes, that's why I took a separate look in the first place. While I can't speak about the patching code, the changes you're making to param.sfo parsing are aiming to solve a problem that doesn't exist. There's no point in them unless you can prove otherwise. |
|
This is mostly about making the parsing safer rather than fixing one specific title. For For I don’t have specific retail titles that consistently trigger this it’s mostly edge cases with inconsistent metadata but this makes the code handle those safely. |
|
The important context here is that the param.sfo fields are set by the PS4 SDK (or for homebrew, the OpenOrbis Toolchain). In both cases, our current code works, and we don't need this extra validation. |
|
I'll let other devs weigh in here, but I don't see a point in changing how we handle those fields. |
Prevents early startup termination triggered by
CUSA03173when auto-patch repositories contain missing/unreadable/malformedfiles.jsonby adding open checks, JSON parse exception handling, and basic schema validation.Hardens
param.sfohandling by guardingCONTENT_IDsubstring extraction and falling back toTITLE_ID, and by catching invalidsdk_verparsing fromPUBTOOLINFOwith a safe fallback to firmware version.PS: Now it has Clang formating that @georgemoralis asked for, also remove exceptions for Pubtoolinfo and added logging for all cases for
CONTENT_IDOther PR #4159 I opened from wrong account.