Skip to content

Remove the dead symbolic-ASLR loader API - #811

Open
zardus wants to merge 1 commit into
masterfrom
drop-claripy-import
Open

zardus wants to merge 1 commit into
masterfrom
drop-claripy-import

Conversation

@zardus

@zardus zardus commented Sep 3, 2026

Copy link
Copy Markdown
Member

THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS

Problem

Loader.get_loader_symbolic_constraints holds cle's last import claripy. The
clarirs migration in angr (angr/angr#6550, merged
2026-09-03) folded claripy into angr — it is built into angr.rustylib.claripy
and exposed as angr.claripy — and dropped the standalone claripy package
from angr's dependencies, so installing angr no longer installs it. Loading
binaries/tests/x86_64/fauxware with aslr=True in such an environment and
calling the method:

ERROR | cle.loader | Please install claripy to get symbolic constraints
Loader.aslr          : True
symbolic constraints : []
mapped_base_symbolic : 0

The error asks the user to install a package angr no longer uses.

Root cause

The method returned [] before the migration too. The value it tests,
Backend.mapped_base_symbolic, is assigned in exactly one place —
self.mapped_base_symbolic = 0 in Backend.__init__ — so
isinstance(obj.mapped_base_symbolic, claripy.ast.BV) was never true and the
loop never appended a constraint. Nothing in cle, angr or angr-management calls
the method or writes the attribute, and the docstring is "Do not use this
method."

Fix

Delete the method and the attribute that only fed it. cle is a dependency of
angr, so it cannot follow the migration's from angr import claripy rule;
dropping the dead code is how cle reaches zero claripy references, which
git grep -n claripy now confirms with exit 1. The aslr flags stay: aslr is
a documented Loader keyword, so removing it would break callers that pass it,
while removing the method breaks nobody. Nothing reads either flag after this
change; retiring them is a separate API change.

Testing

No regression test: the change removes dead code and adds no behaviour to
assert. The load above is the check — it prints that error and [] on master and
raises AttributeError on this head, and both captures are in the output
comment. The cle suite is unchanged at 257 passed and 9 skipped, with the same 3
pre-existing failures master has.

Validation: #811 (comment)

session: sharpen

`Loader.get_loader_symbolic_constraints` held cle's last `import claripy`.
angr/angr#6550 folded claripy into angr and dropped the standalone package
from angr's dependencies, so an environment that installs angr no longer has a
top-level `claripy`. The guarded import falls through to its except branch
there and the method logs "Please install claripy to get symbolic constraints"
and returns [].

It returned [] before that too. The value it tests,
`Backend.mapped_base_symbolic`, is assigned in exactly one place -- `= 0` in
`Backend.__init__` -- so the `isinstance(..., claripy.ast.BV)` check was never
true. Nothing in cle, angr or angr-management calls the method or writes the
attribute, and the docstring says "Do not use this method."

