We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Forge
forge 0.2.0 (d431f74 2024-04-27T00:16:52.929844000Z)
forge test --debug "_()" --match-contract PublicTest9
macOS (Apple Silicon)
Tried to use the debugger with the following code
// SPDX-License-Identifier: MIT pragma solidity ^0.8.19; contract Challenge { bytes internal constant bytecode = ( hex"5b608060806080608060806080608060806080" hex"60806080608060806080608060806080608060" hex"60806080608060806080608060806080608060" ); uint256 internal constant bytecode_start = 0x145; /** * @dev Remove duplicates from an array of uint8 */ function dispelDuplicates( uint8[] calldata input ) public pure returns (uint8[] memory output) { function() internal pure bytecode_func; assembly { bytecode_func := bytecode_start } bytecode_func(); bytes memory r = bytecode; assembly { output := r } } }
turns out the debugger crashes once it gets to the line bytecode_func(), here is the corresponding log
bytecode_func()
The application panicked (crashed). Message: swap_remove index (is 241) should be < len (is 240) Location: /rustc/25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04/library/alloc/src/vec/mod.rs:1463 This is a bug. Consider reporting it at https://github.com/foundry-rs/foundry ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ⋮ 9 frames hidden ⋮ 10: alloc::vec::Vec<T,A>::swap_remove::assert_failed::h5c3445a08183cfb1 at <unknown source file>:<unknown line> 11: foundry_debugger::tui::draw::<impl foundry_debugger::tui::context::DebuggerContext>::draw_src::h513d58bd179bc875 at <unknown source file>:<unknown line> 12: foundry_debugger::tui::Debugger::try_run_real::{{closure}}::h3a79640c3b313821 at <unknown source file>:<unknown line> 13: foundry_debugger::tui::Debugger::try_run::hd03d67fab6d66e5d at <unknown source file>:<unknown line> 14: forge::cmd::test::TestArgs::execute_tests::{{closure}}::h517417722672d6c0 at <unknown source file>:<unknown line> 15: forge::cmd::test::TestArgs::run::{{closure}}::h8c22520d60eb572f at <unknown source file>:<unknown line> 16: forge::main::hf3c5a2ed3e2f95d7 at <unknown source file>:<unknown line> 17: std::sys_common::backtrace::__rust_begin_short_backtrace::hbc8ec14722bb3757 at <unknown source file>:<unknown line> 18: _main<unknown> at <unknown source file>:<unknown line>
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.2.0 (d431f74 2024-04-27T00:16:52.929844000Z)
What command(s) is the bug in?
forge test --debug "_()" --match-contract PublicTest9
Operating System
macOS (Apple Silicon)
Describe the bug
Tried to use the debugger with the following code
turns out the debugger crashes once it gets to the line
bytecode_func()
, here is the corresponding logThe text was updated successfully, but these errors were encountered: