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

fix(fuzz): prevent int strategy to overflow when complicate #7447

Merged
merged 1 commit into from
Mar 20, 2024

Conversation

grandizzy
Copy link
Collaborator

Motivation

int strategy complicate can overflow

The application panicked (crashed).
Message:  overflow
Location: crates/evm/fuzz/src/strategies/int.rs:71

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

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                                ⋮ 7 frames hidden ⋮                               
   8: <foundry_evm_fuzz::strategies::int::IntValueTree as proptest::strategy::traits::ValueTree>::complicate::h8a9032e00b3a6ca5
      at <unknown source file>:<unknown line>
   9: <proptest::strategy::unions::TupleUnionValueTree<(proptest::strategy::lazy::LazyValueTree<A>,core::option::Option<proptest::strategy::lazy::LazyValueTree<B>>)> as proptest::strategy::traits::ValueTree>::complicate::hdc78563564ff1e33
      at <unknown source file>:<unknown line>
  10: proptest::test_runner::runner::TestRunner::shrink::h189a0410aaa9c28a
      at <unknown source file>:<unknown line>
  11: proptest::test_runner::runner::TestRunner::run_one_with_replay::hcf865adda789fe4a
      at <unknown source file>:<unknown line>
  12: proptest::test_runner::runner::TestRunner::run_in_process_with_replay::he634a8132578406c
      at <unknown source file>:<unknown line>
  13: foundry_evm::executors::fuzz::FuzzedExecutor::fuzz::hf3b9de2094877486
  
  
  
self.curr: -57896044618658097711785492504343953926634992332820282019728792003956564819968, self.hi:-57896044618658097711785492504343953926634992332820282019728792003956564819968

Solution

ensure complicate lo is set to curr value if min or max

@grandizzy grandizzy marked this pull request as ready for review March 19, 2024 16:58
@DaniPopes DaniPopes merged commit a7f1b3b into foundry-rs:master Mar 20, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants