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]: Failed to convert IR to SSA for Initializable contract. #2491

Open
0xAlcibiades opened this issue Jun 22, 2024 · 2 comments
Labels
bug-candidate Bugs reports that are not yet confirmed

Comments

@0xAlcibiades
Copy link

Describe the issue:

When trying to run slither locally against a repo that works with slither actions v4 on github, I get a strange failure.

Code example to reproduce the issue:

Contract not public yet, but using solady Initializable, UUPSUpgradeable

Version:

0.10.3

Relevant log output:

/.solc-select/artifacts/solc-0.8.26/solc-0.8.26 forge-std/=lib/forge-std/src/ solady/=lib/solady/src/ src/Chaos.sol --combined-json abi,ast,bin,bin-runtime,srcmap,srcmap-runtime,userdoc,devdoc,hashes --optimize --optimize-runs 200 --via-ir --evm-version paris --allow-paths .,/Users/me/Code/MyProjects/warlock/warlock-chaos/src' running
ERROR:SlitherSolcParsing:
Failed to convert IR to SSA for Initializable contract. Please open an issue https://github.com/crytic/slither/issues.

Traceback (most recent call last):
  File "/opt/homebrew/bin/slither", line 8, in <module>
    sys.exit(main())
  File "/opt/homebrew/lib/python3.10/site-packages/slither/__main__.py", line 782, in main
    main_impl(all_detector_classes=detectors, all_printer_classes=printers)
  File "/opt/homebrew/lib/python3.10/site-packages/slither/__main__.py", line 888, in main_impl
    ) = process_all(filename, args, detector_classes, printer_classes)
  File "/opt/homebrew/lib/python3.10/site-packages/slither/__main__.py", line 113, in process_all
    ) = process_single(compilation, args, detector_classes, printer_classes)
  File "/opt/homebrew/lib/python3.10/site-packages/slither/__main__.py", line 80, in process_single
    slither = Slither(target, ast_format=ast, **vars(args))
  File "/opt/homebrew/lib/python3.10/site-packages/slither/slither.py", line 202, in __init__
    self._init_parsing_and_analyses(kwargs.get("skip_analyze", False))
  File "/opt/homebrew/lib/python3.10/site-packages/slither/slither.py", line 221, in _init_parsing_and_analyses
    raise e
  File "/opt/homebrew/lib/python3.10/site-packages/slither/slither.py", line 217, in _init_parsing_and_analyses
    parser.analyze_contracts()
  File "/opt/homebrew/lib/python3.10/site-packages/slither/solc_parsing/slither_compilation_unit_solc.py", line 593, in analyze_contracts
    self._convert_to_slithir()
  File "/opt/homebrew/lib/python3.10/site-packages/slither/solc_parsing/slither_compilation_unit_solc.py", line 834, in _convert_to_slithir
    raise e
  File "/opt/homebrew/lib/python3.10/site-packages/slither/solc_parsing/slither_compilation_unit_solc.py", line 829, in _convert_to_slithir
    contract.convert_expression_to_slithir_ssa()
  File "/opt/homebrew/lib/python3.10/site-packages/slither/core/declarations/contract.py", line 1577, in convert_expression_to_slithir_ssa
    func.generate_slithir_ssa(all_ssa_state_variables_instances)
  File "/opt/homebrew/lib/python3.10/site-packages/slither/core/declarations/function_contract.py", line 140, in generate_slithir_ssa
    add_ssa_ir(self, all_ssa_state_variables_instances)
  File "/opt/homebrew/lib/python3.10/site-packages/slither/slithir/utils/ssa.py", line 206, in add_ssa_ir
    fix_phi_rvalues_and_storage_ref(
  File "/opt/homebrew/lib/python3.10/site-packages/slither/slithir/utils/ssa.py", line 526, in fix_phi_rvalues_and_storage_ref
    fix_phi_rvalues_and_storage_ref(
  File "/opt/homebrew/lib/python3.10/site-packages/slither/slithir/utils/ssa.py", line 526, in fix_phi_rvalues_and_storage_ref
    fix_phi_rvalues_and_storage_ref(
  File "/opt/homebrew/lib/python3.10/site-packages/slither/slithir/utils/ssa.py", line 526, in fix_phi_rvalues_and_storage_ref
    fix_phi_rvalues_and_storage_ref(
  [Previous line repeated 4 more times]
  File "/opt/homebrew/lib/python3.10/site-packages/slither/slithir/utils/ssa.py", line 496, in fix_phi_rvalues_and_storage_ref
    variables = [
  File "/opt/homebrew/lib/python3.10/site-packages/slither/slithir/utils/ssa.py", line 497, in <listcomp>
    last_name(dst, ir.lvalue, init_local_variables_instances) for dst in ir.nodes
  File "/opt/homebrew/lib/python3.10/site-packages/slither/slithir/utils/ssa.py", line 363, in last_name
    assert candidates
AssertionError
@0xAlcibiades 0xAlcibiades added the bug-candidate Bugs reports that are not yet confirmed label Jun 22, 2024
@0xalpharush
Copy link
Contributor

Please see #2470 (comment) for a workaround

@0xAlcibiades
Copy link
Author

Great, thanks. Is that the general proposal for code with inline Yul?

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
Projects
None yet
Development

No branches or pull requests

2 participants