Conversation
|
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS Validation record for head What it adds. One object, Provenance, checked anonymously. The HuggingFace dataset $ curl -sL -o m2h -w 'http=%{http_code} size=%{size_download}\n' https://huggingface.co/datasets/noelo-lab/decbench-dataset/resolve/4b42a0dc6158913db0648a9123e76d6ddd9ab9cf/binaries/O2/bash/man2html
http=200 size=165992
$ sha256sum m2h
49e20152077b12b3aa33efd065450d7a42729045e1d6f9c85046ecbe4a41c1a1 m2hBuild, read out of the object. No workspace or store paths. The search found nothing that reproduces it. With angr at The scanner was checked against a known positive. Pointed at this fixture at the same angr revision it reports one hit, Before and after. Posted as the output comment on this pull request. Both arms are angr master Suites. This repository has no |
|
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS Complete output of the recorded command for import logging
import angr
logging.getLogger("angr").setLevel(logging.ERROR)
logging.getLogger("cle").setLevel(logging.ERROR)
logging.getLogger("pyvex").setLevel(logging.ERROR)
proj = angr.Project("../binaries/tests/x86_64/man2html_gcc11.4.0_O2", auto_load_libs=False)
cfg = proj.analyses.CFGFast(normalize=True, data_references=True)
proj.analyses.CompleteCallingConventions(recover_variables=True, cfg=cfg.model)
dec = proj.analyses.Decompiler(cfg.functions[0x4051D0], cfg=cfg.model)
print("errors:", [str(e.exc_value) for e in dec.errors])
print("lines:", dec.codegen.text.count("\n"), "gotos:", dec.codegen.text.count("goto "))Before — angr masterAfter — no caught exception, so the function keeps the full preset: angr master with the consumer change applied |
…range check `scan_request` in this binary has a lowered switch-case whose first case-emitting comparison is reached through a range-splitting comparison. LoweredSwitchSimplifier treats that splitter as redundant and removes it, which orphans the switch head it has just built and takes the head and every case body with it; the pass then reads one of those nodes back and raises. No object already tracked here was found to have that shape. With angr at 854269112a5ce5b1b356cf6d67bff9abaf986b55, every function of at least eight basic blocks in fifteen tracked x86-64 binaries -- `file` at two optimization levels, plus cat, cvs, dir, elfedit, grep, gzip, lighttpd, luac, minigzip, mv, sort, tar and tiffinfo, 3,409 functions in total -- was decompiled, and the pass raised on none of them. The same scan reports one hit when pointed at this fixture. `man2html` is bash 5.2's `support/man2html.c`, built for x86-64 by GCC 11.4.0 on Ubuntu 22.04 with `-mtune=generic -march=x86-64 -g -O2 -fno-builtin -fasynchronous-unwind-tables -fstack-protector-strong -fstack-clash-protection -fcf-protection`, taken from the public HuggingFace dataset `noelo-lab/decbench-dataset` at `4b42a0dc6158913db0648a9123e76d6ddd9ab9cf`, path `binaries/O2/bash/man2html`. The bytes here are that file: 165,992 bytes, sha256 49e20152077b12b3aa33efd065450d7a42729045e1d6f9c85046ecbe4a41c1a1.
44a93d4 to
0d17cb2
Compare
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS
Problem
LoweredSwitchSimplifierbuilds a switch head out of the first comparison node that emits a case, then removes the comparison nodes the switch subsumes. When one of those redundant comparisons sits upstream of the head, removing it leaves the head with no in-edges, and the same walk takes the head and every case body hanging off it. The pass reads one of those nodes back and raises, which sends the whole function to thebasicdecompilation preset. The search below found no object already tracked here that reproduces that shape, so the consumer cannot assert on it.Root cause
The shape needs a lowered switch whose first case-emitting comparison is reached through a range-splitting comparison, which is a narrow codegen accident. With angr at
854269112a5ce5b1b356cf6d67bff9abaf986b55, every function of at least eight basic blocks in fifteen tracked x86-64 binaries --fileat two optimization levels, pluscat,cvs,dir,elfedit,grep,gzip,lighttpd,luac,minigzip,mv,sort,tarandtiffinfo, 3,409 functions in total -- was decompiled, and the pass raised on none of them. The same scan reports one hit when pointed at this fixture, so its silence on the fifteen is a result rather than a broken instrument.Fix
tests/x86_64/man2html_gcc11.4.0_O2is bash 5.2'ssupport/man2html.c, whosescan_requesthas the shape. It is taken byte for byte from the public, ungated HuggingFace datasetnoelo-lab/decbench-datasetat commit4b42a0dc6158913db0648a9123e76d6ddd9ab9cf, pathbinaries/O2/bash/man2html, and downloads anonymously from there:DW_AT_producerrecords the flags ---mtune=generic -march=x86-64 -g -O2 -fno-builtin -fasynchronous-unwind-tables -fstack-protector-strong -fstack-clash-protection -fcf-protection-- and.commentrecords the compiler,GCC: (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0. Its.interpis/lib64/ld-linux-x86-64.so.2and it declares noRUNPATHorRPATH. It carries seven absolute paths in all: that interpreter, aDW_AT_comp_dirof/tmp/tmp53t3gycz/bash-5.2/support, and five DWARF include directories under/usr.Testing
This repository runs no CI. Loaded with angr at master
854269112a5ce5b1b356cf6d67bff9abaf986b55, decompilingscan_requestat0x4051d0leavesDecompiler.errorsholdingNetworkXError: The node <AILBlock 0x406572> is not in the digraphand returns 2,515 lines with 136gotos from the fallback preset. With the consumer's change the errors list is empty and the same function is 2,473 lines with 135gotos. That is the assertion the consumer gains.Validation: #227 (comment)
🤖 Generated with Claude Code
session: sharpen