Cover object placement in an address space narrower than a granule - #717
Cover object placement in an address space narrower than a granule#717zardus wants to merge 2 commits into
Conversation
|
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS Validation record for head Rebase: the conflict was in
Caveats: the tests need Corpus measurement of the open queue, 2026-08-15The open pull-request queue was scored against 733 objects drawn from a sweep's own failing units (35 error classes, 49 architectures, 16 containers), with each repository's current master as the baseline rather than the revisions the sweep pinned. Each object is loaded with Four of the narrow-p-code-architecture changes form a chain. Applied alone, each one clears part of its own class and leaves the rest of it standing on the next change's defect:
Applied together — angr#6793 + cle#721 + cle#717 + archinfo#363 — the One qualification about cle#717, which is included in the combination above: since its rebase onto cle#735 it carries no production change, only regression coverage, so nothing in the movement here is attributable to it. It guards the placement rule the other three depend on rather than supplying it. Recorded here because this PR is part of the combination that was measured, not because the measurement credits it with anything: as the description says, the production change it was opened for landed as cle#735, and what is left is the guard for that ladder's one-byte step. Nothing else in the queue covers it. Re-keyed 2026-08-28. The figures above were measured at |
|
Corpus decompilation diffs can be found at angr/dec-snapshots@master...angr/cle_717 |
8a792e9 to
27f641b
Compare
bd046ce to
eba8743
Compare
A 16-bit p-code architecture has an address space of 64 KiB, smaller than the default 1 MiB rebase granularity. Placing an object by aligning up to the granularity therefore jumped past the end of memory, and loading a z80 blob failed with "Ran out of room in address space" as soon as the extern object needed an address. Searching the free space instead, and treating the granularity as a preference that gives way to a finer alignment, already fixes this, but nothing in the suite loads an architecture narrower than 32 bits, so the rule that makes it work is unguarded. Load a z80 blob and check that the extern object lands inside the address space and is reachable, then fill that space with more objects than it has granules. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
eba8743 to
2b956d6
Compare
The force-push of this branch raced a master advance, so GitHub never recomputed refs/pull/717/merge and dispatched no workflow run for the previous head. This commit changes no content: its tree is identical to its parent's.
|
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS This branch adds no production change, so the thing to show is what the suite catches. Both runs below use the same loader — Before — master's cle master's tests, ladder stopping at 0x1000After — this branch's this branch's tests, same loader and then the real oneFor reference, the failure the branch was opened for, against the original z80 failure, and its fix |
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS
Problem
A 16-bit p-code architecture has a 64 KiB address space, narrower than the
default 1 MiB rebase granularity, so
Loader._find_safe_rebase_addraligned theextern object past the end of memory and a z80 blob did not load at all. Against
45c6509~1, the commit before #735:#735 has since fixed that, so this branch no longer changes
cle/loader.pyandonly the coverage is left. What is missing is a guard: nothing else in the suite
loads an architecture narrower than 32 bits.
Root cause
#735 replaced the single granule-aligned placement with an alignment ladder that
falls back when a gap is too tight:
A 16-bit space is the extreme case of that: it does not contain even one default
granule, so it holds no object at all unless the ladder reaches the bottom rung.
This branch's earlier one-byte special case for
arch.bits < 32was droppedrather than rebased, because the ladder subsumes it.
Fix
Two tests in
tests/test_rebase.py.test_address_space_narrower_than_the_granularityloads a 0x1500-byte z80 blob and asserts the extern object lands above the image
and below
2**16.test_narrow_address_space_holds_more_objects_than_granulesthen
dynamic_loads 24 further objects into the same 64 KiB, asserting they aredisjoint, in bounds, and each findable by
find_object_containing. At the mergebase both pass:
Testing
Delete the one-byte rung from the ladder and master's
tests/test_rebase.pystays green at 3 passed, while this branch's file reports 1 failed, 4 passed --
test_narrow_address_space_holds_more_objects_than_granules, withCLEOperationError: Ran out of room in address spaceatcle/loader.py:1095.That one test is the whole guard; the other four, including everything #735
added, cannot see the removal. Against
45c6509~1all five fail.angr/angr#6793 works around this with
rebase_granularity=0x100and can drop it.Validation: #717 (comment)
sync: angr/angr#6793
session: sharpen