fix(libc): keep the guest %ld argument 64-bit in the err test #7905

Merged
Rajkamalcode merged 1 commit from upstream-pr/7905 into main 2026-10-19 16:24:33 +00:00
Rajkamalcode commented 2026-10-19 13:07:51 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Rajkamalcode on 2026-10-19T13:07:51Z.


What

guest_err fails on Windows at the vwarnx stack and floating arguments check: the expected output is prog: 1 2 3 4 5 6 7 8 2.50 s 123456789, but the formatted value came out as 2048822856981 = 0x1DD075BCD15. The guest is LP64, so its %ld consumes a full 64-bit vararg slot; the test passed 123456789L and on LLP64 hosts (Windows) a long is 32 bits wide, which leaves the upper half of that slot undefined (the low half was 0x75BCD15 = 123456789 in the observed output). The argument is now 64-bit, which is a no-op on LP64 hosts.

Tested

Windows 11 (22635.5305), MinGW-w64 GCC 15.2.0 (winlibs), Ryzen 5 5600X, based on main f3bb6a4f8. With GuestErr.cpp at main, ctest --test-dir build -R '^guest_err$' fails with failed: vwarnx stack and floating arguments (exit 0xc0000409); with this change it passes. An earlier run of the whole guest family was 501/502 on this machine, the single failure being guest_kernel_sys, since fixed by #7824 (merged).

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4921429384 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7905). Originally posted by [Rajkamalcode](https://github.com/Rajkamalcode) on 2026-10-19T13:07:51Z. --- ### What `guest_err` fails on Windows at the `vwarnx stack and floating arguments` check: the expected output is `prog: 1 2 3 4 5 6 7 8 2.50 s 123456789`, but the formatted value came out as `2048822856981` = `0x1DD075BCD15`. The guest is LP64, so its `%ld` consumes a full 64-bit vararg slot; the test passed `123456789L` and on LLP64 hosts (Windows) a `long` is 32 bits wide, which leaves the upper half of that slot undefined (the low half was `0x75BCD15` = 123456789 in the observed output). The argument is now 64-bit, which is a no-op on LP64 hosts. ### Tested Windows 11 (22635.5305), MinGW-w64 GCC 15.2.0 (winlibs), Ryzen 5 5600X, based on `main` f3bb6a4f8. With `GuestErr.cpp` at `main`, `ctest --test-dir build -R '^guest_err$'` fails with `failed: vwarnx stack and floating arguments` (exit 0xc0000409); with this change it passes. An earlier run of the whole guest family was 501/502 on this machine, the single failure being `guest_kernel_sys`, since fixed by #7824 (merged). ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
Sign in to join this conversation.
No reviewers
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!7905
No description provided.