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

Add a flag to disable slither integration #646

Closed
ggrieco-tob opened this issue Apr 21, 2021 · 6 comments · Fixed by #1159
Closed

Add a flag to disable slither integration #646

ggrieco-tob opened this issue Apr 21, 2021 · 6 comments · Fixed by #1159

Comments

@ggrieco-tob
Copy link
Member

We have a vyper workaround that skips slither but ideally we want allow the user to disable slither if it fails for some reason.

@avniculae
Copy link

avniculae commented Apr 13, 2023

Hey @ggrieco-tob! Echidna fails in my case with the following message echidna: Error running slither: (no text after colon). What's the current solution for disabling Slither in Echidna for a Solidity codebase? As a side note, I'm not sure why Slither fails to be honest -- it worked well until I've brought in another contract into the fuzzing harness.

@ggrieco-tob
Copy link
Member Author

Hi, please use slither . --print echidna to see the full output of the command and let us know the error.

@avniculae
Copy link

avniculae commented Apr 13, 2023

Thanks for your quick reply @ggrieco-tob! Here's the full error output.

Error Traceback
'forge clean' running (wd: /path/.../)
'forge build --build-info --force' running
Compiling 150 files with 0.8.17
Solc 0.8.17 finished in 11.69s
Compiler run successful (with warnings)
[...warning info printed...]

Traceback (most recent call last):
  File "/opt/homebrew/Cellar/slither-analyzer/0.9.3/libexec/lib/python3.11/site-packages/slither/__main__.py", line 837, in main_impl
    ) = process_all(filename, args, detector_classes, printer_classes)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/slither-analyzer/0.9.3/libexec/lib/python3.11/site-packages/slither/__main__.py", line 101, in process_all
    ) = process_single(compilation, args, detector_classes, printer_classes)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/slither-analyzer/0.9.3/libexec/lib/python3.11/site-packages/slither/__main__.py", line 79, in process_single
    slither = Slither(target, ast_format=ast, **vars(args))
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/slither-analyzer/0.9.3/libexec/lib/python3.11/site-packages/slither/slither.py", line 135, in __init__
    self._init_parsing_and_analyses(kwargs.get("skip_analyze", False))
  File "/opt/homebrew/Cellar/slither-analyzer/0.9.3/libexec/lib/python3.11/site-packages/slither/slither.py", line 155, in _init_parsing_and_analyses
    raise e
  File "/opt/homebrew/Cellar/slither-analyzer/0.9.3/libexec/lib/python3.11/site-packages/slither/slither.py", line 151, in _init_parsing_and_analyses
    parser.analyze_contracts()
  File "/opt/homebrew/Cellar/slither-analyzer/0.9.3/libexec/lib/python3.11/site-packages/slither/solc_parsing/slither_compilation_unit_solc.py", line 528, in analyze_contracts
    self._convert_to_slithir()
  File "/opt/homebrew/Cellar/slither-analyzer/0.9.3/libexec/lib/python3.11/site-packages/slither/solc_parsing/slither_compilation_unit_solc.py", line 739, in _convert_to_slithir
    func.generate_slithir_and_analyze()
  File "/opt/homebrew/Cellar/slither-analyzer/0.9.3/libexec/lib/python3.11/site-packages/slither/core/declarations/function.py", line 1761, in generate_slithir_and_analyze
    node.slithir_generation()
  File "/opt/homebrew/Cellar/slither-analyzer/0.9.3/libexec/lib/python3.11/site-packages/slither/core/cfg/node.py", line 681, in slithir_generation
    self._find_read_write_call()
  File "/opt/homebrew/Cellar/slither-analyzer/0.9.3/libexec/lib/python3.11/site-packages/slither/core/cfg/node.py", line 879, in _find_read_write_call
    assert isinstance(ir.function, Function)
AssertionError
ERROR:root:Error in .
ERROR:root:Traceback (most recent call last):
  File "/opt/homebrew/Cellar/slither-analyzer/0.9.3/libexec/lib/python3.11/site-packages/slither/__main__.py", line 837, in main_impl
    ) = process_all(filename, args, detector_classes, printer_classes)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/slither-analyzer/0.9.3/libexec/lib/python3.11/site-packages/slither/__main__.py", line 101, in process_all
    ) = process_single(compilation, args, detector_classes, printer_classes)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/slither-analyzer/0.9.3/libexec/lib/python3.11/site-packages/slither/__main__.py", line 79, in process_single
    slither = Slither(target, ast_format=ast, **vars(args))
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/slither-analyzer/0.9.3/libexec/lib/python3.11/site-packages/slither/slither.py", line 135, in __init__
    self._init_parsing_and_analyses(kwargs.get("skip_analyze", False))
  File "/opt/homebrew/Cellar/slither-analyzer/0.9.3/libexec/lib/python3.11/site-packages/slither/slither.py", line 155, in _init_parsing_and_analyses
    raise e
  File "/opt/homebrew/Cellar/slither-analyzer/0.9.3/libexec/lib/python3.11/site-packages/slither/slither.py", line 151, in _init_parsing_and_analyses
    parser.analyze_contracts()
  File "/opt/homebrew/Cellar/slither-analyzer/0.9.3/libexec/lib/python3.11/site-packages/slither/solc_parsing/slither_compilation_unit_solc.py", line 528, in analyze_contracts
    self._convert_to_slithir()
  File "/opt/homebrew/Cellar/slither-analyzer/0.9.3/libexec/lib/python3.11/site-packages/slither/solc_parsing/slither_compilation_unit_solc.py", line 739, in _convert_to_slithir
    func.generate_slithir_and_analyze()
  File "/opt/homebrew/Cellar/slither-analyzer/0.9.3/libexec/lib/python3.11/site-packages/slither/core/declarations/function.py", line 1761, in generate_slithir_and_analyze
    node.slithir_generation()
  File "/opt/homebrew/Cellar/slither-analyzer/0.9.3/libexec/lib/python3.11/site-packages/slither/core/cfg/node.py", line 681, in slithir_generation
    self._find_read_write_call()
  File "/opt/homebrew/Cellar/slither-analyzer/0.9.3/libexec/lib/python3.11/site-packages/slither/core/cfg/node.py", line 879, in _find_read_write_call
    assert isinstance(ir.function, Function)
AssertionError

I should also mention that I can successfully compile and run the fuzzing harness with Foundry.

@avniculae
Copy link

Hey @ggrieco-tob! Would you please be able to point me to how I can disable slither in echidna? I think the issue I'm encountering might be related to this one crytic/slither#1622.

@ggrieco-tob
Copy link
Member Author

This is still not implemented, the main reason is that we absolutely need slither to make sure echidna is effective in the code exploration but we can implement a workaround. @arcz can you take a look to this?

@avniculae
Copy link

Oh I see, I didn't know slither plays an important role in your fuzzing engine. It would be great if the bug could be fixed in slither so that the efficiency of code exploration is not compromised, but I'm not sure how much work this would entail @arcz.

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

Successfully merging a pull request may close this issue.

3 participants