fix(libc): support large collate transform results #1708
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1708"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by gdrosa on 2026-10-08T17:13:50Z.
What
collate<char>::do_transformcurrently throws for every input of 4095 characters or more because the returned guest string requires a large-allocation header. Support those results by keeping the original allocation pointer immediately before a 32-byte-aligned data pointer, and reject allocation-size overflow before reading input or allocating. Small strings use the existing path.The string layout and guest deallocation rule come from #885. Alignment and allocation padding follow Microsoft STL (
_Allocate_manually_vector_aligned); they have not been measured on a PS5, which remains recorded in TechnicalDebt. Embedded NULs and non-C locales still throw.The change modifies only
LocaleSupport.cpp, its existingGuestCollate.cppregression, and the corresponding debt entry. It is independent of #1614 and #1498.Tested
Windows x64, Release, portable MinGW-w64 GCC 15.2.0, CMake/Ninja from the existing virtualenv, SPIRV-Tools disabled:
Ubuntu 24.04 x86-64, GCC 13.3.0, CMake/Ninja in a virtualenv: 37/37 libc CTests pass with zero skips. The same standalone allocation PoC passes all 576 cases and 76,769 checks; the test-registration check passes. Independent Linux run checks out the exact contribution commit
caba31b731272bafb854a5d6e2134657c6ef1d5e. Guard-page input checks in that PoC run on Windows; Linux uses the canary checks.Console execution and in-game behavior are unverified.
Complete Windows project build and
libstarget completed. Full CTest: 457 tests, 0 failures, 0 errors, 0 skips.Checklist
main; no other open PR implements the same functionsImported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-08T17:26:32Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)docs/dev/TechnicalDebt.mdL341docs/dev/TechnicalDebt.mdL341docs/dev/TechnicalDebt.mdL341-342docs/dev/TechnicalDebt.mdL341Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-09T08:55:20Z.
Closing: no title is shown to reach
collate::transformwith 4095 or more characters on main, where it throws today, and the allocation layout is unmeasured on PS5. Please reopen with the title ID and the log line if one does.Pull request closed