Repository navigation
fix(libSceSystemService): report the host time zone and summer time - #5084
Conversation
5848256 to
84728d6
Compare
|
Checked the diff against the references cited (Apollo, GoldHEN, SharpProspero), built and ran the area's ctest on Linux, and confirmed |
adriadam10
left a comment
There was a problem hiding this comment.
The full Build (Windows) fails on this head: guest_system_service_time_zone aborts with 0xc0000409 (run 38609296408, windows job, ctest #890). A rerun of the job fails the same way, and main does not have this failure. The log does not say which check aborts.
The runner's system time zone is UTC, while this was tested on a CET machine. Could you reproduce it with the system time zone set to UTC and see which Require fails? Likely candidates are the CET-1CEST rows (default summer time rules of the CRT versus tm_isdst) or the offset calculation in HostTimeZone(). Linux is fine on our side: the test fails without the Export.cpp change and passes with it.
|
Windows run of this head alone, merged onto
Cause: libc.prx's static initializer ( The same The
Verdict: on a CET host the change works in Explorer, and the tests and the non-GPU suite pass. The Windows Build failure reproduces with a UTC system time zone: the failing check is the AI-assisted (Claude Code). |
|
Follow-up: the --- a/core/libs/prx/libSceSystemService/Export.cpp
+++ b/core/libs/prx/libSceSystemService/Export.cpp
@@ -60,7 +60,14 @@ ConsoleTimeZone HostTimeZone() {
const auto localSeconds = date.time_since_epoch() + std::chrono::hours{local.tm_hour} + std::chrono::minutes{local.tm_min} + std::chrono::seconds{local.tm_sec};
const auto offset = std::chrono::duration_cast<std::chrono::minutes>(localSeconds - std::chrono::seconds{now});
const bool summer = local.tm_isdst > 0;
- return {static_cast<int>(offset.count()) - (summer ? 60 : 0), summer};
+#if defined(_WIN32)
+ long daylightBias = 0;
+ _get_dstbias(&daylightBias);
+ const int summerMinutes = summer ? static_cast<int>(-daylightBias / 60) : 0;
+#else
+ const int summerMinutes = summer ? 60 : 0;
+#endif
+ return {static_cast<int>(offset.count()) - summerMinutes, summer};
}No new include is needed (
Only " The Windows job in AI-assisted (Claude Code). |
|
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.
|
84728d6 to
b36bbe9
Compare
|
Thanks @screamm for finding the cause and testing the change, and @adriadam10 for the review. I applied screamm's Windows 11 (26200), WinLibs GCC 15.2.0 r7, Release, this machine's zone W. Europe with summer time in effect:
Not covered: a run on the runner itself. The Linux code path did not change. AI-assisted (Claude Code). |
|
Follow-up on head
Not checked: the runner itself (its Windows job is still "skipping" on this head), a real Written with Claude Code assistance (validation by a subagent, reviewed in this session). |
adriadam10
left a comment
There was a problem hiding this comment.
Re-checked head b36bbe9: the _get_dstbias change removes the dependency on the system zone for the CET-1CEST row, matching the reproductions by @screamm and the gdb run in the PR. Built and ran the area's ctest on Linux (47/47), and guest_system_service_time_zone still fails without the Export.cpp change. Debt entry covers both platforms. Merging once the full Build is green.
sceSystemServiceParamGetInt answered 0 for the time zone (parameter 4) and summer time (parameter 5), so the console looked set to UTC while libSceRtc and libc convert local time with the host's zone. Titles add the time zone in minutes and 60 more minutes when summer time is 1 to UTC to get the local time (Apollo, GoldHEN's frame logger). Both now follow the host's local time zone: summer time is whether it is in effect, and the time zone is the current offset east of UTC less the summer time shift while it is. On Windows that shift is the C runtime's own summer time bias (_get_dstbias), the one localtime_s applied, not a fixed 60 minutes. The UCRT reads the system zone when libc.prx loads and keeps that zone's bias after TZ is set later, so on a host whose system zone has no summer time (the CI runner's UTC) a TZ of CET-1CEST shifted by 0 and the time zone came out as 0. The cause and the change are screamm's, from the review. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Rebased onto current |
b36bbe9 to
ff1de91
Compare
What
sceSystemServiceParamGetIntanswered 0 for the time zone (parameter 4) and for summer time (parameter 5), so every title saw a console set to UTC without summer time. libSceRtc and libc convert local time with the host's zone (#4939 is about the same offsets), so a title got two different local times.Titles compute the local time from these two values as UTC + (time zone + 60 × summer time) minutes. Sources for that rule:
Both values now follow the host's local time zone at the moment of the call:
tm_isdstof the host's local time.localtime_s/localtime_r, as libSceRtc's does, soTZis honoured.Prospero Explorer (PPSA99109) shows both on its System information > Console tab (#5071). On a Windows host in Central European Summer Time:
main:Time zone UTC+00:00,Summer time no.UTC+01:00,yes.Not changed here: libkernel's
sceKernelConvertUtcToLocaltime,sceKernelConvertLocaltimeToUtcandsceKernelGettimezonestill use UTC. TheSceKernelTimesecfields need their own references, so they are left for a follow-up. The debt file records this.Tested
Windows 11 (26200), WinLibs GCC 15.2.0 r7, Release, on
mainae244d5:New
guest_system_service_time_zonetest (TZset through the CRT, asGuestRtcdoes):IST-5:30gives 330/0,BRT+3gives -180/0,UTC0gives 0/0.CET-1CESTgives a time zone of 60 and a summer time that matches the CRT's owntm_isdstat that moment. glibc and the Windows CRT both apply their default summer time rules to it.CET-1CEST,0/0,J365/25(summer time all year) gives 60/1.It aborts on
mainand passes with the change.guest_system_service,guest_system_service_languageandpatched_librariespass. Full ctest: 1053/1053 passed (8 skipped on this machine).tools/check_conventions.py --base upstream/mainpasses.Prospero Explorer (PPSA99109, catalog 01.000.000), relinked: I reached the Console tab with
APS5_PAD_INPUT_FILE(steps in Prospero Explorer (PPSA99109) #5071) and captured it withAPS5_DUMP_FRAMES. The rows changed as shown above.Rebased onto
mainffa2a6e without conflicts (head 84728d6), then tested again onmainc496fd5:guest_system_service,guest_system_service_languageandguest_system_service_time_zonepass. Full ctest: 1088/1088 passed (8 skipped on this machine).guest_system_service,guest_system_service_languageandguest_system_service_time_zonepass, including the all-year summer time zone.guest_math,agc_driver_depth_compare_copyandguest_socket_read_writefail the same way onmainb868383 without any of them in this setup.After the review (CI's Windows runner has a UTC system zone): the summer time shift on Windows is now the C runtime's own bias (
_get_dstbias), as screamm found and tested. Head b36bbe9 onmainff23657:guest_system_service_time_zone,guest_system_service,guest_system_service_language,guest_system_service_path_boundaryandpatched_librariespass.GetTimeZoneInformationwith a zeroed structure (UTC, no summer time) andTZunset at start: the previous head aborts in theCET-1CESTrow, this head passes. WithTZat start unset,UTC0,CET-1CEST,M3.5.0,M10.5.0/3orEST5EDT, the test passes under both zones.main92e5041 together with fix(libkernel): refuse a loopback TCP connect at once on Windows #5141: the four tests above andpatched_librariespass. Full ctest: 1263/1273; the ten failures (nineagc_*tests andguest_socket_read_write) fail the same way onmain92e5041 alone in this setup.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)🤖 Generated with Claude Code