Repository navigation
test(relinker): cover branch targets found by the jump-table gap walk - #12243
Conversation
MarcZX10
left a comment
There was a problem hiding this comment.
I reviewed the added fixtures and the current-main merge CI results. The control stub confirms the table remains discoverable when the gap target returns; direct, post-one-byte, and chained branch targets each verify that code reached through the gap walk is excluded from table discovery. The reported mutation probes exercise the regression modes this test is intended to catch. git diff --check is clean, and the hosted Ubuntu, Windows, macOS arm64, macOS x86_64 and ASan relinker jobs all pass. I found no blocking issue in this test-only change.
MarcZX10
left a comment
There was a problem hiding this comment.
The new graph fixture covers the control where the gap stub returns, direct branches into the data table, a branch after a one-byte instruction, and a chained gap stub discovered only through an earlier target. The reported mutation probes show the new test catches otherwise-surviving walk/queue regressions, while main and #12203 pass the unmutated case. All current cross-platform relinker and ASan checks pass. Test-only change; no blocking issue found.
|
Windows run of this head
AI-assisted: yes (Claude Code) |
THEMANnt
left a comment
There was a problem hiding this comment.
Reviewed 8f16928a2cb54ff26bffa48bb2f1e5989fa1b598 against 82d5f01f28b3d63dd811f4424b3d5e4de5845eca. The new gap-walk fixtures distinguish a returning called stub from direct, instruction-prefixed and chained jumps into the proposed data table. This exercises why those branch targets must prevent table classification. Active Require checks remain in Release; no production implementation changes. No actionable finding.
Windows/GCC 15.3 Release: configured the actual relinker-only project, built control_flow_graph_tests and passed its registered CTest (1/1). Production was source-compared with the author base; the baseline fixture was not separately run. This validates synthetic control-flow/table analysis, not title execution.
8f16928 to
bacda83
Compare
bacda83 to
886010a
Compare
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
What
Test-only.
FindRelativeJumpTableswalks code outside the known functions, starting from branch targets, and collects the branch targets it finds there. A data table that one of those targets lands in is not masked. Nothing in the tests checked which targets this gap walk finds: changing how the walk marks positions, or stopping after the first walk, left every test passing (found while reviewing #12203).CheckGapWalkBranchTargetsinControlFlowGraphTests.cppbuilds one layout: a function thatleas a table after its end andcalls a stub in the gap before it. Four cases:push, so there is no table;jmps to a second stub after aret(reached only through the first stub's target), and that stub jumps into the table, so there is no table.Tested
macOS 26.2, Apple M5 (arm64), CMake/Ninja,
ANYPS5_RELINKER_ONLY=ON,BUILD_TESTING=ON(Python 3.13). Base82d5f01f28(upstream/main), head8f16928a2c: build OK,ctest -j 8366/366,control_flow_graph0.03 s.Mutation probe on
RelativeJumpTables.cpp. Each mutant was rebuilt and run throughcontrol_flow_graph_tests:7849e7f69d: the walk also markspos + 1decodedThe first version of the chained case put
int3filler between the two stubs. The walk decodes straight throughint3, which made that case pass even under M5 and M6, so the first stub now ends with aret.git merge-treeis clean against #12203 and #11565. The new call goes afterCheckLargeZeroGaps()so it stays clear of #11565's hunk inmain().Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)