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]: slither hangs on a complicated test program #2619

Open
haoyang9804 opened this issue Dec 24, 2024 · 0 comments
Open

[Bug-Candidate]: slither hangs on a complicated test program #2619

haoyang9804 opened this issue Dec 24, 2024 · 0 comments
Labels
bug-candidate Bugs reports that are not yet confirmed

Comments

@haoyang9804
Copy link

Describe the issue:

slither hangs after showing some error messages

Code example to reproduce the issue:

contract contract0 {
  error error2(int64[] array3);

  event event1();

  struct struct5 {
    string var6;
    bool var7;
  }

  bool internal var8;
  mapping(int64 => int64) internal mapping18;

  modifier modifier9(int64 var10) {
    struct5 memory struct_instance11;
    struct_instance11 = struct_instance11;
    ((bool(true)) && struct_instance11.var7);
    _;
  }

  function func12() internal modifier9(int64(-0)) returns (int64 var13, mapping(int64 => int64) storage mapping14) {
    mapping14 = mapping14;
    while ((var8)) {}
    return (int64(-0), mapping18);
  }

  function func17() internal modifier9(int64(-0)) {
    if (mapping18[int64(-0)] < int64(-0)) {
      (mapping18[int64(-0)] *= (int64(-0)));
    } else {}
    return ();
  }
}

contract contract21 {
  error error23();

  event event22();

  bool internal var24;
  contract0.struct5[][5] internal array25;
  contract0 internal contract_instance40;
  mapping(string => int64[]) internal mapping43;

  modifier modifier30() {
    contract0.struct5 memory struct_instance31;
    struct_instance31 = struct_instance31;
    while ((struct_instance31.var7 ? var24 : var24)) {}
    _;
  }

  modifier modifier32(contract0 contract_instance33) {
    while (var24 ? false : var24) {}
    _;
  }

  constructor() modifier30() {
    int64 var41;
    (-var41);
  }

  function func34() internal modifier32(contract_instance40) modifier30() returns (mapping(string => int64[]) storage mapping35, uint64 var39) {
    mapping35 = mapping35;
    uint64 var42;
    if ((var42 == var42)) {
      var42 << (var42);
    } else {
      emit event22();
    }
    return (mapping43, (++(var42)));
  }
}

Version:

0.10.4

Relevant log output:

INFO:Detectors:
contract21.var24 (program_2024-12-24_0:49:0_0.sol#40) is never initialized. It is used in:
contract21.contract_instance40 (program_2024-12-24_0:49:0_0.sol#42) is never initialized. It is used in:
	- contract21.func34() (program_2024-12-24_0:49:0_0.sol#62-71)
contract21.mapping43 (program_2024-12-24_0:49:0_0.sol#43) is never initialized. It is used in:
	- contract21.func34() (program_2024-12-24_0:49:0_0.sol#62-71)
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#uninitialized-state-variables
INFO:Detectors:
contract0.func12().mapping14 (program_2024-12-24_0:49:0_0.sol#21) is a storage variable never initialized
contract21.func34().mapping35 (program_2024-12-24_0:49:0_0.sol#62) is a storage variable never initialized
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#uninitialized-storage-variables
INFO:Detectors:
contract21.func34() (program_2024-12-24_0:49:0_0.sol#62-71) compares a variable to itself:
	(var42 == var42) (program_2024-12-24_0:49:0_0.sol#65)
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#tautological-compare
INFO:Detectors:
contract21.func34().var42 (program_2024-12-24_0:49:0_0.sol#64) is a local variable never initialized
contract21.constructor().var41 (program_2024-12-24_0:49:0_0.sol#58) is a local variable never initialized
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#uninitialized-local-variables
@haoyang9804 haoyang9804 added the bug-candidate Bugs reports that are not yet confirmed label Dec 24, 2024
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

1 participant