Skip to content

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

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

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

Conversation

@SAY-5

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

Copy link
Copy Markdown

get_mapping_symbols inserts an entry into disasm_modes for every code section, even when no $a/$t/$d mapping symbol points into it, so scan_instructions_internal got an empty slice from disasm_modes.get(..) instead of None and skipped the fallback_mappings path, then indexed the empty slice and panicked. This treats the empty case the same as a missing entry so it falls back to ARM mode. Fixes #352.

Signed-off-by: Sai Asish Y <say.apm35@gmail.com>
@SAY-5 SAY-5 force-pushed the fix-arm-empty-mapping-symbols branch from f16c187 to 2ff6adb Compare June 2, 2026 23:02
@SAY-5

SAY-5 commented Jun 17, 2026

Copy link
Copy Markdown
Author

Bumping this one. It's a small bounds guard for the ARM no-mapping-symbols panic, still applies cleanly on main. Happy to adjust if you'd like anything changed.

@LagoLunatic

Copy link
Copy Markdown
Collaborator

Bumping this one. It's a small bounds guard for the ARM no-mapping-symbols panic, still applies cleanly on main. Happy to adjust if you'd like anything changed.

Is there a reason we need 3 separate PRs for a one line crash fix?
#359 (mine)
#361 (yours)
#365 (yours)

@SAY-5

SAY-5 commented Jun 18, 2026

Copy link
Copy Markdown
Author

You're right, that's redundant, sorry for the noise. Your #359 fixes it, so I'll close both of mine. If the regression test and fixture from #365 are useful I'm happy to send them as a separate PR against your fix, otherwise feel free to ignore.

@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

2 participants