Repository navigation
fix(libc): check asctime_s and ctime_s arguments as titles' libc.prx does - #12574
Conversation
rooklz
left a comment
There was a problem hiding this comment.
Independent run on macOS arm64 (Apple clang, ASan+UBSan, -fno-sanitize-recover). The harness builds the PR's SonyCrt.hpp into two separate hidden-visibility dylibs, a libc side and an Ampr side, so each one keeps its own handler slot as in the real modules. localtime_s is a host localtime_r shim. The driver is the PR's guest_crt asctime/ctime block, lines 158-269.
- Head
e1dbfa0753: OK under TZ unset, UTC, America/New_York and Pacific/Kiritimati. No sanitizer reports. main'sSonyCrt.hppwith the head test: RED atLibcViolation("asctime_s: bad argument"), the failure your body describes.- Gates: conventions clean,
git merge-treeagainst319621ba2eclean. Merging with #9935 conflicts only on theset_constraint_handler_sdebt line, as you said. pr_overlap also lists #9087, #9688, #10270 and #11621 on the same line, L81.
Mutants (20): the head test kills 14. Six survive:
| mutant | result |
|---|---|
asctime_s checks !time before the destination check |
survives (the null time is only tested with a valid destination) |
ctime_s drops size < 26 from the pre-conversion check and leaves it to SonyFormatAsctime |
survives (epoch converts, so the message and clearing are the same) |
tm_sec > 61 |
survives |
year < -1 |
survives |
snprintf(buffer, size, ...) restored |
survives on macOS only. Darwin accepts sizes ≥ 2^32, so it behaves the same here; your 2^32 case should catch it on UCRT |
ctime_s passes "asctime_s: bad argument" to SonyFormatAsctime |
survives. Only reachable with a year above 9999 after conversion, which you say wasn't compared, so I left it out |
The test-only diff below kills the first four. With it, head stays green under all four TZ settings.
- A null buffer with a null time, and size 0 with a null time, must both report the destination message.
ctime_ssize 25 with an unconvertible time must still reportctime_s: bad argumentbefore conversion.- Each field's limit is checked as low-1, low, high and high+1, which also pins
tm_sec60 and year 0/9999.
The diff also drops the duplicated known.tm_year = 70; line.
@@ -233,7 +233,6 @@ int main() {
known.tm_year = 57 - 1900;
Require(asctime_s_nid_postfix(text, sizeof(text), &known) == 0 && std::strcmp(text, "Thu Jan 1 00:00:00 0057\n") == 0);
known.tm_year = 70;
- known.tm_year = 70;
known.tm_mday = 32;
text[0] = 'x';
Require(sceAmprAsctimeS(text, sizeof(text), &known) == EINVAL && text[0] == '\0');
@@ -263,6 +262,28 @@ int main() {
Require(LibcViolation("ctime_s: bad argument"));
std::memset(libcText, 'x', sizeof(libcText));
Require(ctime_s_nid_postfix(libcText, std::size_t{1} << 32, &epoch) == 0 && std::strcmp(libcText, text) == 0 && libcText[26] == 'x');
+ Require(asctime_s_nid_postfix(nullptr, sizeof(text), nullptr) == EINVAL);
+ Require(LibcViolation("asctime_s: bad destination argument"));
+ text[0] = 'x';
+ Require(asctime_s_nid_postfix(text, 0, nullptr) == EINVAL && text[0] == 'x');
+ Require(LibcViolation("asctime_s: bad destination argument"));
+ const std::int64_t unconvertible = INT64_MAX;
+ libcText[0] = 'x';
+ Require(ctime_s_nid_postfix(libcText, 25, &unconvertible) == EINVAL && libcText[0] == '\0');
+ Require(LibcViolation("ctime_s: bad argument"));
+ struct FieldLimit { int GuestTm::*field; int low; int high; };
+ for (const FieldLimit limit : {FieldLimit{&GuestTm::tm_sec, 0, 60}, FieldLimit{&GuestTm::tm_min, 0, 59}, FieldLimit{&GuestTm::tm_hour, 0, 23},
+ FieldLimit{&GuestTm::tm_mday, 1, 31}, FieldLimit{&GuestTm::tm_mon, 0, 11}, FieldLimit{&GuestTm::tm_wday, 0, 6},
+ FieldLimit{&GuestTm::tm_yday, 0, 365}, FieldLimit{&GuestTm::tm_year, -1900, 9999 - 1900}}) {
+ for (const int value : {limit.low - 1, limit.low, limit.high, limit.high + 1}) {
+ GuestTm fields = known;
+ fields.*limit.field = value;
+ text[0] = 'x';
+ const bool valid = value >= limit.low && value <= limit.high;
+ Require(asctime_s_nid_postfix(text, sizeof(text), &fields) == (valid ? 0 : EINVAL));
+ Require(valid ? (g_libcConstraintCalls == 0 && std::strlen(text) == 25) : (text[0] == '\0' && LibcViolation("asctime_s: bad argument")));
+ }
+ }
set_constraint_handler_s_nid_postfix(previousLibcHandler);
Require(sceAmprCtimeS(text, 25, &epoch) == EINVAL);
text[0] = 'x';|
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.
|
|
Addressed the review's test hardening and the Linux module-isolation bug it exposed in The added cases require destination-error precedence when the time pointer is also null, short-capacity rejection before converting an unrepresentable timestamp, and each time field's low−1/low/high/high+1 boundaries. The duplicated year assignment is removed. Each of the four proposed incorrect implementation variants now fails at its intended assertion. The exact original Linux Qualification on Arch Linux7.2.9 / Ryzen9 7950X / GCC16.2.1 Release uses the actual libc/Ampr libraries: A separate ASan+UBSan harness builds the exact complete header into two DSOs, with two separately compiled translation units per DSO, and alternates setter/invoker translation units. It verifies sharing within each module, separation between modules and preservation of the sibling's handler across resets. The original header fails with “libc handler replaced by Ampr setter”; the fixed header passes. ELF symbol tables confirm the original state is UNIQUE/DEFAULT and fixed handler/mutex state is LOCAL. The full-runtime original failure and all expected negatives are preserved in the evidence. This module-state harness is separate from the actual-library CRT runs. No new Windows, macOS, title-library or physical-console measurement is claimed. Earlier Windows/title comparisons retain their original pins; the previously documented ctime paths after localtime conversion remain unmeasured. AI-assisted: yes (Codex). Evidence: source, raw tests, original failure, sanitizer isolation proof and mutant/restoration receipts, SHA-256 |
|
A Windows run with GCC 16: Windows 11 Pro 10.0.22631, i9-9900K, MSYS2 UCRT64 GCC 16.1.0, Release, this PR (
AI-assisted: yes (Claude Code) |
…does The libc.prx that titles ship (PPSA07923, PPSA05916) calls the constraint handler with EINVAL for every asctime_s and ctime_s violation. A null buffer, a size of 0 or a size above SIZE_MAX >> 3 reports "<name>: bad destination argument" and writes nothing; a size under 26, a null time or an out-of-range field, now also tm_yday outside 0 to 365, reports "<name>: bad argument" and stores '\0' in the first byte. The year is zero-padded, and a size from 2^32 up no longer makes snprintf write nothing while 0 is returned. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit e1dbfa0)
…nstraints (cherry picked from commit 6b2c351)
6b2c351 to
af6f89b
Compare
|
Current-main refresh — 2026-11-02. Published head Rebuilt actual libc/Ampr and selected tests from the final input tree. Linux-7.2.11-arch1-1-x86_64-with-glibc2.44, Ryzen 9 7950X, GCC 16.2.1, Ninja Release, BUILD_TESTING=ON. Focused Linux CPU qualification only. Older Windows/module/reference reports retain their original pins; no fresh Windows/macOS, SDK-module, console, title/GPU or speed claim. AI-assisted: yes (Codex). Evidence: https://github.com/JJenkx/AnyPS5/releases/download/linux-validation-20261023/math-six-main-a4eca-linux-extra10321-20261102.tar.gz; SHA-256 525ccb31a5d3d0f5adced5fda58818d8432f06c0afa7290139adb60ae6664b54. |
|
Windows check of the rebased head Setup: Windows 11 Enterprise 10.0.22621, Ryzen 9 5950X, WinLibs GCC 15.2.0 UCRT r7 (the CI toolchain), Release,
|
|
The failing
AI-assisted: yes. |
✅ AMD GPU test: passedPR head
Unstable on main (1, these also failed in recent main runs on this machine; not counted against this PR)Failing on main too (14, not counted against this PR)Passed on retry (1, failed in the parallel run, passed when re-run with a 360 s timeout; not counted against this PR)Validation IDs already present on main (4 IDs in 765 tests)Skipped (61)ReproduceAutomated build and test on a contributor's AMD machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
|
Windows check for the scheduled cross-platform review, at head Setup: Windows 11 Enterprise 22621, WinLibs GCC 15.2 UCRT, Release. The hosted Windows check does not run this test on pull requests.
AI-assisted: yes. |
✅ AMD GPU test: passedPR head
Unstable on main (3, these also failed in recent main runs on this machine; not counted against this PR)Failing on main too (14, not counted against this PR)Validated but not compared (1, not in the main baseline's validation pass)Validation IDs already present on main (4 IDs in 807 tests)Skipped (61)ReproduceAutomated build and test on a contributor's AMD machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
|
Refreshed to Fresh Linux CPU-only qualification: 3/3 runtime tests pass, zero skips; actual module/fixture builds, production NID patching, conventions/whitespace and MinGW syntax pass. Public-header auditing remains red on main and this head for exactly the same five missing WKSecurityOrigin declarations; this is recorded, with no header-green claim. The inherited older-main Windows allocation compile failure is fixed by already merged #15855; the fixing source is preserved here. Its successful Windows build is upstream evidence, not this branch’s Windows qualification. Final merge preview against main Immutable source/log/JUnit/control evidence, SHA-256 AI-assisted: yes (Codex). |
❌ AMD GPU test: failedPR head
Failing testsThis PR changes test files, so each failing test was also built and run on main with only the PR's test changes applied. ✅ there means the failure comes from the PR's other changes; ❌ means the test fails on main too, so this run does not show the PR caused it.
agc_graphics_profile_draw: Timeout (also failed when re-run alone), assertion and diagnosticsUnstable on main (7, these also failed in recent main runs on this machine; not counted against this PR)Failing on main too (10, not counted against this PR)Passed on retry (1, failed in the parallel run, passed when re-run with a 360 s timeout; not counted against this PR)Validation IDs already present on main (4 IDs in 805 tests)Skipped (71)ReproduceAutomated build and test on a contributor's AMD machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
|
On the AMD report above (head That run predates a fix. #16552, merged 2026-11-07 as AI-assisted: yes. |
Take main's out-of-line constraint handler declarations in SonyCrt.hpp and drop the per-module handler sentence main removed from the debt entry; the asctime_s and ctime_s changes are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Since main 3728cf4 libc and libSceAmpr share one constraint handler, so each sceAmprAsctimeS violation made while the recording handler is installed calls it too. Check each of those calls with its message instead of letting them inflate the next libc count. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…et-pubkey * origin/main: (153 commits) fix(tests): include cerrno in GuestPfs.cpp (boykopovar#19524) fix(libSceNet): return EAGAIN when a connect timeout runs out, as a PS5 does (boykopovar#18837) fix(libkernel): apply close-on-exec when opening files (boykopovar#18384) feat(libkernel_sys): implement sceKernelGetGenuineProsperoSystemSwVersion (boykopovar#17891) feat(libSceUsbStorage): mount a host folder as a USB volume with ANYPS5_STORAGE_FOLDER (boykopovar#17653) feat(libSceAjmi): implement inline and run batch aliases (boykopovar#16283) revert: socket error precedence coverage (boykopovar#14472) (boykopovar#19489) fix(libc): open a run report folder that refuses reading but allows search on macOS fix(libSceVdecCore): bound map block count, copy per block, and document fallbacks docs(libSceNpWebApi): record unmeasured pointer fallbacks in request and init exports fix(libSceAvPlayer): bound uri.length and document unmeasured pointer fallbacks perf(agc): reserve a physical core each for the draw committer and the draw finisher on Linux (boykopovar#19187) docs(libSceAudio3d): record unmeasured sceAudio3dCreateSpeakerArray pointer fallback fix(libc): check asctime_s and ctime_s arguments as titles' libc.prx does (boykopovar#12574) fix(libSceNpTrophy): reject unwritable handle and platinum id outputs feat(libSceDepth): answer handles that are not open as firmware 13.42 does (boykopovar#19260) feat(libSceSharePlay): answer before initialization as firmware 13.42 does (boykopovar#19129) feat(libSceNKWebKit): implement WTF PlayStation platform defaults (boykopovar#19322) feat(libSceIcu): implement UTF-16 search and memory primitives (boykopovar#10967) feat(libSceCommonDialog): answer clients without an implementation as firmware 13.42 does (boykopovar#19220) ...
…xtension-stack * origin/main: (561 commits) fix(tests): include cerrno in GuestPfs.cpp (boykopovar#19524) fix(libSceNet): return EAGAIN when a connect timeout runs out, as a PS5 does (boykopovar#18837) fix(libkernel): apply close-on-exec when opening files (boykopovar#18384) feat(libkernel_sys): implement sceKernelGetGenuineProsperoSystemSwVersion (boykopovar#17891) feat(libSceUsbStorage): mount a host folder as a USB volume with ANYPS5_STORAGE_FOLDER (boykopovar#17653) feat(libSceAjmi): implement inline and run batch aliases (boykopovar#16283) revert: socket error precedence coverage (boykopovar#14472) (boykopovar#19489) fix(libc): open a run report folder that refuses reading but allows search on macOS fix(libSceVdecCore): bound map block count, copy per block, and document fallbacks docs(libSceNpWebApi): record unmeasured pointer fallbacks in request and init exports fix(libSceAvPlayer): bound uri.length and document unmeasured pointer fallbacks perf(agc): reserve a physical core each for the draw committer and the draw finisher on Linux (boykopovar#19187) docs(libSceAudio3d): record unmeasured sceAudio3dCreateSpeakerArray pointer fallback fix(libc): check asctime_s and ctime_s arguments as titles' libc.prx does (boykopovar#12574) fix(libSceNpTrophy): reject unwritable handle and platinum id outputs feat(libSceDepth): answer handles that are not open as firmware 13.42 does (boykopovar#19260) feat(libSceSharePlay): answer before initialization as firmware 13.42 does (boykopovar#19129) feat(libSceNKWebKit): implement WTF PlayStation platform defaults (boykopovar#19322) feat(libSceIcu): implement UTF-16 search and memory primitives (boykopovar#10967) feat(libSceCommonDialog): answer clients without an implementation as firmware 13.42 does (boykopovar#19220) ... # Conflicts: # core/libs/prx/libSceLibreSsl3/AdditionalExports.cpp # docs/dev/debt/libSceLibreSsl3.md
…pp-messaging * origin/main: (901 commits) fix(tests): include cerrno in GuestPfs.cpp (boykopovar#19524) fix(libSceNet): return EAGAIN when a connect timeout runs out, as a PS5 does (boykopovar#18837) fix(libkernel): apply close-on-exec when opening files (boykopovar#18384) feat(libkernel_sys): implement sceKernelGetGenuineProsperoSystemSwVersion (boykopovar#17891) feat(libSceUsbStorage): mount a host folder as a USB volume with ANYPS5_STORAGE_FOLDER (boykopovar#17653) feat(libSceAjmi): implement inline and run batch aliases (boykopovar#16283) revert: socket error precedence coverage (boykopovar#14472) (boykopovar#19489) fix(libc): open a run report folder that refuses reading but allows search on macOS fix(libSceVdecCore): bound map block count, copy per block, and document fallbacks docs(libSceNpWebApi): record unmeasured pointer fallbacks in request and init exports fix(libSceAvPlayer): bound uri.length and document unmeasured pointer fallbacks perf(agc): reserve a physical core each for the draw committer and the draw finisher on Linux (boykopovar#19187) docs(libSceAudio3d): record unmeasured sceAudio3dCreateSpeakerArray pointer fallback fix(libc): check asctime_s and ctime_s arguments as titles' libc.prx does (boykopovar#12574) fix(libSceNpTrophy): reject unwritable handle and platinum id outputs feat(libSceDepth): answer handles that are not open as firmware 13.42 does (boykopovar#19260) feat(libSceSharePlay): answer before initialization as firmware 13.42 does (boykopovar#19129) feat(libSceNKWebKit): implement WTF PlayStation platform defaults (boykopovar#19322) feat(libSceIcu): implement UTF-16 search and memory primitives (boykopovar#10967) feat(libSceCommonDialog): answer clients without an implementation as firmware 13.42 does (boykopovar#19220) ...
…-quic * origin/main: (213 commits) fix(tests): include cerrno in GuestPfs.cpp (boykopovar#19524) fix(libSceNet): return EAGAIN when a connect timeout runs out, as a PS5 does (boykopovar#18837) fix(libkernel): apply close-on-exec when opening files (boykopovar#18384) feat(libkernel_sys): implement sceKernelGetGenuineProsperoSystemSwVersion (boykopovar#17891) feat(libSceUsbStorage): mount a host folder as a USB volume with ANYPS5_STORAGE_FOLDER (boykopovar#17653) feat(libSceAjmi): implement inline and run batch aliases (boykopovar#16283) revert: socket error precedence coverage (boykopovar#14472) (boykopovar#19489) fix(libc): open a run report folder that refuses reading but allows search on macOS fix(libSceVdecCore): bound map block count, copy per block, and document fallbacks docs(libSceNpWebApi): record unmeasured pointer fallbacks in request and init exports fix(libSceAvPlayer): bound uri.length and document unmeasured pointer fallbacks perf(agc): reserve a physical core each for the draw committer and the draw finisher on Linux (boykopovar#19187) docs(libSceAudio3d): record unmeasured sceAudio3dCreateSpeakerArray pointer fallback fix(libc): check asctime_s and ctime_s arguments as titles' libc.prx does (boykopovar#12574) fix(libSceNpTrophy): reject unwritable handle and platinum id outputs feat(libSceDepth): answer handles that are not open as firmware 13.42 does (boykopovar#19260) feat(libSceSharePlay): answer before initialization as firmware 13.42 does (boykopovar#19129) feat(libSceNKWebKit): implement WTF PlayStation platform defaults (boykopovar#19322) feat(libSceIcu): implement UTF-16 search and memory primitives (boykopovar#10967) feat(libSceCommonDialog): answer clients without an implementation as firmware 13.42 does (boykopovar#19220) ...
…x-set0-chain * origin/main: (62 commits) fix(tests): include cerrno in GuestPfs.cpp (boykopovar#19524) fix(libSceNet): return EAGAIN when a connect timeout runs out, as a PS5 does (boykopovar#18837) fix(libkernel): apply close-on-exec when opening files (boykopovar#18384) feat(libkernel_sys): implement sceKernelGetGenuineProsperoSystemSwVersion (boykopovar#17891) feat(libSceUsbStorage): mount a host folder as a USB volume with ANYPS5_STORAGE_FOLDER (boykopovar#17653) feat(libSceAjmi): implement inline and run batch aliases (boykopovar#16283) revert: socket error precedence coverage (boykopovar#14472) (boykopovar#19489) fix(libc): open a run report folder that refuses reading but allows search on macOS fix(libSceVdecCore): bound map block count, copy per block, and document fallbacks docs(libSceNpWebApi): record unmeasured pointer fallbacks in request and init exports fix(libSceAvPlayer): bound uri.length and document unmeasured pointer fallbacks perf(agc): reserve a physical core each for the draw committer and the draw finisher on Linux (boykopovar#19187) docs(libSceAudio3d): record unmeasured sceAudio3dCreateSpeakerArray pointer fallback fix(libc): check asctime_s and ctime_s arguments as titles' libc.prx does (boykopovar#12574) fix(libSceNpTrophy): reject unwritable handle and platinum id outputs feat(libSceDepth): answer handles that are not open as firmware 13.42 does (boykopovar#19260) feat(libSceSharePlay): answer before initialization as firmware 13.42 does (boykopovar#19129) feat(libSceNKWebKit): implement WTF PlayStation platform defaults (boykopovar#19322) feat(libSceIcu): implement UTF-16 search and memory primitives (boykopovar#10967) feat(libSceCommonDialog): answer clients without an implementation as firmware 13.42 does (boykopovar#19220) ...
…t-accept-state * origin/main: (177 commits) fix(tests): include cerrno in GuestPfs.cpp (boykopovar#19524) fix(libSceNet): return EAGAIN when a connect timeout runs out, as a PS5 does (boykopovar#18837) fix(libkernel): apply close-on-exec when opening files (boykopovar#18384) feat(libkernel_sys): implement sceKernelGetGenuineProsperoSystemSwVersion (boykopovar#17891) feat(libSceUsbStorage): mount a host folder as a USB volume with ANYPS5_STORAGE_FOLDER (boykopovar#17653) feat(libSceAjmi): implement inline and run batch aliases (boykopovar#16283) revert: socket error precedence coverage (boykopovar#14472) (boykopovar#19489) fix(libc): open a run report folder that refuses reading but allows search on macOS fix(libSceVdecCore): bound map block count, copy per block, and document fallbacks docs(libSceNpWebApi): record unmeasured pointer fallbacks in request and init exports fix(libSceAvPlayer): bound uri.length and document unmeasured pointer fallbacks perf(agc): reserve a physical core each for the draw committer and the draw finisher on Linux (boykopovar#19187) docs(libSceAudio3d): record unmeasured sceAudio3dCreateSpeakerArray pointer fallback fix(libc): check asctime_s and ctime_s arguments as titles' libc.prx does (boykopovar#12574) fix(libSceNpTrophy): reject unwritable handle and platinum id outputs feat(libSceDepth): answer handles that are not open as firmware 13.42 does (boykopovar#19260) feat(libSceSharePlay): answer before initialization as firmware 13.42 does (boykopovar#19129) feat(libSceNKWebKit): implement WTF PlayStation platform defaults (boykopovar#19322) feat(libSceIcu): implement UTF-16 search and memory primitives (boykopovar#10967) feat(libSceCommonDialog): answer clients without an implementation as firmware 13.42 does (boykopovar#19220) ...
…j2txt * origin/main: (794 commits) fix(tests): include cerrno in GuestPfs.cpp (boykopovar#19524) fix(libSceNet): return EAGAIN when a connect timeout runs out, as a PS5 does (boykopovar#18837) fix(libkernel): apply close-on-exec when opening files (boykopovar#18384) feat(libkernel_sys): implement sceKernelGetGenuineProsperoSystemSwVersion (boykopovar#17891) feat(libSceUsbStorage): mount a host folder as a USB volume with ANYPS5_STORAGE_FOLDER (boykopovar#17653) feat(libSceAjmi): implement inline and run batch aliases (boykopovar#16283) revert: socket error precedence coverage (boykopovar#14472) (boykopovar#19489) fix(libc): open a run report folder that refuses reading but allows search on macOS fix(libSceVdecCore): bound map block count, copy per block, and document fallbacks docs(libSceNpWebApi): record unmeasured pointer fallbacks in request and init exports fix(libSceAvPlayer): bound uri.length and document unmeasured pointer fallbacks perf(agc): reserve a physical core each for the draw committer and the draw finisher on Linux (boykopovar#19187) docs(libSceAudio3d): record unmeasured sceAudio3dCreateSpeakerArray pointer fallback fix(libc): check asctime_s and ctime_s arguments as titles' libc.prx does (boykopovar#12574) fix(libSceNpTrophy): reject unwritable handle and platinum id outputs feat(libSceDepth): answer handles that are not open as firmware 13.42 does (boykopovar#19260) feat(libSceSharePlay): answer before initialization as firmware 13.42 does (boykopovar#19129) feat(libSceNKWebKit): implement WTF PlayStation platform defaults (boykopovar#19322) feat(libSceIcu): implement UTF-16 search and memory primitives (boykopovar#10967) feat(libSceCommonDialog): answer clients without an implementation as firmware 13.42 does (boykopovar#19220) ... # Conflicts: # core/libs/prx/libSceLibreSsl3/CMakeLists.txt # docs/dev/debt/libSceLibreSsl3.md
…string-loaders * origin/main: (794 commits) fix(tests): include cerrno in GuestPfs.cpp (boykopovar#19524) fix(libSceNet): return EAGAIN when a connect timeout runs out, as a PS5 does (boykopovar#18837) fix(libkernel): apply close-on-exec when opening files (boykopovar#18384) feat(libkernel_sys): implement sceKernelGetGenuineProsperoSystemSwVersion (boykopovar#17891) feat(libSceUsbStorage): mount a host folder as a USB volume with ANYPS5_STORAGE_FOLDER (boykopovar#17653) feat(libSceAjmi): implement inline and run batch aliases (boykopovar#16283) revert: socket error precedence coverage (boykopovar#14472) (boykopovar#19489) fix(libc): open a run report folder that refuses reading but allows search on macOS fix(libSceVdecCore): bound map block count, copy per block, and document fallbacks docs(libSceNpWebApi): record unmeasured pointer fallbacks in request and init exports fix(libSceAvPlayer): bound uri.length and document unmeasured pointer fallbacks perf(agc): reserve a physical core each for the draw committer and the draw finisher on Linux (boykopovar#19187) docs(libSceAudio3d): record unmeasured sceAudio3dCreateSpeakerArray pointer fallback fix(libc): check asctime_s and ctime_s arguments as titles' libc.prx does (boykopovar#12574) fix(libSceNpTrophy): reject unwritable handle and platinum id outputs feat(libSceDepth): answer handles that are not open as firmware 13.42 does (boykopovar#19260) feat(libSceSharePlay): answer before initialization as firmware 13.42 does (boykopovar#19129) feat(libSceNKWebKit): implement WTF PlayStation platform defaults (boykopovar#19322) feat(libSceIcu): implement UTF-16 search and memory primitives (boykopovar#10967) feat(libSceCommonDialog): answer clients without an implementation as firmware 13.42 does (boykopovar#19220) ... # Conflicts: # core/libs/prx/libSceLibreSsl3/CMakeLists.txt # docs/dev/debt/libSceLibreSsl3.md
* origin/main: (55 commits) fix(tests): include cerrno in GuestPfs.cpp (boykopovar#19524) fix(libSceNet): return EAGAIN when a connect timeout runs out, as a PS5 does (boykopovar#18837) fix(libkernel): apply close-on-exec when opening files (boykopovar#18384) feat(libkernel_sys): implement sceKernelGetGenuineProsperoSystemSwVersion (boykopovar#17891) feat(libSceUsbStorage): mount a host folder as a USB volume with ANYPS5_STORAGE_FOLDER (boykopovar#17653) feat(libSceAjmi): implement inline and run batch aliases (boykopovar#16283) revert: socket error precedence coverage (boykopovar#14472) (boykopovar#19489) fix(libc): open a run report folder that refuses reading but allows search on macOS fix(libSceVdecCore): bound map block count, copy per block, and document fallbacks docs(libSceNpWebApi): record unmeasured pointer fallbacks in request and init exports fix(libSceAvPlayer): bound uri.length and document unmeasured pointer fallbacks perf(agc): reserve a physical core each for the draw committer and the draw finisher on Linux (boykopovar#19187) docs(libSceAudio3d): record unmeasured sceAudio3dCreateSpeakerArray pointer fallback fix(libc): check asctime_s and ctime_s arguments as titles' libc.prx does (boykopovar#12574) fix(libSceNpTrophy): reject unwritable handle and platinum id outputs feat(libSceDepth): answer handles that are not open as firmware 13.42 does (boykopovar#19260) feat(libSceSharePlay): answer before initialization as firmware 13.42 does (boykopovar#19129) test(libSceCamera): harden sceCameraGetAttribute and Report getter pointer tests fix(libSceCamera): return PARAM from sceCameraGetAttribute for unreadable attribute pointer fix(libc): build the category condition call and the call-trace test with Clang ...
…x-add1-chain-cert * origin/main: (794 commits) fix(tests): include cerrno in GuestPfs.cpp (boykopovar#19524) fix(libSceNet): return EAGAIN when a connect timeout runs out, as a PS5 does (boykopovar#18837) fix(libkernel): apply close-on-exec when opening files (boykopovar#18384) feat(libkernel_sys): implement sceKernelGetGenuineProsperoSystemSwVersion (boykopovar#17891) feat(libSceUsbStorage): mount a host folder as a USB volume with ANYPS5_STORAGE_FOLDER (boykopovar#17653) feat(libSceAjmi): implement inline and run batch aliases (boykopovar#16283) revert: socket error precedence coverage (boykopovar#14472) (boykopovar#19489) fix(libc): open a run report folder that refuses reading but allows search on macOS fix(libSceVdecCore): bound map block count, copy per block, and document fallbacks docs(libSceNpWebApi): record unmeasured pointer fallbacks in request and init exports fix(libSceAvPlayer): bound uri.length and document unmeasured pointer fallbacks perf(agc): reserve a physical core each for the draw committer and the draw finisher on Linux (boykopovar#19187) docs(libSceAudio3d): record unmeasured sceAudio3dCreateSpeakerArray pointer fallback fix(libc): check asctime_s and ctime_s arguments as titles' libc.prx does (boykopovar#12574) fix(libSceNpTrophy): reject unwritable handle and platinum id outputs feat(libSceDepth): answer handles that are not open as firmware 13.42 does (boykopovar#19260) feat(libSceSharePlay): answer before initialization as firmware 13.42 does (boykopovar#19129) feat(libSceNKWebKit): implement WTF PlayStation platform defaults (boykopovar#19322) feat(libSceIcu): implement UTF-16 search and memory primitives (boykopovar#10967) feat(libSceCommonDialog): answer clients without an implementation as firmware 13.42 does (boykopovar#19220) ... # Conflicts: # core/libs/prx/libSceLibreSsl3/CMakeLists.txt # docs/dev/debt/libSceLibreSsl3.md
…blic-key-dup * origin/main: (672 commits) fix(tests): include cerrno in GuestPfs.cpp (boykopovar#19524) fix(libSceNet): return EAGAIN when a connect timeout runs out, as a PS5 does (boykopovar#18837) fix(libkernel): apply close-on-exec when opening files (boykopovar#18384) feat(libkernel_sys): implement sceKernelGetGenuineProsperoSystemSwVersion (boykopovar#17891) feat(libSceUsbStorage): mount a host folder as a USB volume with ANYPS5_STORAGE_FOLDER (boykopovar#17653) feat(libSceAjmi): implement inline and run batch aliases (boykopovar#16283) revert: socket error precedence coverage (boykopovar#14472) (boykopovar#19489) fix(libc): open a run report folder that refuses reading but allows search on macOS fix(libSceVdecCore): bound map block count, copy per block, and document fallbacks docs(libSceNpWebApi): record unmeasured pointer fallbacks in request and init exports fix(libSceAvPlayer): bound uri.length and document unmeasured pointer fallbacks perf(agc): reserve a physical core each for the draw committer and the draw finisher on Linux (boykopovar#19187) docs(libSceAudio3d): record unmeasured sceAudio3dCreateSpeakerArray pointer fallback fix(libc): check asctime_s and ctime_s arguments as titles' libc.prx does (boykopovar#12574) fix(libSceNpTrophy): reject unwritable handle and platinum id outputs feat(libSceDepth): answer handles that are not open as firmware 13.42 does (boykopovar#19260) feat(libSceSharePlay): answer before initialization as firmware 13.42 does (boykopovar#19129) feat(libSceNKWebKit): implement WTF PlayStation platform defaults (boykopovar#19322) feat(libSceIcu): implement UTF-16 search and memory primitives (boykopovar#10967) feat(libSceCommonDialog): answer clients without an implementation as firmware 13.42 does (boykopovar#19220) ... # Conflicts: # docs/dev/debt/libSceLibreSsl3.md
…do-verify * origin/main: (794 commits) fix(tests): include cerrno in GuestPfs.cpp (boykopovar#19524) fix(libSceNet): return EAGAIN when a connect timeout runs out, as a PS5 does (boykopovar#18837) fix(libkernel): apply close-on-exec when opening files (boykopovar#18384) feat(libkernel_sys): implement sceKernelGetGenuineProsperoSystemSwVersion (boykopovar#17891) feat(libSceUsbStorage): mount a host folder as a USB volume with ANYPS5_STORAGE_FOLDER (boykopovar#17653) feat(libSceAjmi): implement inline and run batch aliases (boykopovar#16283) revert: socket error precedence coverage (boykopovar#14472) (boykopovar#19489) fix(libc): open a run report folder that refuses reading but allows search on macOS fix(libSceVdecCore): bound map block count, copy per block, and document fallbacks docs(libSceNpWebApi): record unmeasured pointer fallbacks in request and init exports fix(libSceAvPlayer): bound uri.length and document unmeasured pointer fallbacks perf(agc): reserve a physical core each for the draw committer and the draw finisher on Linux (boykopovar#19187) docs(libSceAudio3d): record unmeasured sceAudio3dCreateSpeakerArray pointer fallback fix(libc): check asctime_s and ctime_s arguments as titles' libc.prx does (boykopovar#12574) fix(libSceNpTrophy): reject unwritable handle and platinum id outputs feat(libSceDepth): answer handles that are not open as firmware 13.42 does (boykopovar#19260) feat(libSceSharePlay): answer before initialization as firmware 13.42 does (boykopovar#19129) feat(libSceNKWebKit): implement WTF PlayStation platform defaults (boykopovar#19322) feat(libSceIcu): implement UTF-16 search and memory primitives (boykopovar#10967) feat(libSceCommonDialog): answer clients without an implementation as firmware 13.42 does (boykopovar#19220) ... # Conflicts: # core/libs/prx/libSceLibreSsl3/CMakeLists.txt # docs/dev/debt/libSceLibreSsl3.md
…ic-transport-params * origin/main: (672 commits) fix(tests): include cerrno in GuestPfs.cpp (boykopovar#19524) fix(libSceNet): return EAGAIN when a connect timeout runs out, as a PS5 does (boykopovar#18837) fix(libkernel): apply close-on-exec when opening files (boykopovar#18384) feat(libkernel_sys): implement sceKernelGetGenuineProsperoSystemSwVersion (boykopovar#17891) feat(libSceUsbStorage): mount a host folder as a USB volume with ANYPS5_STORAGE_FOLDER (boykopovar#17653) feat(libSceAjmi): implement inline and run batch aliases (boykopovar#16283) revert: socket error precedence coverage (boykopovar#14472) (boykopovar#19489) fix(libc): open a run report folder that refuses reading but allows search on macOS fix(libSceVdecCore): bound map block count, copy per block, and document fallbacks docs(libSceNpWebApi): record unmeasured pointer fallbacks in request and init exports fix(libSceAvPlayer): bound uri.length and document unmeasured pointer fallbacks perf(agc): reserve a physical core each for the draw committer and the draw finisher on Linux (boykopovar#19187) docs(libSceAudio3d): record unmeasured sceAudio3dCreateSpeakerArray pointer fallback fix(libc): check asctime_s and ctime_s arguments as titles' libc.prx does (boykopovar#12574) fix(libSceNpTrophy): reject unwritable handle and platinum id outputs feat(libSceDepth): answer handles that are not open as firmware 13.42 does (boykopovar#19260) feat(libSceSharePlay): answer before initialization as firmware 13.42 does (boykopovar#19129) feat(libSceNKWebKit): implement WTF PlayStation platform defaults (boykopovar#19322) feat(libSceIcu): implement UTF-16 search and memory primitives (boykopovar#10967) feat(libSceCommonDialog): answer clients without an implementation as firmware 13.42 does (boykopovar#19220) ... # Conflicts: # core/libs/prx/libSceLibreSsl3/CMakeLists.txt # docs/dev/debt/libSceLibreSsl3.md
…printing * origin/main: (672 commits) fix(tests): include cerrno in GuestPfs.cpp (boykopovar#19524) fix(libSceNet): return EAGAIN when a connect timeout runs out, as a PS5 does (boykopovar#18837) fix(libkernel): apply close-on-exec when opening files (boykopovar#18384) feat(libkernel_sys): implement sceKernelGetGenuineProsperoSystemSwVersion (boykopovar#17891) feat(libSceUsbStorage): mount a host folder as a USB volume with ANYPS5_STORAGE_FOLDER (boykopovar#17653) feat(libSceAjmi): implement inline and run batch aliases (boykopovar#16283) revert: socket error precedence coverage (boykopovar#14472) (boykopovar#19489) fix(libc): open a run report folder that refuses reading but allows search on macOS fix(libSceVdecCore): bound map block count, copy per block, and document fallbacks docs(libSceNpWebApi): record unmeasured pointer fallbacks in request and init exports fix(libSceAvPlayer): bound uri.length and document unmeasured pointer fallbacks perf(agc): reserve a physical core each for the draw committer and the draw finisher on Linux (boykopovar#19187) docs(libSceAudio3d): record unmeasured sceAudio3dCreateSpeakerArray pointer fallback fix(libc): check asctime_s and ctime_s arguments as titles' libc.prx does (boykopovar#12574) fix(libSceNpTrophy): reject unwritable handle and platinum id outputs feat(libSceDepth): answer handles that are not open as firmware 13.42 does (boykopovar#19260) feat(libSceSharePlay): answer before initialization as firmware 13.42 does (boykopovar#19129) feat(libSceNKWebKit): implement WTF PlayStation platform defaults (boykopovar#19322) feat(libSceIcu): implement UTF-16 search and memory primitives (boykopovar#10967) feat(libSceCommonDialog): answer clients without an implementation as firmware 13.42 does (boykopovar#19220) ... # Conflicts: # core/libs/prx/libSceLibreSsl3/CMakeLists.txt # docs/dev/debt/libSceLibreSsl3.md
…nt-dup * origin/main: (794 commits) fix(tests): include cerrno in GuestPfs.cpp (boykopovar#19524) fix(libSceNet): return EAGAIN when a connect timeout runs out, as a PS5 does (boykopovar#18837) fix(libkernel): apply close-on-exec when opening files (boykopovar#18384) feat(libkernel_sys): implement sceKernelGetGenuineProsperoSystemSwVersion (boykopovar#17891) feat(libSceUsbStorage): mount a host folder as a USB volume with ANYPS5_STORAGE_FOLDER (boykopovar#17653) feat(libSceAjmi): implement inline and run batch aliases (boykopovar#16283) revert: socket error precedence coverage (boykopovar#14472) (boykopovar#19489) fix(libc): open a run report folder that refuses reading but allows search on macOS fix(libSceVdecCore): bound map block count, copy per block, and document fallbacks docs(libSceNpWebApi): record unmeasured pointer fallbacks in request and init exports fix(libSceAvPlayer): bound uri.length and document unmeasured pointer fallbacks perf(agc): reserve a physical core each for the draw committer and the draw finisher on Linux (boykopovar#19187) docs(libSceAudio3d): record unmeasured sceAudio3dCreateSpeakerArray pointer fallback fix(libc): check asctime_s and ctime_s arguments as titles' libc.prx does (boykopovar#12574) fix(libSceNpTrophy): reject unwritable handle and platinum id outputs feat(libSceDepth): answer handles that are not open as firmware 13.42 does (boykopovar#19260) feat(libSceSharePlay): answer before initialization as firmware 13.42 does (boykopovar#19129) feat(libSceNKWebKit): implement WTF PlayStation platform defaults (boykopovar#19322) feat(libSceIcu): implement UTF-16 search and memory primitives (boykopovar#10967) feat(libSceCommonDialog): answer clients without an implementation as firmware 13.42 does (boykopovar#19220) ... # Conflicts: # core/libs/prx/libSceLibreSsl3/CMakeLists.txt # docs/dev/debt/libSceLibreSsl3.md
Current-main integration — 2026-11-12. Head
079738c3f9merges mainc85dcfd005(063c638608) and adds one test commit.SonyCrt.hpp: main's out-of-line handler declarations are taken unchanged.docs/dev/debt/libc.md: this PR'sasctime_s/ctime_swording is kept, and the per-module handler sentence that main removed stays removed.sceAmprAsctimeSviolation made whileguest_crt's recording handler is installed now reaches that handler too. With the merge alone,guest_crtfailed at line 230 in 3 of 3 runs. The new commit checks each of those seven calls with its own message.guest_crt,guest_time_conversion,guest_mktimeandguest_time_extraspass in 3 of 3 runs.check_conventions.pypasses.Current-main integration — 2026-11-05. Exact head
b5644e160f5596522221f2df822a511fd4fe9e12retains previous public25ab50c9e70bdaced8575d715ae4422faf8de704and tested main6d173c1a19788ff69d43b3d0ca62833e312ef939as ancestors. The whole SonyCrt.hpp remains byte-identical to the previous qualified head, retaining time checks, padding/output behavior and ELF per-module hidden handler accessors. Actual libc and Ampr were rebuilt coherently.Linux x86-64, GCC16.2.1, Ninja Release: actual production modules and focused fixture owners rebuilt; 3/3 runtime tests pass, zero skips:
guest_crt,guest_time_conversion,guest_time_extras. Matching pinned main passes all25 selected baseline groups. Production NID patching, conventions/whitespace, and MinGW syntax forSonyCrt.hpppass.Public-header audit: failed on both pinned main and this head with the same five missing
WKSecurityOrigin*declarations (Create,CopyToString,CopyHost,CopyProtocol,GetPort), with no additional declaration errors. The failure is retained in the logs; no all-green header/full-suite claim is made. The concrete shared-main repair is #16010, exact head545e24b2ee2e549001421f7fc9f87ff801f3423c. Its independent qualification reports a green audit of 406 libraries/30,572 exports and two standalone units compiled by each of GCC and MinGW. A maintainer still needs to merge that repair and rerun the affected checks; this unmodified qualification tree is not relabelled header-green.The older-main Windows
DepthSurface::createSampleShadowallocation compile error is already corrected by merged #15855. This head contains that fix, and its DepthSurface.cpp/ImageMemory.hpp blobs match the fixing source. The fix’s hosted Windows build passed; that is attributed upstream evidence, not a Windows build/runtime result for this head. No duplicate AGC change was added. A final merge preview against newer main7ad9749ed0311cc91d69bc7c690d09c92b9d42d0is clean; qualification remains pinned to6d173c1a19788ff69d43b3d0ca62833e312ef939.Source/parent/provider/gitlink proofs, commands, raw logs, JUnit, hashes and known baseline failure. Historical platform, module-reference and performance reports below retain their original pins; no new Windows/macOS, SDK/physical-console, title/GPU or performance run.
Earlier pinned reports and the contribution template follow.
What
asctime_sandctime_s(libc, and libSceAmpr through the shared header) now check their arguments the way thelibc.prxthat titles ship does. Every violation calls the constraint handler withEINVAL, as the other_sfunctions in this module already do. Onmainthese two returnedEINVALwithout calling it.Measured rules, applied in this order (the handler's pointer argument is always null):
sizeof 0, or asizeaboveSIZE_MAX >> 3(from 2^61): message"asctime_s: bad destination argument"(orctime_s), and nothing is written.sizeunder 26, a null time, or a field out of range: message"asctime_s: bad argument", and'\0'is stored in the first byte.ctime_schecks the size before it converts the time.The field limits were already right, except that
tm_ydayoutside 0 to 365 is now rejected too. Two output fixes:0957), as plainasctimealready does.sizeof 2^32 up,mainreturned 0 without writing anything, becausesnprintfrejected the size. The text is now always written with a size of 26.Prior work. @ivica00 read these same rules from the disassembly of a title's
libc.prxin #8711, which they closed on 2026-10-21 after it needed a rebase. That PR also coveredstrtok_sand_Thrd_id. I found it only after opening this PR. The rules here were measured independently by running the titles' code, and they agree with that description: destinations of 0 or from 2^61 are rejected without writing, the destination is cleared on a later argument failure,EINVALwith a null pointer argument, and four-digit years.Fulfilled dependency: #9935 reached main through merged #10270, whose returning default-handler behavior is retained alongside this PR’s time-constraint rules. The earlier agreed order is fulfilled; the old debt-line conflict has been resolved without reverting main’s handler behavior.
Superseded (2026-11-12): main
3728cf4c67moved the Sony CRT handler state intoSonyCrt.cppand now shares it between libc and libSceAmpr. This PR takes main's version and no longer changes the handler accessors.Tested
Current-main refresh — 2026-11-04. Head
25ab50c9e70bdaced8575d715ae4422faf8de704merges main9ab6a281ea61c9e62a7eb07eb4cef8f19ede1c5cwhile retaining the prior public head as an ancestor. Main’s newer code, regression fixtures and debt entries are preserved alongside this topic.Linux x86-64, GCC16.2.1, Ninja Release: actual libc, libkernel and libSceAmpr CMake owners rebuilt coherently.
guest_crt,guest_time_conversion,guest_mktimeeach pass three consecutive runs (9 passes, zero skips). The same groups pass three times on pinned main. Public-header audit and conventions pass. Original licence-notice trailing whitespace is retained where present. The scoped recipe reuses frozen ZArchive/zstd providers; this is not a whole-project build. No new Windows, bundled-SDK, physical-console, title/GPU or FPS measurement is claimed; earlier reports retain their original pins.Exact source/parent proofs, per-branch patches/input manifests, build and CTest logs/JUnit, library/executable hashes and scoped CMake recipe, SHA-256
97a2377bc996be1690e8853e1ea090a98b5ed808bcc37a15a5cdada5c2e00845(download verified). AI-assisted: yes (Codex).Current-main integration — 2026-11-04. Head
cec91f3fe5e8f335b89b5dfd6ef16bdf073edbd6includes mainb11c7bf84f5d2f636ff60166cc3371bd071e24d5and preserves previous public commits and attribution/licence notices. Retains both ELF-hidden module-state accessors and the hardened time/constraint fixtures. Main’s returning default handler is preserved; older time-zone/mutant/module-isolation evidence keeps its original pins.Linux x86-64, GCC 16.2.1, Ninja Release, BUILD_TESTING=ON: rebuilt actual libc/Ampr and selected executables.
guest_crt,guest_time_conversion,guest_mktimeeach pass 3/3 (9 runtime passes, zero skips);public_headers, conventions and whitespace checks pass. Pinned main passes all 17 selected baseline groups 3/3 (51 passes) plus headers. Before/after dependency checks agree: 34 recursive trees and 31,551 tracked blobs, zero errors; the update=none QuickJS test262 corpus is explicitly excluded from these library inputs.Source/parent/gitlink proofs, library/test hashes, raw logs/JUnit and head-leased push receipts: qualification archive, SHA-256
7c347f620951ad6f39068740750949212c6412815da094a46a96eca1d15c8bbf(download verified). Older platform, stress, negative-control and reference reports retain their original pins; no new Windows/macOS, full-suite, SDK-module, console, title/GPU or performance claim. AI-assisted: yes (Codex).Earlier dated qualifications below retain their original source/platform pins.
Current-main refresh — 2026-11-02. Published head
af6f89bff19ee5d6d7f782db2163406a49a28327includes pinned maina4eca2a056bf3bbbec98ab42e9d28163e4ea9cb8. The reviewed SonyCrt.hpp header remains byte-identical to6b2c351, including both ELF hidden inline accessors. Current main’s qsort_s/bsearch_s qualifications remain alongside the time constraint debt. Older four-TZ/mutant/ASan module-isolation evidence keeps its original pins; it was not rerun here.Rebuilt actual libc/Ampr and selected tests from the final input tree.
guest_crt,guest_time_conversion,guest_mktimeeach pass three consecutive runs: 9 runtime passes, zero skips, plus public_headers. Conventions and whitespace pass. Source/input manifests, exact dependencies, library/test hashes, logs/JUnit and head-leased push receipts are attached. The same pinned main passes 18 selected groups three times (54 runtime passes) plus headers. All 34 recursive dependency trees/31,551 tracked blobs verify with zero errors; QuickJS’s update=none test262 corpus is explicitly excluded because it is not a library build input.Linux-7.2.11-arch1-1-x86_64-with-glibc2.44, Ryzen 9 7950X, GCC 16.2.1, Ninja Release, BUILD_TESTING=ON. Focused Linux CPU qualification only. Older Windows/module/reference reports retain their original pins; no fresh Windows/macOS, SDK-module, console, title/GPU or speed claim. AI-assisted: yes (Codex).
Evidence: https://github.com/JJenkx/AnyPS5/releases/download/linux-validation-20261023/math-six-main-a4eca-linux-extra10321-20261102.tar.gz; SHA-256 525ccb31a5d3d0f5adced5fda58818d8432f06c0afa7290139adb60ae6664b54.
Earlier dated qualifications below retain their recorded source/platform pins.
Windows 11, WinLibs GCC 15.2.0 UCRT r7, Release,
main319621ba2e.Native comparison: a scratch loader calls the titles' functions by NID next to this build's, with the same recording handler installed on both sides. It compares the return value, the handler's calls and error, and the buffer bytes. The messages were recorded from the titles' handler, and
guest_crtchecks that this build passes the same ones. Results are the same with thelibc.prxof PPSA07923 and of PPSA05916.mainasctime_s, 20,000 random calls: sizes from 0 to above 2^62, null pointers, out-of-range fieldsasctime_s, 108 chosen cases: each size boundary, null pointers, each field limit, yearsctime_s, 11 cases that fail before the time conversionThe titles'
ctime_scalls an import the loader can't provide once it converts a valid time, so thectime_spaths afterlocaltime_s, including a failinglocaltime_s, are not compared. The debt entry now says that, instead of "the console's exact checks are not verified".Regression:
guest_crtchecks each rule, the messages and the year padding. With the previousSonyCrt.hppit fails (LibcViolation("asctime_s: bad argument")).Test set:
guest_crt,guest_safe_errors,guest_bounds_checking,guest_qsort,guest_strftime,guest_mktimeandguest_localepass 3/3. The same holds merged with fix(libc): write the constraint message and return from the default handler #9935 (7aa063d91c) forguest_crt,guest_safe_errors,guest_bounds_checking,guest_qsortandguest_strftime. Conventions pass.Current Linux qualification and module-isolation correction — 2026-10-29
Addressed the review's test hardening and the Linux module-isolation bug it exposed in
6b2c35188f6706790c39f7ba302fc92148fbc7c6.The added cases require destination-error precedence when the time pointer is also null, short-capacity rejection before converting an unrepresentable timestamp, and each time field's low−1/low/high/high+1 boundaries. The duplicated year assignment is removed. Each of the four proposed incorrect implementation variants now fails at its intended assertion.
The exact original Linux
guest_crtalso revealed a real prerequisite issue: GNU_UNIQUE handler state coalesced across libc and Ampr, so installing Ampr's handler replaced libc's. The fix gives both internal inline state accessors (handler and mutex) ELF hidden visibility. They retain external inline linkage, sharing state across translation units inside one library while separating the libraries. Guest exports, NIDs and calling conventions are unchanged. The guard leaves PE/Mach-O visibility unchanged. No test counter resets were added to conceal unexpected callbacks.Qualification on Arch Linux7.2.9 / Ryzen9 7950X / GCC16.2.1 Release uses the actual libc/Ampr libraries:
guest_crtpasses three repetitions under each of UTC, America/New_York, Pacific/Kiritimati and TZ unset (12 passes). Four actual-header production mutants each fail the intended new assertion. Restoring the candidate passes the focused three-group set three times (9 checks) and restores identical libc and Ampr bytes. Public-header, conventions and whitespace checks pass.A separate ASan+UBSan harness builds the exact complete header into two DSOs, with two separately compiled translation units per DSO, and alternates setter/invoker translation units. It verifies sharing within each module, separation between modules and preservation of the sibling's handler across resets. The original header fails with “libc handler replaced by Ampr setter”; the fixed header passes. ELF symbol tables confirm the original state is UNIQUE/DEFAULT and fixed handler/mutex state is LOCAL. The full-runtime original failure and all expected negatives are preserved in the evidence. This module-state harness is separate from the actual-library CRT runs.
No new Windows, macOS, title-library or physical-console measurement is claimed. Earlier Windows/title comparisons retain their original pins; the previously documented ctime paths after localtime conversion remain unmeasured.
AI-assisted: yes (Codex).
Evidence: source, raw tests, original failure, sanitizer isolation proof and mutant/restoration receipts, SHA-256
4f0d32cb26b6dfbce3e6c5750990844bc3970fd9b43c3aef2d901ed1050a4477.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)