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-Candidate]: setupTerm: Couldn't look up terminfo entry "xterm-256color" in v2.2.2 #1185

Closed
viper7882 opened this issue Feb 3, 2024 · 5 comments · Fixed by #1187
Closed

Comments

@viper7882
Copy link

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
@viper7882 viper7882 changed the title [Bug-Candidate]: setupTerm: Couldn't look up terminfo entry "xterm-256color" [Bug-Candidate]: setupTerm: Couldn't look up terminfo entry "xterm-256color" in v2.2.2 Feb 3, 2024
@rappie
Copy link

rappie commented Feb 3, 2024

Related: #1135

@viper7882
Copy link
Author

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.

@elopez
Copy link
Member

elopez commented Feb 6, 2024

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

elopez added a commit that referenced this issue Feb 6, 2024
Some distros have terminfo on /usr/lib/terminfo, like Ubuntu.
Others have them on /usr/share/terminfo, like Fedora. Include
all possible paths to be as compatible as possible.

Closes #1185
@viper7882
Copy link
Author

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 added a commit that referenced this issue Feb 6, 2024
Some distros have terminfo on /usr/lib/terminfo, like Ubuntu.
Others have them on /usr/share/terminfo, like Fedora. Include
all possible paths to be as compatible as possible.

Closes #1185
@ggrieco-tob
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants