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

Echidna command-line fails on Debian #9

Closed
yoavw opened this issue Mar 8, 2018 · 7 comments
Closed

Echidna command-line fails on Debian #9

yoavw opened this issue Mar 8, 2018 · 7 comments

Comments

@yoavw
Copy link

yoavw commented Mar 8, 2018

It fails with the following error:

`

~/.local/bin/echidna-test solidity/cli.sol

echidna-test: : commitBuffer: invalid argument (invalid character)

uname -a

Linux core 3.16.0-4-amd64 #1 SMP Debian 3.16.39-1+deb8u2 (2017-03-07) x86_64 GNU/Linux
`

(we talked about this at the workshop at ETHCC)

@japesinator
Copy link
Contributor

This looks like some kind of a locale issue that's causing echidna to choke when trying to print UTF-8. Can you try with the below code for Main.hs?

{-# LANGUAGE LambdaCase #-}

module Main where

import GHC.IO.Encoding (setLocaleEncoding, utf8)
import Hedgehog hiding (checkParallel)
import Hedgehog.Internal.Property (GroupName(..), PropertyName(..))
import System.Environment         (getArgs)

import Echidna.Exec
import Echidna.Solidity

main :: IO ()
main = setLocaleEncoding utf8 >> getArgs >>= \case
  []  -> putStrLn "Please provide a solidity file to analyze"
  f:_ -> do
    (v,a,ts) <- loadSolidity f
    let prop t = (PropertyName $ show t, ePropertySeq v a (`checkETest` t) 10)
    _ <- checkParallel . Group (GroupName f) $ map prop ts
    return ()

@yoavw
Copy link
Author

yoavw commented Mar 13, 2018

Unfortunately I no longer have the machine where it occurred. I'll try to reproduce it on another host and let you know.

@hiqua
Copy link

hiqua commented Mar 20, 2018

No problem for me on Debian Stretch.

@japesinator
Copy link
Contributor

I'm gonna close for now as I'm unable to reproduce. If this happens again, try the code I linked and lmk how it works, I'll modify the actual codebase based on that.

@lazzarello
Copy link
Contributor

I can reproduce this. It's a quick fix regarding locales. I'll put together a PR for the Dockerfile and some doc updates, since it isn't a problem with the application code.

@lazzarello
Copy link
Contributor

Fixed in #20

@lastperson
Copy link

lastperson commented Jan 10, 2019

I have this same problem with the following contract:

pragma solidity 0.4.16;

contract EchidnaBT {
    bool public val = true;

    function set(bool _val) public {
        val = _val;
    }

    function echidna_test() public returns(bool) {
	    return val;
    }
}

with latest echidna docker container, on Ubuntu 18.04. Any suggestions?

Linux oleksii-VirtualBox 4.15.0-43-generic #46-Ubuntu SMP Thu Dec 6 14:45:28 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

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

No branches or pull requests

5 participants