Skip to content

Fix ARM panic when a code section has no mapping symbols#365

Closed
SAY-5 wants to merge 1 commit into
encounter:mainfrom
SAY-5:fix-arm-empty-mapping-symbols-352
Closed

Fix ARM panic when a code section has no mapping symbols#365
SAY-5 wants to merge 1 commit into
encounter:mainfrom
SAY-5:fix-arm-empty-mapping-symbols-352

Conversation

@SAY-5

@SAY-5 SAY-5 commented Jun 13, 2026

Copy link
Copy Markdown

report generate panics with an index-out-of-bounds in the ARM arch when a code section contains bytes but is not covered by any mapping symbol (no $a/$t/$d and no STT_FUNC pointing into it). get_mapping_symbols inserts an entry for every code section, so disasm_modes.get(&section_index) returns Some(empty_slice) and the fallback_mappings path is skipped, leaving mapping_symbols[first_mapping_idx] to index an empty slice.

Treat an empty mapping-symbol list the same as a missing one so the ARM fallback is used. Added a test with a minimal ARM object (from the issue) whose .text has only STT_SECTION and external symbols; it panics before this change and passes after.

Fixes #352

Signed-off-by: Sai Asish Y <say.apm35@gmail.com>
@SAY-5

SAY-5 commented Jun 18, 2026

Copy link
Copy Markdown
Author

Closing as duplicate of #359. Happy to contribute the test fixture separately if wanted.

@SAY-5 SAY-5 closed this Jun 18, 2026
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.

Panic: index out of bounds in ARM arch process_code on ELF with no STT_FUNC symbols in .text

1 participant