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: forge verify-bytecode panicks with end index out of range #8100

Closed
2 tasks done
QGarchery opened this issue Jun 7, 2024 · 1 comment · Fixed by #9311
Closed
2 tasks done

bug: forge verify-bytecode panicks with end index out of range #8100

QGarchery opened this issue Jun 7, 2024 · 1 comment · Fixed by #9311
Assignees
Labels
C-forge Command: forge Cmd-forge-verify Command: forge verify-contract/check T-bug Type: bug
Milestone

Comments

@QGarchery
Copy link

Component

Forge

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge 0.2.0 (08b2d3e 2024-06-07T00:17:47.048257430Z)

What command(s) is the bug in?

forge verify-bytecode

Operating System

Linux

Describe the bug

When verifying bytecode on the morpho-blue-bundlers, I get the following error messages:

The application panicked (crashed).
Message:  range end index 18446744073709517144 out of range for slice of length 15743
Location: crates/verify/src/bytecode.rs:626

This is a bug. Consider reporting it at https://github.com/foundry-rs/foundry

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                                ⋮ 7 frames hidden ⋮                               
   8: core::slice::index::slice_end_index_len_fail_rt::hf817bd92ee257898
      at <unknown source file>:<unknown line>
   9: core::slice::index::slice_end_index_len_fail::h9965f4285b8d5d41
      at <unknown source file>:<unknown line>
  10: forge_verify::bytecode::try_match::hd38840daf41bf2ac
      at <unknown source file>:<unknown line>
  11: forge_verify::bytecode::VerifyBytecodeArgs::run::{{closure}}::h66995c85df5ed43f
      at <unknown source file>:<unknown line>
  12: forge::main::h46f5b6d0ffb38582
      at <unknown source file>:<unknown line>
  13: std::sys_common::backtrace::__rust_begin_short_backtrace::h9fc915f4253178a8
      at <unknown source file>:<unknown line>
  14: main<unknown>
      at <unknown source file>:<unknown line>
  15: __libc_start_main<unknown>
      at <unknown source file>:<unknown line>
  16: _start<unknown>
      at <unknown source file>:<unknown line>

Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering.

Reproduce

[etherscan]
base = { key = "${BASESCAN_KEY}" }
  • have a proper setup for the environment variables BASE_RPC and BASESCAN_KEY
  • run forge verify-bytecode 0x123f3167a416cA19365dE03a65e0AF3532af7223 CompoundV2MigrationBundlerV2 --rpc-url $BASE_RPC
@QGarchery QGarchery added the T-bug Type: bug label Jun 7, 2024
@zerosnacks
Copy link
Member

zerosnacks commented Jul 16, 2024

Able to reproduce the bug with the given setup (cc @yash-atreya), note the name change to CompoundV2MigrationBundlerV2

BASESCAN_KEY=<BASESCAN_API_KEY> forge verify-bytecode 0x123f3167a416cA19365dE03a65e0AF3532af7223 CompoundV2MigrationBundlerV2 --rpc-url <ALCHEMY_API_KEY>

Yields

Verifying bytecode for contract CompoundV2MigrationBundlerV2 at address 0x123f3167a416cA19365dE03a65e0AF3532af7223
The application panicked (crashed).
Message:  range end index 18446744073709517144 out of range for slice of length 15743
Location: crates/verify/src/bytecode.rs:621

This is a bug. Consider reporting it at https://github.com/foundry-rs/foundry

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   1: __libc_start_call_main<unknown>
      at ./csu/../sysdeps/nptl/libc_start_call_main.h:58
   2: __libc_start_main_impl<unknown>
      at ./csu/../csu/libc-start.c:360

Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering.
Aborted (core dumped)

@zerosnacks zerosnacks added Cmd-forge-verify Command: forge verify-contract/check C-forge Command: forge labels Jul 16, 2024
@zerosnacks zerosnacks changed the title forge verify-bytecode panicks with end index out of range bug: forge verify-bytecode panicks with end index out of range Jul 16, 2024
@zerosnacks zerosnacks added this to the v1.0.0 milestone Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-forge Command: forge Cmd-forge-verify Command: forge verify-contract/check T-bug Type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants