Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: decompilation freezes on certain contracts #560

Open
1 of 2 tasks
fala13 opened this issue Feb 11, 2025 · 1 comment
Open
1 of 2 tasks

bug: decompilation freezes on certain contracts #560

fala13 opened this issue Feb 11, 2025 · 1 comment
Assignees
Labels
T-bug Type: bug

Comments

@fala13
Copy link
Contributor

fala13 commented Feb 11, 2025

Component

Heimdall (Core)

Have you ensured that you are up to date?

  • Bifrost
  • Heimdall

What version of Heimdall are you on?

tested on 0.8.5 and latest available 8c833b1

Operating System

Linux

Describe the bug

Some bad contracts still cause heimdall to hang up on them. Evmole fails and debaub produces weird output ( https://app.dedaub.com/binance/address/0xdf56697bc72911c9212df51c9d342f4fd36b838d/decompiled ).

Lack of output is fine, but freezing is problematic when using heimdall as a library.

> heimdall decompile 0xdf56697bc72911c9212df51c9d342f4fd36b838d -r https://rpc.ankr.com/bsc -vvvv
2025-02-11T12:20:39.018155Z TRACE heimdall_common::utils::http: GET https://api.github.com/repos/Jon-Becker/heimdall-rs/releases/latest
2025-02-11T12:20:39.200964Z TRACE heimdall_common::utils::http: GET https://api.github.com/repos/Jon-Becker/heimdall-rs/releases/latest: Response { url: "https://api.github.com/repos/Jon-Becker/heimdall-rs/releases/latest", status: 200, headers: {"date": "Tue, 11 Feb 2025 12:20:39 GMT" (..) } }
2025-02-11T12:20:39.201305Z DEBUG heimdall_cache: cache hit for key: 'chain_id.https-rpc-ankr-combsc'
2025-02-11T12:20:39.201466Z DEBUG heimdall_cache: cache hit for key: 'contract.56.0xDf56697Bc72911C9212df51c9d342F4fD36b838d'
2025-02-11T12:20:39.201472Z DEBUG heimdall_decompiler::core: fetching target bytecode took 199.369µs
2025-02-11T12:20:39.201557Z DEBUG heimdall_common::ether::compiler: detected compiler unknown unknown.
2025-02-11T12:20:39.201564Z  WARN heimdall_common::ether::compiler: unknown is not fully supported by heimdall
2025-02-11T12:20:39.202032Z DEBUG heimdall_disassembler::core: fetching target bytecode took 88.617µs
2025-02-11T12:20:39.202602Z DEBUG heimdall_disassembler::core: disassembly took 564.243µs
2025-02-11T12:20:39.202606Z  INFO heimdall_disassembler::core: disassembled 11035 bytes successfully
2025-02-11T12:20:39.202610Z DEBUG heimdall_disassembler::core: disassembly took 667.403µs
2025-02-11T12:20:39.202790Z TRACE heimdall_vm::ext::selectors: optimistically assuming instruction 00002d PUSH4 f47d33b5 is a function selector

.. and it hangs here until we run out of RAM. Quick profiling shows it's cloning and dropping vectors.

@fala13 fala13 added the T-bug Type: bug label Feb 11, 2025
@Jon-Becker
Copy link
Owner

Jon-Becker commented Feb 13, 2025

ty for opening! i will look into this asap.

feel free to ping me & call me slow if i forget

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-bug Type: bug
Projects
None yet
Development

No branches or pull requests

2 participants