slither icon indicating copy to clipboard operation
slither copied to clipboard

Getting "Error: running slither:" problem

Open BarrySauce opened this issue 2 years ago • 2 comments

Describe the issue:

I get this problem when I ran Echidna. The error shows below:

171268023-9ceb9519-9a8d-4b2b-8fa4-53e64521de27

May I know the possible reasons for Slither to output such kind of error?

I have already opened an issue in the Echidna repository: https://github.com/crytic/echidna/issues/777

And they suggested me open an issue in the slither repository.

Code example to reproduce the issue:

The contract complied shows below:

Screenshot 2022-06-13 at 11 10 38 AM

Version:

I tried slither 0.8.1, 0.8.3, both failed. Currently I am using python 3.7

Relevant log output:

No response

BarrySauce avatar Jun 13 '22 03:06 BarrySauce

Can you show the output of running slither . (leaving Echidna aside) on the codebase?

0xalpharush avatar Jun 17 '22 23:06 0xalpharush

I might be able to help as im running into the same issue

root@2479146766b2:/echidna/src# echidna-test maticfee.sol --solc-args="optimize optimize-runs=200" --sender=0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA --contract Fee
Analyzing contract: /echidna/src/Fee.sol:Fee
echidna-test: Error running slither:

root@2479146766b2:/echidna/src# slither .
Compilation warnings/errors on ./ContractData.sol:
Compiler error: Stack too deep when compiling inline assembly: Variable value0 is 1 slot(s) too deep inside the stack.


Traceback (most recent call last):
  File "/root/.local/lib/python3.6/site-packages/crytic_compile/platform/solc.py", line 544, in _run_solc
    ret: Dict = json.loads(stdout)
  File "/usr/lib/python3.6/json/__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.6/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.6/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/root/.local/lib/python3.6/site-packages/slither/__main__.py", line 744, in main_impl
    ) = process_all(filename, args, detector_classes, printer_classes)
  File "/root/.local/lib/python3.6/site-packages/slither/__main__.py", line 76, in process_all
    compilations = compile_all(target, **vars(args))
  File "/root/.local/lib/python3.6/site-packages/crytic_compile/crytic_compile.py", line 658, in compile_all
    compilations.append(CryticCompile(filename, **kwargs))
  File "/root/.local/lib/python3.6/site-packages/crytic_compile/crytic_compile.py", line 117, in __init__
    self._compile(**kwargs)
  File "/root/.local/lib/python3.6/site-packages/crytic_compile/crytic_compile.py", line 548, in _compile
    self._platform.compile(self, **kwargs)
  File "/root/.local/lib/python3.6/site-packages/crytic_compile/platform/solc.py", line 154, in compile
    targets_json = _get_targets_json(compilation_unit, self._target, **kwargs)
  File "/root/.local/lib/python3.6/site-packages/crytic_compile/platform/solc.py", line 284, in _get_targets_json
    force_legacy_json=force_legacy_json,
  File "/root/.local/lib/python3.6/site-packages/crytic_compile/platform/solc.py", line 548, in _run_solc
    raise InvalidCompilation(f"Invalid solc compilation {stderr}")
crytic_compile.platform.exceptions.InvalidCompilation: Invalid solc compilation Compiler error: Stack too deep when compiling inline assembly: Variable value0 is 1 slot(s) too deep inside the stack.


None
Error in .
Traceback (most recent call last):
  File "/root/.local/lib/python3.6/site-packages/crytic_compile/platform/solc.py", line 544, in _run_solc
    ret: Dict = json.loads(stdout)
  File "/usr/lib/python3.6/json/__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.6/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.6/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/root/.local/lib/python3.6/site-packages/slither/__main__.py", line 744, in main_impl
    ) = process_all(filename, args, detector_classes, printer_classes)
  File "/root/.local/lib/python3.6/site-packages/slither/__main__.py", line 76, in process_all
    compilations = compile_all(target, **vars(args))
  File "/root/.local/lib/python3.6/site-packages/crytic_compile/crytic_compile.py", line 658, in compile_all
    compilations.append(CryticCompile(filename, **kwargs))
  File "/root/.local/lib/python3.6/site-packages/crytic_compile/crytic_compile.py", line 117, in __init__
    self._compile(**kwargs)
  File "/root/.local/lib/python3.6/site-packages/crytic_compile/crytic_compile.py", line 548, in _compile
    self._platform.compile(self, **kwargs)
  File "/root/.local/lib/python3.6/site-packages/crytic_compile/platform/solc.py", line 154, in compile
    targets_json = _get_targets_json(compilation_unit, self._target, **kwargs)
  File "/root/.local/lib/python3.6/site-packages/crytic_compile/platform/solc.py", line 284, in _get_targets_json
    force_legacy_json=force_legacy_json,
  File "/root/.local/lib/python3.6/site-packages/crytic_compile/platform/solc.py", line 548, in _run_solc
    raise InvalidCompilation(f"Invalid solc compilation {stderr}")
crytic_compile.platform.exceptions.InvalidCompilation: Invalid solc compilation Compiler error: Stack too deep when compiling inline assembly: Variable value0 is 1 slot(s) too deep inside the stack.

JABirchall avatar Aug 10 '22 19:08 JABirchall

If you're having issues still, please open an issue with the output of slither-doctor ..

0xalpharush avatar Jan 11 '23 18:01 0xalpharush