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

[Bug]: Prelude.init: empty list while shrinking #1321

Open
rappie opened this issue Oct 17, 2024 · 2 comments
Open

[Bug]: Prelude.init: empty list while shrinking #1321

rappie opened this issue Oct 17, 2024 · 2 comments

Comments

@rappie
Copy link

rappie commented Oct 17, 2024

Describe the issue:

I'm shrinking about 10 optimization functions with seqLen 250 and 16 workers. Once all the workers are stopped, 1 shrink iteration is performed and then after a while I get this error.

Code example to reproduce the issue:

The repo is private 😞

Version:

Echidna 2.2.5 (built today from master)

Relevant log output:

image

@rappie
Copy link
Author

rappie commented Oct 17, 2024

Commenting out all optimization functions except 1 fixes this.

I'm guessing it might be some kind of timing issue, because with more optimization functions enabled Echidna as a whole is very slow (for example: scrolling)

@elopez
Copy link
Member

elopez commented Oct 17, 2024

Reproducer:

contract C {

function echidna_opt_foo() public returns (int256) {
  return 0;
}
}
% echidna a.sol --test-mode optimization --format text
[2024-10-17 11:06:34.64] Compiling a.sol... Done! (0.300388s)
Analyzing contract: a.sol:C
[2024-10-17 11:06:34.94] Running slither on a.sol... Done! (0.365533s)
[2024-10-17 11:06:35.31] [Worker 3] New maximum value of echidna_opt_foo: 0
[2024-10-17 11:06:35.31] [Worker 1] New maximum value of echidna_opt_foo: 0
[2024-10-17 11:06:35.31] [Worker 2] New maximum value of echidna_opt_foo: 0
[2024-10-17 11:06:35.31] [Worker 0] New maximum value of echidna_opt_foo: 0
[2024-10-17 11:06:35.31] [Worker 3] New coverage: 45 instr, 1 contracts, 1 seqs in corpus
[2024-10-17 11:06:35.31] [Worker 1] New coverage: 45 instr, 1 contracts, 2 seqs in corpus
[2024-10-17 11:06:35.32] [Worker 0] New coverage: 48 instr, 1 contracts, 3 seqs in corpus
[2024-10-17 11:06:35.63] [Worker 2] Crashed:

Prelude.init: empty list
CallStack (from HasCallStack):
  error, called at libraries/base/GHC/List.hs:1644:3 in base:GHC.List
  errorEmptyList, called at libraries/base/GHC/List.hs:180:28 in base:GHC.List
  init, called at lib/Echidna/Shrink.hs:76:21 in echidna-2.2.5-Ku1bMKy38m038Xfqf0w2hr:Echidna.Shrink

Please report it to https://github.com/crytic/echidna/issues
[2024-10-17 11:06:35.63] [Worker 3] Test limit reached. Stopping.
[2024-10-17 11:06:35.63] [Worker 1] Test limit reached. Stopping.
[2024-10-17 11:06:35.63] [Worker 0] Test limit reached. Stopping.
[2024-10-17 11:06:35.63] [status] tests: 1/1, fuzzing: 50084/50000, values: [0], cov: 48, corpus: 3
echidna_opt_foo: max value: 0
Call sequence:
(no transactions)


Unique instructions: 48
Unique codehashes: 1
Corpus size: 3
Seed: 4148347590236040080

@elopez elopez changed the title [Bug-Candidate]: Prelude.init: empty list while shrinking [Bug]: Prelude.init: empty list while shrinking Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants
@rappie @elopez and others