Repository navigation
fix(libc): use the default heap for an executable without process parameters - #6713
karimibrahim07 wants to merge 2 commits into
Conversation
…ameters An ELF without a PT_SCE_PROCPARAM segment, such as a ps5-payload-dev SDK program, had no .procpar section after relinking, so the first allocation stopped with "process metadata is missing; relink the executable". The Windows relinker now writes a .procpar section that records no parameters for such an ELF, and the application heap registers its default allocator when it finds that record. An executable without any .procpar section still gets the relink message.
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
|
Cross-validation on Windows 11 Pro 26220, WinLibs MinGW-w64 GCC 15.2, PR head
Not checked: Quake or other SDK payloads (not available here), Linux, macOS, a full-tree build, the full non-GPU suite. Written with Claude Code assistance (validation by a subagent, reviewed in this session). |
|
This PR now conflicts with AI-assisted (Claude Code). |
MarcZX10
left a comment
There was a problem hiding this comment.
Follow-up after manually merging this PR with #10947: your debt entry for application heap without process parameters combines cleanly, but the resulting libc debt file contains contradictory nearbyintf observations (this branch says it uses the host rounding mode; #10947 records console measurements where MXCSR controlled rounding) and two _Thrd_sleep entries with differing behavior. Please coordinate with #10947’s author and reconcile those existing notes against their evidence while preserving both PRs’ distinct implementation notes. Update the overlap/dependency checklist as needed. I found no conflicting code paths; this request is limited to making the combined documentation accurate and non-duplicated.
|
@karimibrahim07 @MarcZX10 From #10947's side there is nothing to reconcile: it does not touch Written with AI assistance (Claude Code). I ran the git checks above on my Windows 11 machine. |
|
Closing as landed through #11979, which carried both commits of this branch onto AI-assisted: yes |
What
An ELF without a
PT_SCE_PROCPARAMsegment, such as a ps5-payload-dev SDK program, got no.procparsection when relinked for Windows. Its first allocation then stopped withapplication heap: process metadata is missing; relink the executable. That message exists for executables relinked before the section was introduced, but such an ELF has no process parameters to record.WindowsPePatchernow writes a.procparsection with address 0 and size 0 when the ELF has noPT_SCE_PROCPARAMsegment.ApplicationProcessParameters_nid_no_patchreturns null for that record.ApplicationHeapInitialize_nid_no_patch(nullptr)registers the heap's existing default allocator, as it already does for an all-null replacement table.sceKernelGetProcParamreturns null.An executable without any
.procparsection still gets the relink message (application_heap_stats_missingstill passes). On the console such a program runs inside its launcher's process, whose parameters aren't modelled. The new entry indocs/dev/debt/libc.mdrecords that, and that Linux output still stops for such an ELF.Tested
Windows 11 Pro (26300), WinLibs GCC 15.2.0 r7, Ninja Release,
BUILD_TESTING=ON, onmain5d9dcc42d:application_heap_without_parameterstest (Windows). It installs the zero record, then allocates throughoperator newandposix_memalign(64-byte aligned) without calling the test's allocator table, and frees. With the runtime change reverted, it fails withapplication heap: process parameters exceed the image.windows_process_parametersrelinker test. An ELF withoutPT_SCE_PROCPARAMconverted with--windowshas exactly one.procparsection, and it holds zeros. Onmainthere is none.application_heap*tests pass, 9 of 9. The full suite passes, 1302 tests (oneconventions_function_bodiesshard timed out while the machine was busy and passed alone).python tools/check_conventions.py --base origin/mainpasses.The Quake homebrew (#6698), with #6697, #6702, #6707 and this PR, relinked with
--windows --to-intel --trap-sdk-syscall-stubs --registry:application heap: process metadata is missing; relink the executable._startthen expects the launcher'spayload_args_t. How AnyPS5 could start such programs is the design question in Running ps5-payload-dev SDK homebrew (websrv: Quake, Mari0): proposal, with a working Quake prototype #6712, where a prototype that also patches the entry reaches Quake's main menu.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)