Skip to content

[Bug-Candidate]: Internal Error: Call target doesn't exist #1452

@gustavo-grieco

Description

@gustavo-grieco

Describe the issue:

There is a very strange issue crashing echidna (master). To reproduce:

  1. forge init crash
  2. cd crash
  3. Open foundry.toml add via_ir = true.
  4. Add the following contract (e.g. src/Crash.sol):
pragma solidity ^0.8.13;
import {Test} from "forge-std/Test.sol";

contract Crash is Test {
    function crash(
        address _creator,
        address _quoteToken,
        address _underlyingToken,
        uint256 _r0,
        uint256 _r_star,
        uint256 _k0,
        uint256 _cashIn,
        uint256 _initLPShares,
        address _vault
    ) public asActor {
        return;
        t(false, "");
    }

    modifier asActor() {
        vm.prank(address(this));
        _;
    }

    event Log(string);
    function t(bool b, string memory reason) internal {
        if (!b) {
            emit Log(reason);
            assert(false);
        }
    }
}
  1. Run echidna . --contract Crash --test-limit 100000000000 --format text --test-mode assertion.

Result:

[2025-09-17 09:13:01.81] [Worker 0] Crashed:

Internal Error: Call target doesn't exist -- CallStack (from HasCallStack):
  internalError, called at src/EVM.hs:1576:9 in hevm-0.55.1-FvmSjNlhmqw6zGwQpkjqs9:EVM
CallStack (from HasCallStack):
  error, called at src/EVM/Types.hs:1552:19 in hevm-0.55.1-FvmSjNlhmqw6zGwQpkjqs9:EVM.Types
  internalError, called at src/EVM.hs:1576:9 in hevm-0.55.1-FvmSjNlhmqw6zGwQpkjqs9:EVM

Please report it to https://github.com/crytic/echidna/issues
[2025-09-17 09:13:01.81] [Worker 2] Crashed:

Internal Error: Call target doesn't exist -- CallStack (from HasCallStack):
  internalError, called at src/EVM.hs:1576:9 in hevm-0.55.1-FvmSjNlhmqw6zGwQpkjqs9:EVM
CallStack (from HasCallStack):
  error, called at src/EVM/Types.hs:1552:19 in hevm-0.55.1-FvmSjNlhmqw6zGwQpkjqs9:EVM.Types
  internalError, called at src/EVM.hs:1576:9 in hevm-0.55.1-FvmSjNlhmqw6zGwQpkjqs9:EVM

Please report it to https://github.com/crytic/echidna/issues
[2025-09-17 09:13:01.81] [Worker 1] Crashed:

Internal Error: Call target doesn't exist -- CallStack (from HasCallStack):
  internalError, called at src/EVM.hs:1576:9 in hevm-0.55.1-FvmSjNlhmqw6zGwQpkjqs9:EVM
CallStack (from HasCallStack):
  error, called at src/EVM/Types.hs:1552:19 in hevm-0.55.1-FvmSjNlhmqw6zGwQpkjqs9:EVM.Types
  internalError, called at src/EVM.hs:1576:9 in hevm-0.55.1-FvmSjNlhmqw6zGwQpkjqs9:EVM

Please report it to https://github.com/crytic/echidna/issues
[2025-09-17 09:13:01.81] [Worker 3] Crashed:

Internal Error: Call target doesn't exist -- CallStack (from HasCallStack):
  internalError, called at src/EVM.hs:1576:9 in hevm-0.55.1-FvmSjNlhmqw6zGwQpkjqs9:EVM
CallStack (from HasCallStack):
  error, called at src/EVM/Types.hs:1552:19 in hevm-0.55.1-FvmSjNlhmqw6zGwQpkjqs9:EVM.Types
  internalError, called at src/EVM.hs:1576:9 in hevm-0.55.1-FvmSjNlhmqw6zGwQpkjqs9:EVM

Fun fact: changing return to revert() results is no crash at all 🤔

Code example to reproduce the issue:

Already explained.

Version:

master

Relevant log output:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions