crytic/echidna

[Bug-Candidate]: setupTerm: Couldn't look up terminfo entry "xterm-256color" in v2.2.2

viper7882 opened this issue · 5 comments

Describe the issue:

The same virtual environment was working back in v2.2.1 and apparently broken in v2.2.2. All I did was simply upgrade echidna from v2.2.1 to v2.2.2 where v2.2.1 version renamed to echidna_v2.2.1

The error occurs after Running slither on and halted at echidna: setupTerm: Couldn't look up terminfo entry "xterm-256color"

The relevant log below is a result of switching between the two versions over the same contract and same environment.

Code example to reproduce the issue:

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

/*
echidna TestEchidna.sol --contract TestCounter
*/
contract Counter {
uint public count;

function inc() external {
    count += 1;
}

function dec() external {
    count -= 1;
}

}

contract TestCounter is Counter {
function echidna_test_true() public view returns (bool) {
return true;
}

function echidna_test_false() public view returns (bool) {
    return false;
}

function echidna_test_count() public view returns (bool) {
    // Here we are testing that Counter.count should always be <= 5.
    // Test will fail. Echidna is smart enough to call Counter.inc() more
    // than 5 times.
    return count <= 5;
}

}

Version:

echidna --version
Echidna 2.2.2
slither --version
0.10.0

Additional detail of environment:
Windows 11 WSL2 Ubuntu 22.04.2 LTS
PyCharm 2023.3.3 (Community Edition)
Virtual Environment (venv)

Relevant log output:

Observed:
echidna ./TestEchidna.sol --contract TestCounter
Compiling ./TestEchidna.sol... Done! (0.291617561s)
Analyzing contract: ./TestEchidna.sol:TestCounter
Running slither on ./TestEchidna.sol... Done! (0.522016266s)
echidna: setupTerm: Couldn't look up terminfo entry "xterm-256color" => Problem

Expected:
echidna_v2.2.1 ./TestEchidna.sol --contract TestCounter
Compiling ./TestEchidna.sol... Done! (0.292887755s)
Analyzing contract: ./TestEchidna.sol:TestCounter
Running slither on ./TestEchidna.sol... Done! (0.525188319s)
echidna_test_count: failed!💥  
  Call sequence:
    inc()
    inc()
    inc()
    inc()
    inc()
    inc()


echidna_test_false: failed with no transactions made ⁉️  
echidna_test_true: passing


Unique instructions: 245
Unique codehashes: 1
Corpus size: 5
Seed: 4522597650411972567

Related: #1135

In v2.2.1, intermittently I've encountered into this error but in v2.2.2, the rate to reproduce is 100%. I'm totally gated by this error unless someone could share with me how to workaround.

Hi, thanks for the report @viper7882! Does it also happen if you pass --format text to echidna?

Does it help if you first run the following export command, and then use echidna on that same terminal?

export TERMINFO=/usr/lib/terminfo

echidna ./TestEchidna.sol --contract TestCounter

If that helps, would you mind testing the Linux binary from this CI run and see if it resolves the issue? https://github.com/crytic/echidna/actions/runs/7800327039

Hi @elopez ,

--format text helps as it turns off the dashboard.

export TERMINFO=/usr/lib/terminfo

echidna ./TestEchidna.sol --contract TestCounter

working as well.

Reset the earlier environment first,

export TERMINFO=

and then run https://github.com/crytic/echidna/actions/runs/7800327039.

Congratulations! https://github.com/crytic/echidna/actions/runs/7800327039 is working.

I trust we are good to close this issue.

@elopez could be this related? https://bugzilla.redhat.com/show_bug.cgi?id=1357981 I'm getting this issue when running echidna inside screen.