Fix 32-bit/64-bit address space handling#58
Open
nobody-Justheader wants to merge 1 commit intohuntergregal:masterfrom
Open
Fix 32-bit/64-bit address space handling#58nobody-Justheader wants to merge 1 commit intohuntergregal:masterfrom
nobody-Justheader wants to merge 1 commit intohuntergregal:masterfrom
Conversation
- Changed memory address variables from unsigned long to uint64_t - Updated format specifiers to use SCNx64/PRIx64 for portability - Added explicit cast to off_t for fseeko() calls - Removed known issue from README.md This fix ensures the 32-bit variant can properly handle 64-bit memory addresses when running in a 64-bit userspace, resolving the documented limitation with cross-architecture compatibility.
|
您发送的邮件我已经收到,我会尽快查看并回复 。
//明夕何夕0x00 ***@***.***
|
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
This PR fixes the documented issue where the 32-bit variant of mimipenguin fails in 64-bit userspace due to inadequate handling of 64-bit address spaces.
Problem
The original code used
unsigned longfor memory addresses which caused truncation when 32-bit binaries ran in 64-bit userspace with addresses beyond 4GB.Solution
uint64_tfor all memory addresses (guaranteed 64-bit)SCNx64,PRIx64)(off_t)cast forfseeko()callsTesting
Impact
Resolves the "Known Issues" limitation documented in README about 32-bit variant failing in 64-bit userspace.