Survive a CIE that declares no FDE encoding - #768
Conversation
The "R" augmentation that gives a CIE its FDE encoding is optional, but pyelftools reads it unconditionally and raises KeyError when it is absent rather than falling back to the default pointer encoding. The FDE reader here catches DWARFError and ValueError, so that KeyError escaped and failed the whole load whenever debug information was requested -- an object whose unwind tables cannot be read became an object that cannot be loaded. Catch it alongside the others and keep the existing warning. The unwind hints for such an object are lost either way; the load no longer is. tests/mips/busybox and tests/mipsel/busybox both have such a CIE, so the regression loads them with load_debug_info=True.
|
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS Validation record for head
Caveats: this is resilience against a dependency, not a fix for the cause — a CIE without the |
|
Corpus decompilation diffs can be found at angr/dec-snapshots@master...angr/cle_768 |
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS
The
Raugmentation that gives a CIE its FDE encoding is optional, but pyelftools reads it unconditionally —cie.augmentation_dict['FDE_encoding']incallframe.py— and raisesKeyErrorwhen it is absent instead of falling back to the default pointer encoding.ELF._load_function_hints_from_fdecatchesDWARFErrorandValueError, so thatKeyErrorescaped it and failed the entire load whenever debug information was requested. An object whose unwind tables happen to be unreadable became an object that cannot be loaded at all:Catching it alongside the others, and keeping the existing warning, restores the behaviour the handler was already written for. The unwind hints for such an object are lost either way; the load no longer is. The same handler guards
_load_exception_handling, so both are widened.tests/mips/busyboxandtests/mipsel/busyboxboth carry such a CIE, so the regression loads them withload_debug_info=Trueand needs no new fixture.The underlying bug is pyelftools', not this project's — a CIE without
Rshould yieldDW_EH_PE_absptrrather than raising — so this is resilience against a dependency rather than a fix for the root cause.Validation: see the comment below.