Repository navigation
fix(libkernel): initialize the full local-time conversion state - #2157
Merged
oneandonlydean merged 1 commit intoOct 10, 2026
Merged
Conversation
9 tasks done
authurtabo-byte
force-pushed
the
fix/kernel-localtime-state
branch
from
October 9, 2026 17:28
310d453 to
3bd202e
Compare
authurtabo-byte
force-pushed
the
fix/kernel-localtime-state
branch
from
October 9, 2026 22:45
3bd202e to
035b675
Compare
oneandonlydean
added a commit
to oneandonlydean/AnyPS5
that referenced
this pull request
Oct 10, 2026
oneandonlydean
added a commit
to oneandonlydean/AnyPS5
that referenced
this pull request
Oct 10, 2026
|
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.
|
SleglJan
pushed a commit
to SleglJan/AnyPS5
that referenced
this pull request
Oct 10, 2026
…caltime-state fix(libkernel): initialize the full local-time conversion state
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
sceKernelConvertLocaltimeToUtcwrites an 8-byteKernelTimezoneinto an output that the PS5 guest libc uses as a 16-byteKernelTimesec. Itswest_secanddst_secfields at offsets 8 and 12 remain uninitialized. In MiniGolf, IL2CPP's time-zone initialization repeatedly searches backward through dates and eventually spends a CPU core in calendar conversion, leaving startup black when loading an existing save.Use
KernelTimesecand initialize its timestamp and both offset fields. This keeps the existing UTC-only policy and matches the state returned bysceKernelConvertUtcToLocaltime.Evidence comes from the title's converted SDK libc: its
mktimepasses the fourth argument at stack offset -0x40 and reads its offset fields at -0x38 and -0x34, comparing them with the corresponding state returned by UTC-to-local conversion. An 8-byte write cannot initialize those fields.Tested
Rebased onto main
f8c2f072. Fresh independent Windows Release build:guest_freebsd_clockspasses (0.45 seconds); conventions pass.Windows 11, WinLibs GCC, Release. Extended
guest_freebsd_clockswith poisoned conversion states, surrounding guards, epoch/negative/2026/post-2038 timestamps, round trips and optional null outputs. The test fails with the previous implementation and passes with this change.MiniGolf previously remained on its initial black frame with its SaveData worker continuously running calendar conversion. With this change and the separate startup/rendering fixes in the integration build, the same saved data loads and startup advances to the publisher logo. No save files were removed or modified to bypass the issue.
Conventions and whitespace checks pass. Linux, other titles and hardware comparison were not run.
Checklist
main; no other open PR implements the same fix