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

forge test is crashing with message: called Option::unwrap() on a None value #7961

Closed
2 tasks done
dglowinski opened this issue May 21, 2024 · 4 comments
Closed
2 tasks done
Labels
T-bug Type: bug

Comments

@dglowinski
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 (1b08ae4 2024-05-21T00:18:03.928967000Z)

What command(s) is the bug in?

forge test

Operating System

macOS (Apple Silicon)

Describe the bug

forge test running in github CI started crashing today for our project. After updating foundryup the problem is reproduced on local.

To reproduce:

git clone https://github.com/euler-xyz/euler-vault-kit.git && cd ./euler-vault-kit && forge install
forge test

The process crashes after executing a non-deterministic number of tests (1 suite, or more, or none) The message and location is always the same:

❯ forge test
[⠊] Compiling...
No files changed, compilation skipped

Ran 5 tests for test/unit/irm/IRMLimit.t.sol:IRMLimit
[PASS] test_IRMLimit_accum_50() (gas: 34546)
[PASS] test_IRMLimit_accum_500() (gas: 14143)
[PASS] test_IRMLimit_accum_max() (gas: 9334)
[PASS] test_IRMLimit_rpow() (gas: 15550)
[PASS] test_IRMLimit_sanity() (gas: 15492)
Suite result: ok. 5 passed; 0 failed; 0 skipped; finished in 1.06ms (760.08µs CPU time)
The application panicked (crashed).
Message:  called `Option::unwrap()` on a `None` value
Location: crates/evm/fuzz/src/strategies/state.rs:271

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

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                                ⋮ 8 frames hidden ⋮
   9: core::panicking::panic::hc59c8a709a9b37ae
      at <unknown source file>:<unknown line>
  10: core::option::unwrap_failed::h64934fbe08d33633
      at <unknown source file>:<unknown line>
  11: foundry_evm_fuzz::strategies::state::FuzzDictionary::insert_sample_values::h42f45967efcefd8c
      at <unknown source file>:<unknown line>
  12: proptest::test_runner::runner::call_test::h4f99e3104cde6929
      at <unknown source file>:<unknown line>
  13: proptest::test_runner::runner::TestRunner::gen_and_run_case::h87106920d1a7f96f
      at <unknown source file>:<unknown line>
  14: proptest::test_runner::runner::TestRunner::run_in_process::h3bc30562d4f2e349
      at <unknown source file>:<unknown line>
  15: forge::runner::ContractRunner::run_invariant_test::h0780e3e1779a90bc
      at <unknown source file>:<unknown line>
  16: core::ops::function::impls::<impl core::ops::function::FnMut<A> for &F>::call_mut::h0afc06bed2c5ba87
      at <unknown source file>:<unknown line>
  17: rayon::iter::plumbing::bridge_producer_consumer::helper::h97b33de326dcefc0
      at <unknown source file>:<unknown line>
  18: rayon_core::join::join_context::{{closure}}::h98f105d7c17b40d1
      at <unknown source file>:<unknown line>
  19: rayon::iter::plumbing::bridge_producer_consumer::helper::h97b33de326dcefc0
      at <unknown source file>:<unknown line>
  20: rayon_core::join::join_context::{{closure}}::h98f105d7c17b40d1
      at <unknown source file>:<unknown line>
  21: rayon::iter::plumbing::bridge_producer_consumer::helper::h97b33de326dcefc0
      at <unknown source file>:<unknown line>
  22: forge::runner::ContractRunner::run_tests::h0738715c1df1fa79
      at <unknown source file>:<unknown line>
  23: forge::multi_runner::MultiContractRunner::test::{{closure}}::h760504ea05713f37
      at <unknown source file>:<unknown line>
  24: rayon::iter::plumbing::bridge_producer_consumer::helper::hcfbd92bc36d4e856
      at <unknown source file>:<unknown line>
  25: rayon_core::join::join_context::{{closure}}::h004d9323ff3da6cb
      at <unknown source file>:<unknown line>
  26: rayon::iter::plumbing::bridge_producer_consumer::helper::hcfbd92bc36d4e856
      at <unknown source file>:<unknown line>
  27: <rayon_core::job::StackJob<L,F,R> as rayon_core::job::Job>::execute::hee9548015de2e41d
      at <unknown source file>:<unknown line>
  28: rayon_core::registry::WorkerThread::wait_until_cold::hc2f2f5c5d2ac906c
      at <unknown source file>:<unknown line>
  29: std::sys_common::backtrace::__rust_begin_short_backtrace::h26c5ce7ae435c375
      at <unknown source file>:<unknown line>
  30: core::ops::function::FnOnce::call_once{{vtable.shim}}::h7359e7db922f9b5d
      at <unknown source file>:<unknown line>
  31: std::sys::pal::unix::thread::Thread::new::thread_start::h9266fbbdd0c3d8be
      at <unknown source file>:<unknown line>
  32: __pthread_joiner_wake<unknown>
      at <unknown source file>:<unknown line>

Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering.
zsh: abort      forge test
@dglowinski dglowinski added the T-bug Type: bug label May 21, 2024
@grandizzy
Copy link
Collaborator

release with fix #7956 should be ready in couple

@grandizzy
Copy link
Collaborator

@dglowinski please foundryup and retry. thank you

@dglowinski
Copy link
Author

@grandizzy confirming the bug is fixed. Thank you!

I'm closing the ticket

@dglowinski
Copy link
Author

bug was fixed

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