Repository navigation
stat: truncate >32-bit inodes; lift: re-decode missed function entries - #51
Merged
kanapitsas merged 2 commits intoNov 20, 2026
Merged
Conversation
Sealed macOS system volumes (such as /System/Library/Fonts) commonly have 64-bit inode numbers. Returning EOVERFLOW from 32-bit stat broke guests that ignore stat errors when probing system fonts; truncating st_ino to 32 bits matches how games use it as an opaque identifier.
… out of step Non-PIC code sections with inline jump tables (such as Bink in Portal Stories: Mel's valve_avi.so and engine.so) can push objdump's linear sweep out of step across the next function entry. Add LazyInsns._resync to decode a short image-relative window from a missed entry while keeping already-decoded instructions.
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.
Summary
Two small runtime and lifter fixes extracted from the Portal Stories: Mel bring-up that benefit all games:
runtime/stat.c: truncatest_inovalues wider than 32 bits instead of failing 32-bitstatwithEOVERFLOW. Files on macOS's sealed system volume (e.g./System/Library/Fonts/*) routinely carry 64-bit inodes; guests only treatst_inoas an identifier, and an ignoredstatfailure leftFS_fopenwith an uninitialized 64-bit file size (leading to a 1.8 GB OOM).tools/lift.py: addLazyInsns._resync()to re-decode a short image-relative window from a missed function entry whenobjdump's linear sweep went out of step before it (for example after inline jump tables in non-PIC code sections), while keeping already-decoded instructions.Testing
tests/filesystem_checks.h(32-bit__xstaton/System/Library/Fonts/Helvetica.ttc) andtests/test_lift.py(LazyInsnsResync).make checkand./build/abi-smoke-ubsanpass on macOS Apple Silicon (223 Python tests, 265 C checks).