TLOU Part II Remastered: flexible-memory query underflows the startup code/data calculation #2883

Closed
opened 2026-10-10 17:25:52 +00:00 by eliasbruno124-dev · 1 comment
eliasbruno124-dev commented 2026-10-10 17:25:52 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by eliasbruno124-dev on 2026-10-10T17:25:52Z.


The Last of Us Part II Remastered, PPSA15508 / 01.002.000, reaches its original entry on Windows and then deliberately traps at original VA 0xd8f890 (int 0x41). No menu or gameplay is reached.

The complete runtime and relinker are pinned to 5edae35361e9b7f7061f28c6e80ed075312b8105, with the exact diagnostic exports from #2753 at 7a030e58abf2e83e94498c5c725d6684d6ebf0eb. Those exports throw; they do not implement SSL/Voice services. The loaded runtime paths were verified. The relevant DirectMemory/Export.cpp is byte-identical on main 57f96fd2b36563e8380c603a92b1ef0d9d3a6aa4, checked on October 10. The native observation was made on the pinned runtime above, not repeated on this later main.

A read-only breakpoint observation records this calculation before the trap:

  • The title-local budget provider at VA 0x1a9b210 returns 448 MiB.
  • sceKernelAvailableFlexibleMemorySize also returns 448 MiB.
  • The title subtracts both the available amount and its 10 MiB ALLOCATION_REQUIRED_PRX_FLEX_MEM allowance from the budget.
  • The unsigned result is 18446744073699065856, which exceeds its 146 MiB ALLOCATION_CODE_AND_DATA limit.

No return values, registers or original game files were changed. The separate ELF preparation preserves every represented payload and original PT_LOAD header; its normalization of absent section-table references is recorded locally. The trap occurs after native entry, rather than during preparation or missing-import resolution.

The current flexible counter accounts for explicit flexible mappings. A likely missing category is the loaded executable/PRX memory, but summing the Windows image size is not equivalent: it includes relinker scaffolding and padding. The original eboot and libc also contain PT_LOAD ranges with no R/W/X permissions. shadPS4's module mapping is a useful PS4 reference, not a PS5 measurement.

Does anyone have PS5 observations of configured/available flexible memory and virtual-query mappings before and after loading/unloading a PRX, or an existing implementation covering the initial executable charge? In particular, I need to establish which original segments consume this budget, page rounding, resident system-module usage and when a final unload releases the charge. The title's 10 MiB allowance alone does not establish a universal system reserve. I have not applied a subtraction constant or bypassed the assertion.

Prepared with AI assistance.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5793603168 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/2883). Originally posted by [eliasbruno124-dev](https://github.com/eliasbruno124-dev) on 2026-10-10T17:25:52Z. --- The Last of Us Part II Remastered, PPSA15508 / 01.002.000, reaches its original entry on Windows and then deliberately traps at original VA `0xd8f890` (`int 0x41`). No menu or gameplay is reached. The complete runtime and relinker are pinned to `5edae35361e9b7f7061f28c6e80ed075312b8105`, with the exact diagnostic exports from #2753 at `7a030e58abf2e83e94498c5c725d6684d6ebf0eb`. Those exports throw; they do not implement SSL/Voice services. The loaded runtime paths were verified. The relevant [`DirectMemory/Export.cpp`](https://github.com/boykopovar/AnyPS5/blob/57f96fd2b36563e8380c603a92b1ef0d9d3a6aa4/core/libs/prx/libkernel/DirectMemory/Export.cpp) is byte-identical on main `57f96fd2b36563e8380c603a92b1ef0d9d3a6aa4`, checked on October 10. The native observation was made on the pinned runtime above, not repeated on this later main. A read-only breakpoint observation records this calculation before the trap: - The title-local budget provider at VA `0x1a9b210` returns 448 MiB. - `sceKernelAvailableFlexibleMemorySize` also returns 448 MiB. - The title subtracts both the available amount and its 10 MiB `ALLOCATION_REQUIRED_PRX_FLEX_MEM` allowance from the budget. - The unsigned result is `18446744073699065856`, which exceeds its 146 MiB `ALLOCATION_CODE_AND_DATA` limit. No return values, registers or original game files were changed. The separate ELF preparation preserves every represented payload and original PT_LOAD header; its normalization of absent section-table references is recorded locally. The trap occurs after native entry, rather than during preparation or missing-import resolution. The current flexible counter accounts for explicit flexible mappings. A likely missing category is the loaded executable/PRX memory, but summing the Windows image size is not equivalent: it includes relinker scaffolding and padding. The original eboot and libc also contain PT_LOAD ranges with no R/W/X permissions. [shadPS4's module mapping](https://github.com/shadps4-emu/shadPS4/blob/811bfcd7d17ed8ae975c477d9ff28abc744e1ca8/src/core/module.cpp) is a useful PS4 reference, not a PS5 measurement. Does anyone have PS5 observations of configured/available flexible memory and virtual-query mappings before and after loading/unloading a PRX, or an existing implementation covering the initial executable charge? In particular, I need to establish which original segments consume this budget, page rounding, resident system-module usage and when a final unload releases the charge. The title's 10 MiB allowance alone does not establish a universal system reserve. I have not applied a subtraction constant or bypassed the assertion. Prepared with AI assistance.
oneandonlydean commented 2026-10-11 23:25:49 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-11T23:25:49Z.


Closing: fixed by #3713, which counts the loaded module segments against the flexible memory budget. Reopen if the title still reports Code and Data section is too large on current main.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6115087403 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/2883#issuecomment-6115087403). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-11T23:25:49Z. --- Closing: fixed by #3713, which counts the loaded module segments against the flexible memory budget. Reopen if the title still reports `Code and Data section is too large` on current main.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5#2883
No description provided.