crytic / slither-action

GNU Affero General Public License v3.0
128 stars 20 forks source link

Slither returns Key 1598 error #47

Closed distributedstatemachine closed 7 months ago

distributedstatemachine commented 1 year ago

I get the following error which i cannot deciper and will appreciate help with

Error in solidity/khalani-core
Traceback (most recent call last):
  File "/opt/slither/lib/python3.9/site-packages/slither/__main__.py", line 826, in main_impl
    ) = process_all(filename, args, detector_classes, printer_classes)
  File "/opt/slither/lib/python3.9/site-packages/slither/__main__.py", line 97, in process_all
    ) = process_single(compilation, args, detector_classes, printer_classes)
  File "/opt/slither/lib/python3.9/site-packages/slither/__main__.py", line 75, in process_single
    slither = Slither(target, ast_format=ast, **vars(args))
  File "/opt/slither/lib/python3.9/site-packages/slither/slither.py", line 125, in __init__
    parser.parse_contracts()
  File "/opt/slither/lib/python3.9/site-packages/slither/solc_parsing/slither_compilation_unit_solc.py", line 482, in parse_contracts
    self._analyze_first_part(contracts_to_be_analyzed, libraries)
  File "/opt/slither/lib/python3.9/site-packages/slither/solc_parsing/slither_compilation_unit_solc.py", line 543, in _analyze_first_part
    self._parse_struct_var_modifiers_functions(contract)
  File "/opt/slither/lib/python3.9/site-packages/slither/solc_parsing/slither_compilation_unit_solc.py", line 612, in _parse_struct_var_modifiers_functions
    contract.parse_state_variables()
  File "/opt/slither/lib/python3.9/site-packages/slither/solc_parsing/declarations/contract.py", line 337, in parse_state_variables
    var.set_offset(varNotParsed["src"], self._contract.compilation_unit)
  File "/opt/slither/lib/python3.9/site-packages/slither/core/source_mapping/source_mapping.py", line 184, in set_offset
    self.source_mapping = _convert_source_mapping(offset, compilation_unit)
  File "/opt/slither/lib/python3.9/site-packages/slither/core/source_mapping/source_mapping.py", line 150, in _convert_source_mapping
    (lines, starting_column, ending_column) = _compute_line(compilation_unit, filename, s, l)
  File "/opt/slither/lib/python3.9/site-packages/slither/core/source_mapping/source_mapping.py", line 111, in _compute_line
    end_line, ending_column = compilation_unit.core.crytic_compile.get_line_from_offset(
  File "/opt/slither/lib/python3.9/site-packages/crytic_compile/crytic_compile.py", line 291, in get_line_from_offset
    return lines_delimiters[offset]
KeyError: 1598
elopez commented 1 year ago

Hi @samtvlabs, thanks for the report. Can you try again and let us know if this happens with slither 0.9.2?

elopez commented 7 months ago

Closing due to inactivity, feel free to report it again on https://github.com/crytic/slither if this still happens on the latest release.