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]: Assertion failure in SSA generation #2072

Closed
kevinclancy opened this issue Aug 1, 2023 · 2 comments
Closed

[Bug-Candidate]: Assertion failure in SSA generation #2072

kevinclancy opened this issue Aug 1, 2023 · 2 comments
Labels
bug-candidate Bugs reports that are not yet confirmed duplicate This issue or pull request already exists

Comments

@kevinclancy
Copy link
Contributor

kevinclancy commented Aug 1, 2023

Describe the issue:

When I run slither on a small contract involving loops, conditionals, and reverts, an assertion in SSA generation fails.

Code example to reproduce the issue:

contract Test {
    bool z;
    function test() external returns (uint256) {
        if (z) {
            for (;;) {
                revert("");
            }
            revert("");
        }
        revert("");
    }
}

Version:

0.9.6

Relevant log output:

ERROR:root:Traceback (most recent call last):
  File "/Users/kevin.clancy/.pyenv/versions/3.9.13/lib/python3.9/site-packages/slither/__main__.py", line 814, in main_impl
    ) = process_all(filename, args, detector_classes, printer_classes)
  File "/Users/kevin.clancy/.pyenv/versions/3.9.13/lib/python3.9/site-packages/slither/__main__.py", line 102, in process_all
    ) = process_single(compilation, args, detector_classes, printer_classes)
  File "/Users/kevin.clancy/.pyenv/versions/3.9.13/lib/python3.9/site-packages/slither/__main__.py", line 80, in process_single
    slither = Slither(target, ast_format=ast, **vars(args))
  File "/Users/kevin.clancy/.pyenv/versions/3.9.13/lib/python3.9/site-packages/slither/slither.py", line 135, in __init__
    self._init_parsing_and_analyses(kwargs.get("skip_analyze", False))
  File "/Users/kevin.clancy/.pyenv/versions/3.9.13/lib/python3.9/site-packages/slither/slither.py", line 155, in _init_parsing_and_analyses
    raise e
  File "/Users/kevin.clancy/.pyenv/versions/3.9.13/lib/python3.9/site-packages/slither/slither.py", line 151, in _init_parsing_and_analyses
    parser.analyze_contracts()
  File "/Users/kevin.clancy/.pyenv/versions/3.9.13/lib/python3.9/site-packages/slither/solc_parsing/slither_compilation_unit_solc.py", line 541, in analyze_contracts
    self._convert_to_slithir()
  File "/Users/kevin.clancy/.pyenv/versions/3.9.13/lib/python3.9/site-packages/slither/solc_parsing/slither_compilation_unit_solc.py", line 774, in _convert_to_slithir
    raise e
  File "/Users/kevin.clancy/.pyenv/versions/3.9.13/lib/python3.9/site-packages/slither/solc_parsing/slither_compilation_unit_solc.py", line 769, in _convert_to_slithir
    contract.convert_expression_to_slithir_ssa()
  File "/Users/kevin.clancy/.pyenv/versions/3.9.13/lib/python3.9/site-packages/slither/core/declarations/contract.py", line 1502, in convert_expression_to_slithir_ssa
    func.generate_slithir_ssa(all_ssa_state_variables_instances)
  File "/Users/kevin.clancy/.pyenv/versions/3.9.13/lib/python3.9/site-packages/slither/core/declarations/function_contract.py", line 134, in generate_slithir_ssa
    compute_dominance_frontier(self.nodes)
  File "/Users/kevin.clancy/.pyenv/versions/3.9.13/lib/python3.9/site-packages/slither/core/dominators/utils.py", line 98, in compute_dominance_frontier
    assert runner.immediate_dominator
AssertionError
@kevinclancy kevinclancy added the bug-candidate Bugs reports that are not yet confirmed label Aug 1, 2023
@smonicas
Copy link
Contributor

smonicas commented Aug 1, 2023

Probably same as #1973

@0xalpharush 0xalpharush added the duplicate This issue or pull request already exists label Aug 2, 2023
@0xalpharush
Copy link
Contributor

Closed by #1984

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-candidate Bugs reports that are not yet confirmed duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants