Skip to content

Conversation

@roberts-pumpurs
Copy link
Member

No description provided.

@roberts-pumpurs roberts-pumpurs changed the base branch from main to base-v0.12.2 January 8, 2026 08:27
The Section enum was using `usize` for virtual addresses, which caused
truncation on 32-bit platforms (e.g., RISC-V zkVM). VM addresses like
MM_RODATA_START (0x100000000) would truncate to 0 when cast to 32-bit
usize, causing "Access violation in program section" errors.

This change distinguishes between:
- VM addresses (always u64 per sBPF spec)
- Host addresses (native usize for memory pointers)

Changes:
- Section::Owned and Section::Borrowed now use u64 for VM addresses
- parse_ro_sections() uses u64 for lowest_addr, highest_addr, ro_slices
- Removed truncating `as usize` casts for MM_RODATA_START
- Updated test assertions to compare map() results with `as u64`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants