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. #2552

Closed
RegisGraptin opened this issue Sep 11, 2024 · 3 comments
Closed
Labels
bug-candidate Bugs reports that are not yet confirmed

Comments

@RegisGraptin
Copy link

Describe the issue:

I am running slither . on my project and run into the following issue (see logs section). Do not hesitate to tell me if I can provide additional information.

Code example to reproduce the issue:

Cannot share it at the moment. Will need to investigate which contract causes the issue and obfuscate some parts.

Version:

0.10.4

Relevant log output:

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 "/.../.pyenv/versions/3.12.4/bin/slither", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/.../.pyenv/versions/3.12.4/lib/python3.12/site-packages/slither/__main__.py", line 776, in main
    main_impl(all_detector_classes=detectors, all_printer_classes=printers)
  File "/.../.pyenv/versions/3.12.4/lib/python3.12/site-packages/slither/__main__.py", line 882, in main_impl
    ) = process_all(filename, args, detector_classes, printer_classes)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/.../.pyenv/versions/3.12.4/lib/python3.12/site-packages/slither/__main__.py", line 107, in process_all
    ) = process_single(compilation, args, detector_classes, printer_classes)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/.../.pyenv/versions/3.12.4/lib/python3.12/site-packages/slither/__main__.py", line 80, in process_single
    slither = Slither(target, ast_format=ast, **vars(args))
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/.../.pyenv/versions/3.12.4/lib/python3.12/site-packages/slither/slither.py", line 202, in __init__
    self._init_parsing_and_analyses(kwargs.get("skip_analyze", False))
  File "/.../.pyenv/versions/3.12.4/lib/python3.12/site-packages/slither/slither.py", line 221, in _init_parsing_and_analyses
    raise e
  File "/.../.pyenv/versions/3.12.4/lib/python3.12/site-packages/slither/slither.py", line 217, in _init_parsing_and_analyses
    parser.analyze_contracts()
  File "/.../.pyenv/versions/3.12.4/lib/python3.12/site-packages/slither/solc_parsing/slither_compilation_unit_solc.py", line 593, in analyze_contracts
    self._convert_to_slithir()
  File "/.../.pyenv/versions/3.12.4/lib/python3.12/site-packages/slither/solc_parsing/slither_compilation_unit_solc.py", line 834, in _convert_to_slithir
    raise e
  File "/.../.pyenv/versions/3.12.4/lib/python3.12/site-packages/slither/solc_parsing/slither_compilation_unit_solc.py", line 829, in _convert_to_slithir
    contract.convert_expression_to_slithir_ssa()
  File "/.../.pyenv/versions/3.12.4/lib/python3.12/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 "/.../.pyenv/versions/3.12.4/lib/python3.12/site-packages/slither/core/declarations/function_contract.py", line 140, in generate_slithir_ssa
    add_ssa_ir(self, all_ssa_state_variables_instances)
  File "/.../.pyenv/versions/3.12.4/lib/python3.12/site-packages/slither/slithir/utils/ssa.py", line 206, in add_ssa_ir
    fix_phi_rvalues_and_storage_ref(
  File "/.../.pyenv/versions/3.12.4/lib/python3.12/site-packages/slither/slithir/utils/ssa.py", line 526, in fix_phi_rvalues_and_storage_ref
    fix_phi_rvalues_and_storage_ref(
  File "/.../.pyenv/versions/3.12.4/lib/python3.12/site-packages/slither/slithir/utils/ssa.py", line 526, in fix_phi_rvalues_and_storage_ref
    fix_phi_rvalues_and_storage_ref(
  File "/.../.pyenv/versions/3.12.4/lib/python3.12/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 "/.../.pyenv/versions/3.12.4/lib/python3.12/site-packages/slither/slithir/utils/ssa.py", line 497, in fix_phi_rvalues_and_storage_ref
    last_name(dst, ir.lvalue, init_local_variables_instances) for dst in ir.nodes
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/.../.pyenv/versions/3.12.4/lib/python3.12/site-packages/slither/slithir/utils/ssa.py", line 363, in last_name
    assert candidates
           ^^^^^^^^^^
AssertionError
@RegisGraptin RegisGraptin added the bug-candidate Bugs reports that are not yet confirmed label Sep 11, 2024
@smonicas
Copy link
Contributor

Likely duplicate of #2491, try the same workaround mentioned there. TLDR add --skip-assembly when running slither.

@RegisGraptin
Copy link
Author

@smonicas Thanks the --skip-assembly seems to unlock the situation.
Should have try to looked at similar issue first before posting it 😅

@smonicas
Copy link
Contributor

Closing this as it's a duplicate

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