Skip to content

statetest execution crash #8471

Open
Open
@holiman

Description

@holiman

Description

The nethtest binary crashes on certain statetests.

Steps to Reproduce
In order to replicate the behavior, please provide a detailed list of steps:

Execute the given statetest

statetest /fuzztmp/00000030-mixed-0.json.min:

{
  "00000030-mixed-0": {
    "env": {
      "currentCoinbase": "b94f5374fce5edbc8e2a8697c15331677e6ebf0b",
      "currentDifficulty": "0x200000",
      "currentRandom": "0x0000000000000000000000000000000000000000000000000000000000200000",
      "currentGasLimit": "0x26e1f476fe1e22",
      "currentNumber": "0x1",
      "currentTimestamp": "0x3e8",
      "previousHash": "0x044852b2a670ade5407e78fb2863c51de9fcb96542a07186fe3aeda6bb8a116d",
      "currentBaseFee": "0x10"
    },
    "pre": {
      "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b": {
        "code": "0x",
        "storage": {},
        "balance": "0xffffffffff",
        "nonce": "0x0"
      }
    },
    "transaction": {
      "maxFeePerGas": "0x10",
      "maxPriorityFeePerGas": "0x10",
      "nonce": "0x0",
      "to": "0x000000000000000000000000000000000000000F",
      "data": [
        "0x1a5fd2012d0e722d95c83c0c2783274174380e2accd9b76e99dbda57f854bcd7b67a45ee2e3b28fc230fd9c0fc6f52c59889df1638dc0c2707f70bf584fe3acb1e80146236364f9056ddf19a9bdcbe"
      ],
      "gasLimit": [
        "0x5e60"
      ],
      "value": [
        "0xd79193"
      ],
      "secretKey": "0x45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
      "sender": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b"
    },
    "out": "0x",
    "post": {
      "Prague": [
        {
          "hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
          "logs": "0x0000000000000000000000000000000000000000000000000000000000000000",
          "indexes": {
            "data": 0,
            "gas": 0,
            "value": 0
          }
        }
      ]
    }
  }

From a docker image (holiman/omnifuzz):

root@199a6169542c:/# /neth/nethtest --trace -m --input /fuzztmp/00000030-mixed-0.json.tmpp
Unhandled exception: System.NullReferenceException: Object reference not set to an instance of an object.
   at Nethermind.Test.Runner.StateTestTxTracer.ReportOperationRemainingGas(Int64 gas) in /nethermind/src/Nethermind/Nethermind.Test.Runner/StateTestTxTracer.cs:line 92
   at Nethermind.Evm.VirtualMachine`1.Run[TTracingActions](EvmState state, IWorldState worldState, ITxTracer txTracer) in /nethermind/src/Nethermind/Nethermind.Evm/VirtualMachine.cs:line 439
   at Nethermind.Evm.VirtualMachine.Run[TTracingActions](EvmState state, IWorldState worldState, ITxTracer txTracer) in /nethermind/src/Nethermind/Nethermind.Evm/VirtualMachine.cs:line 77
   at Nethermind.Evm.TransactionProcessing.TransactionProcessorBase.ExecuteEvmCall(Transaction tx, BlockHeader header, IReleaseSpec spec, ITxTracer tracer, ExecutionOptions opts, Int32 delegationRefunds, Int64 floorGas, StackAccessTracker& accessedItems, Int64& gasAvailable, ExecutionEnvironment& env, TransactionSubstate& substate, GasConsumed& gasConsumed, Byte& statusCode) in /nethermind/src/Nethermind/Nethermind.Evm/TransactionProcessing/TransactionProcessor.cs:line 622
   at Nethermind.Evm.TransactionProcessing.TransactionProcessorBase.Execute(Transaction tx, BlockExecutionContext& blCtx, ITxTracer tracer, ExecutionOptions opts) in /nethermind/src/Nethermind/Nethermind.Evm/TransactionProcessing/TransactionProcessor.cs:line 172
   at Nethermind.Evm.TransactionProcessing.TransactionProcessorBase.ExecuteCore(Transaction tx, BlockExecutionContext& blCtx, ITxTracer tracer, ExecutionOptions opts) in /nethermind/src/Nethermind/Nethermind.Evm/TransactionProcessing/TransactionProcessor.cs:line 131
   at Nethermind.Evm.TransactionProcessing.TransactionProcessorBase.Execute(Transaction transaction, BlockExecutionContext& blCtx, ITxTracer txTracer) in /nethermind/src/Nethermind/Nethermind.Evm/TransactionProcessing/TransactionProcessor.cs:line 114
   at Nethermind.Evm.TransactionProcessing.TransactionProcessorBase.Nethermind.Evm.TransactionProcessing.ITransactionProcessor.Execute(Transaction transaction, BlockExecutionContext& blCtx, ITxTracer txTracer)
   at Ethereum.Test.Base.GeneralStateTestBase.RunTest(GeneralStateTest test, ITxTracer txTracer) in /nethermind/src/Nethermind/Ethereum.Test.Base/GeneralTestBase.cs:line 134
   at Nethermind.Test.Runner.StateTestsRunner.RunTests() in /nethermind/src/Nethermind/Nethermind.Test.Runner/StateTestRunner.cs:line 97
   at Nethermind.Test.Runner.Program.RunStateTest(String path, Func`2 testRunnerBuilder) in /nethermind/src/Nethermind/Nethermind.Test.Runner/Program.cs:line 131
   at Nethermind.Test.Runner.Program.Run(ParseResult parseResult, CancellationToken cancellationToken) in /nethermind/src/Nethermind/Nethermind.Test.Runner/Program.cs:line 98
   at System.CommandLine.Invocation.InvocationPipeline.InvokeAsync(ParseResult parseResult, CancellationToken cancellationToken)

Desktop (please complete the following information):

Version: [e.g. 1.17.0]

root@199a6169542c:/# ./neth/nethtest --version
1.32.0-unstable+e8ff8be532043a8860cf5e98b8ec6b74ecd49ee1

That is, commit e8ff8be

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