slither icon indicating copy to clipboard operation
slither copied to clipboard

[Bug-Candidate]: infinite loop in `data_dependency.py`

Open rmi7 opened this issue 4 years ago • 1 comments

Describe the issue:

Slither seems to never quit. Hitting Ctrl-C will show the below output. Possibly highlighting an infinite loop.

Code example to reproduce the issue:

slither 0x66017D22b0f8556afDd19FC67041899Eb65a21bb

Version:

dev branch on commit 5fd5d4f6ce960693404147e6e5edbec2f82824fa

Relevant log output:

Traceback (most recent call last):
  File "/Users/rmi7/.virtualenvs/venv1/bin/slither", line 33, in <module>
    sys.exit(load_entry_point('slither-analyzer', 'console_scripts', 'slither')())
  File "/Users/rmi7/Tools/slither/slither/__main__.py", line 632, in main
    main_impl(all_detector_classes=detectors, all_printer_classes=printers)
  File "/Users/rmi7/Tools/slither/slither/__main__.py", line 744, in main_impl
    ) = process_all(filename, args, detector_classes, printer_classes)
  File "/Users/rmi7/Tools/slither/slither/__main__.py", line 87, in process_all
    ) = process_single(compilation, args, detector_classes, printer_classes)
  File "/Users/rmi7/Tools/slither/slither/__main__.py", line 70, in process_single
    slither = Slither(target, ast_format=ast, **vars(args))
  File "/Users/rmi7/Tools/slither/slither/slither.py", line 123, in __init__
    parser.analyze_contracts()
  File "/Users/rmi7/Tools/slither/slither/solc_parsing/slither_compilation_unit_solc.py", line 445, in analyze_contracts
    compute_dependency(self._compilation_unit)
  File "/Users/rmi7/Tools/slither/slither/analyses/data_dependency/data_dependency.py", line 295, in compute_dependency
    compute_dependency_contract(contract, compilation_unit)
  File "/Users/rmi7/Tools/slither/slither/analyses/data_dependency/data_dependency.py", line 318, in compute_dependency_contract
    propagate_contract(contract, KEY_SSA, KEY_NON_SSA)
  File "/Users/rmi7/Tools/slither/slither/analyses/data_dependency/data_dependency.py", line 361, in propagate_contract
    transitive_close_dependencies(contract, context_key, context_key_non_ssa)
  File "/Users/rmi7/Tools/slither/slither/analyses/data_dependency/data_dependency.py", line 344, in transitive_close_dependencies
    [  # pylint: disable=expression-not-assigned
  File "/Users/rmi7/Tools/slither/slither/analyses/data_dependency/data_dependency.py", line 345, in <listcomp>
    [
  File "/Users/rmi7/Tools/slither/slither/analyses/data_dependency/data_dependency.py", line 346, in <listcomp>
    to_add[key].update(context.context[context_key][item] - {key} - items)

rmi7 avatar Mar 17 '22 14:03 rmi7

This is still an issue in 0.11.3. Tested with: slither 0x250893CA4Ba5d05626C785e8da758026928FCD24

gustavo-grieco avatar Jul 09 '25 09:07 gustavo-grieco