Catch BinaryReader exceptions when reading stack variable parameters#1079
Merged
Conversation
DebuggerInfoTable::getInfoForLLIL/MLIL/HLILCalls each compute a stack offset (stack pointer + parameter slot) and pass it to BinaryReader::Seek + ReadPointer to display the parameter value next to a call. If the computed offset is outside the BinaryView, ReadPointer throws ReadException, and since the caller is invoked from a Qt slot with no handler up the stack, the unhandled exception terminates the process. Wrap each read in a try/catch and skip the parameter entry on failure. The widget renders the remaining parameters normally instead of taking down the process. Fix applies to all three IL variants since they share the identical pattern. Fixes #1068 Fixes BINARYNINJA-47 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 task
xusheng6
added a commit
that referenced
this pull request
May 14, 2026
Per review feedback on #1079: catch the specific exception type (BinaryNinja::ReadException) instead of catch (...) when the throwing API is known. The original catch-all could swallow unrelated failures and hide intent. ReadException is the only exception BinaryReader::Seek and ReadPointer raise here. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
DebuggerInfoTable::getInfoFor{LLIL,MLIL,HLIL}Callseach compute a stack offset (stack pointer + parameter slot) and pass it toBinaryReader::Seek+ReadPointerto show the parameter value next to a call in the info table. If the computed offset falls outside the BinaryView's range,ReadPointerthrowsReadException. The caller is invoked from a Qt slot with no handler up the stack, so the unhandled C++ exception terminates the process.Fixes #1068
Fixes BINARYNINJA-47
Sentry context
bn.edition=Free,release=binaryninja@5.3.9434— same Free-edition demographic as the recent crash batch (Crash inside BinaryNinjaDebugger::RspConnector::SendRaw #1066, Null dereference within DbgEngAdapter::ReadMemory #1070, Null dereference within EsrevenAdapter::GetProcessList #1071)_CxxThrowException) originating fromBinaryReader::ReadLEPointerreached viaDebuggerInfoTable::getInfoForHLILCallsTest plan
mainbefore the stack is established, or with a custom raw view) — confirm the widget renders without crashing and just omits the unreadable entry.🤖 Generated with Claude Code