test(libkernel): initialize UTC for timezone assertion #12809

Closed
Sean09898 wants to merge 1 commit from upstream-pr/12809 into main
Sean09898 commented 2026-10-29 10:15:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Sean09898 on 2026-10-29T10:15:19Z.


Initialize UTC explicitly before the kernel timezone assertion to remove its dependency on the host timezone.

The test previously failed on Australia/Brisbane but passed when TZ=UTC0 was specified.

Validation:

  • Australia/Brisbane: passed
  • UTC0: passed
  • America/New_York: passed
  • Project conventions: passed

Development and debugging were AI-assisted; the resulting change was validated locally.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5066169730 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12809). Originally posted by [Sean09898](https://github.com/Sean09898) on 2026-10-29T10:15:19Z. --- Initialize UTC explicitly before the kernel timezone assertion to remove its dependency on the host timezone. The test previously failed on Australia/Brisbane but passed when TZ=UTC0 was specified. Validation: - Australia/Brisbane: passed - UTC0: passed - America/New_York: passed - Project conventions: passed Development and debugging were AI-assisted; the resulting change was validated locally.
rooklz commented 2026-10-29 10:26:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by rooklz on 2026-10-29T10:26:17Z.

Review: COMMENTED


I checked this on the host only (macOS arm64, clang ASan+UBSan). I didn't build guest_freebsd_clocks.

Harness. I copied HostZoneAt/HostDaylightAmount verbatim from Time.cpp L765-802 on main bc3e33f4e3 (POSIX branch) and computed the two sceKernelGettimezone values from them the same way L847 does. Then I ran the KernelTimezoneIsUtc assertion with and without this PR's SetTimeZone("UTC0"):

host TZ main this PR
UTC0, empty pass pass
Australia/Brisbane abort pass
America/New_York, Europe/London, Asia/Kolkata, Etc/GMT+12 abort pass
unset (host /etc/localtime = Europe/London) abort pass

So the failure in your report is real. On main the result depends on the zone of the machine running the test, because this check runs first in main(), before anything calls SetTimeZone. With your line it passes in every zone I tried.

Overlap. pr_overlap --branch reports a conflict with #12660 (JJenkx, opened earlier today, one review). That PR deletes KernelTimezoneIsUtc for the same reason. The two PRs are alternative fixes for one bug, and only one of them should merge. I'd go with deleting the check. With UTC forced, it tests nothing that TimezoneReportsTheStandardOffsetAndDaylightAmount doesn't already cover: RequireTimezone("UTC0", 0, 0) at L304, and the null-pointer 0x8002000e row at L309. Also, the name KernelTimezoneIsUtc no longer describes the behaviour since fabe448517 changed sceKernelGettimezone to report the host zone (debt libkernel.md L42).

Checks: git merge-tree vs main is clean and check_conventions --head passes. CI here only ran intake (the build lanes were skipped).

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5696197347 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12809#pullrequestreview-5696197347). Originally posted by [rooklz](https://github.com/rooklz) on 2026-10-29T10:26:17Z. **Review:** COMMENTED --- I checked this on the host only (macOS arm64, clang ASan+UBSan). I didn't build `guest_freebsd_clocks`. **Harness.** I copied `HostZoneAt`/`HostDaylightAmount` verbatim from `Time.cpp` L765-802 on main bc3e33f4e3 (POSIX branch) and computed the two `sceKernelGettimezone` values from them the same way L847 does. Then I ran the `KernelTimezoneIsUtc` assertion with and without this PR's `SetTimeZone("UTC0")`: | host `TZ` | main | this PR | |---|---|---| | `UTC0`, empty | pass | pass | | `Australia/Brisbane` | abort | pass | | `America/New_York`, `Europe/London`, `Asia/Kolkata`, `Etc/GMT+12` | abort | pass | | unset (host `/etc/localtime` = Europe/London) | abort | pass | So the failure in your report is real. On main the result depends on the zone of the machine running the test, because this check runs first in `main()`, before anything calls `SetTimeZone`. With your line it passes in every zone I tried. **Overlap.** `pr_overlap --branch` reports a conflict with #12660 (JJenkx, opened earlier today, one review). That PR deletes `KernelTimezoneIsUtc` for the same reason. The two PRs are alternative fixes for one bug, and only one of them should merge. I'd go with deleting the check. With UTC forced, it tests nothing that `TimezoneReportsTheStandardOffsetAndDaylightAmount` doesn't already cover: `RequireTimezone("UTC0", 0, 0)` at L304, and the null-pointer `0x8002000e` row at L309. Also, the name `KernelTimezoneIsUtc` no longer describes the behaviour since fabe448517 changed `sceKernelGettimezone` to report the host zone (debt `libkernel.md` L42). Checks: `git merge-tree` vs main is clean and `check_conventions --head` passes. CI here only ran intake (the build lanes were skipped).

Pull request closed

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!12809
No description provided.