Key Error: 160 when loading ELF binary compiled with gcc 12.1
See original GitHub issueI am using cle for a bunch of ELF programs produced with gcc 12.1 and I keep hitting this exception: https://github.com/angr/cle/blob/2a2ffa93a151a6f6aacd0e9e839b5bd3dccbabbf/cle/backends/elf/elf.py#L753-L760
Traceback (most recent call last):
File "/home/vanessa/Desktop/Code/cle/test.py", line 62, in <module>
ld = cle.Loader(filename, load_debug_info=True, auto_load_libs=False)
File "/home/vanessa/Desktop/Code/cle/cle/loader.py", line 133, in __init__
self.initial_load_objects = self._internal_load(main_binary, *preload_libs, *force_load_libs, preloading=(main_binary, *preload_libs))
File "/home/vanessa/Desktop/Code/cle/cle/loader.py", line 694, in _internal_load
obj = self._load_object_isolated(main_spec)
File "/home/vanessa/Desktop/Code/cle/cle/loader.py", line 876, in _load_object_isolated
result = backend_cls(binary, binary_stream, is_main_bin=self.main_object is None, loader=self, **options)
File "/home/vanessa/Desktop/Code/cle/cle/backends/elf/elf.py", line 195, in __init__
self._load_dies(dwarf)
File "/home/vanessa/Desktop/Code/cle/cle/backends/elf/elf.py", line 785, in _load_dies
var = self._load_die_variable(sub_die, expr_parser, type_list)
File "/home/vanessa/Desktop/Code/cle/cle/backends/elf/elf.py", line 826, in _load_die_variable
parsed_exprs = expr_parser.parse_expr(die.attributes['DW_AT_location'].value)
File "/home/vanessa/Desktop/Code/cle/env/lib/python3.9/site-packages/elftools/dwarf/dwarf_expr.py", line 151, in parse_expr
arg_parser = self._dispatch_table[op]
KeyError: 160
I’m going to try / except and skip it for now, but wanted to bring it to y’all’s attention! I’m not familiar with this dispatch table thing, but I’m thinking maybe there is a new value that pyelftools hasn’t added yet?
Issue Analytics
- State:
- Created a year ago
- Comments:14 (3 by maintainers)
Top Results From Across the Web
[SOLVED] Building on linux arm · Issue #12 - GitHub
The error suggests the gcc binary is somehow being executed as a shell script... That happens when the OS doesn't know how to...
Read more >Using the GNU Compiler Collection
Using the GNU Compiler Collection. For gcc version 12.1.0. (GCC) ... language syntax recognized by GCC 4.0, and to produce an error if...
Read more >Cannot load custom ELF executable in GDB - Stack Overflow
I compiled a minimal ELF executable with GCC/NASM to try and reproduce the problem, but the GCC-produced executable loads without a hitch, ...
Read more >Bug listing with status RESOLVED with resolution TEST ...
Bug:233 - "Emacs segfaults when merged through the sandbox." status:RESOLVED resolution:TEST-REQUEST severity:critical · Bug:3888 - "yenta_socket module not ...
Read more >wolfSSL Documentation
4.3.1 Cipher Suite Strength and Choosing Proper Key Sizes . ... A.7 wolfSSL Error Handling and Reporting . ... B.12 Algorithms - 3DES...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yep seems to work! Thanks y’all, closing issue.
Some things to try: try installing pyelftools from git. There are some unreleased changes which I think are relevant. You can also try installing some pending pull requests on pyelftools, https://github.com/eliben/pyelftools/pull/418 in particular seems relevant?