cle is a dependency of angr, so it cannot follow #6550's `from angr import
claripy` rule. Drop the dead method and the attribute that only fed it. The
`aslr` flags stay: `aslr` is a documented `Loader` keyword and removing it
would break callers that pass it.
@zardus

zardus commented Sep 3, 2026

Copy link
Copy Markdown
Member Author

THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS

Validation record for head 2344a63d07957cccf5019d0a1fcac426a0170731 against baseline 3812052df2ad284cd16684fb7b7eb66e8d14dc6d.

  • Regression: none — the change deletes dead code and adds no behaviour to assert
  • Focused: python probe.py (the script in the output comment, PYTHONPATH set to each revision) — baseline logs Please install claripy to get symbolic constraints and returns []; head raises AttributeError
  • Focused: git grep -n claripy <rev> — 5 lines on baseline, 0 lines and exit 1 on head
  • Full suite: python -m pytest tests -n 4 -q — head 257 passed, 9 skipped, 3 failed; baseline 257 passed, 9 skipped, 3 failed. Identical sets
  • Lint/type: pre-commit run --all-files — 24 hooks, 22 Passed and 2 Skipped for having no files to check, exit 0, working tree unmodified
  • Lint/type: angr/ci-settings ci-image/scripts/typecheck.py origin/master HEAD at ci-settings b23d782e1052da0e512b1a1ef1902d06e0545730cle/loader.py errors 5 -> 4, cle/backends/backend.py errors 0 -> 0, exit 0
  • Workspace gate: not run — six corpus sweep lanes are live in this workspace and entering the development shell would reinstall the editables they are running against. The scoped equivalent above ran in an isolated clone: cle's own suite, the full hook set, and the merge-base type comparison. angr and angr-management suites did not run; hosted CI covers them

Dead-code evidence, re-derived at this head:

  • Backend.mapped_base_symbolic is assigned once in the ecosystem, = 0 in Backend.__init__. git grep -nE 'get_loader_symbolic_constraints|mapped_base_symbolic' finds no other write and no caller: exit 1 at angr 943c1defd93142e5c40f785a404feb167412f86a and angr-management 68f731358b97e812b8fe0de2a8b9bc14aa1fc4f1, and exit 1 over the whole cle tree at this head
  • Loader.get_loader_symbolic_constraints has no caller. GitHub code search org:angr returns 3 files: angr/cle itself and the angr/mono and angr/vibr mirrors of it.
  • cle never declared claripy: it is absent from [project] dependencies and from the testing dependency group. The ecosystem CI image installs it regardless — angr/ci-settings ci-image/conf/repo-list.txt lists angr/claripy — but no cle test references either identifier, git grep over tests/ exiting 1, so no CI job calls the method on either revision

CI prediction, written before the push. Anything red that is not named here is a defect in this validation, not a CI quirk:

  • ci / Typecheck, ci / Lint, ci / Build, ci / Decompiler Snapshot Testing (0) green
  • The ci / Test shards that collect tests/test_gopclntab.py and tests/test_macho.py::test_relocatable_object, plus Test macos-15 and Test (Pyodide), red with CLEFileNotFoundError for binaries/tests/aarch64/langdetect_go.macho and binaries/tests/aarch64/relocatable_object.macho. Those fixtures are not in angr/binaries master; cle master fails the same four checks at the baseline commit, and this branch changes nothing that touches them. Test windows-2022 cancelled by fail-fast, as it is on master
  • Reference resolution: the one link the resolver parses is the angr pull request in Problem. It is merged, so resolve_refs.py logs not open, skipping and cle CI builds against angr master. No sibling is pinned

Caveats: the 3 suite failures above are the missing angr/binaries Mach-O fixtures, confirmed identical on baseline and head. pre-commit was installed as an isolated tool for this run because the workspace development shell was unavailable; it built each hook's environment from the revisions pinned in .pre-commit-config.yaml.

@zardus

zardus commented Sep 3, 2026

Copy link
Copy Markdown
Member Author

THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS

Loader.get_loader_symbolic_constraints on binaries/tests/x86_64/fauxware,
loaded with aslr=True, before and after this change. Both runs are the same
script against the same fixture, differing only in the cle revision on
PYTHONPATH:

import logging
logging.basicConfig(level=logging.ERROR, format="%(levelname)s | %(name)s | %(message)s")
import cle

ld = cle.Loader("binaries/tests/x86_64/fauxware", aslr=True)
print("cle.__version__      :", cle.__version__)
print("Loader.aslr          :", ld.aslr)
try:
    print("symbolic constraints :", ld.get_loader_symbolic_constraints())
except AttributeError as e:
    print("symbolic constraints : AttributeError:", e)
print("mapped_base_symbolic :", getattr(ld.main_object, "mapped_base_symbolic", "<absent>"))

Before — the guarded import claripy falls through to its except ImportError branch and the method reports a missing optional dependency that no
longer exists, then returns the empty list it would have returned anyway:

cle master 3812052
ERROR | cle.loader | Please install claripy to get symbolic constraints
cle.__version__      : 9.3.5.dev0
Loader.aslr          : True
symbolic constraints : []
mapped_base_symbolic : 0

After — the method and the attribute are gone, so there is no misleading log
line and no claripy reference left in cle:

with this change
cle.__version__      : 9.3.5.dev0
Loader.aslr          : True
symbolic constraints : AttributeError: 'Loader' object has no attribute 'get_loader_symbolic_constraints'
mapped_base_symbolic : <absent>

@angr-bot

angr-bot commented Sep 3, 2026

Copy link
Copy Markdown
Member

Corpus decompilation diffs can be found at angr/dec-snapshots@master...angr/cle_811

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.

2 participants