argotorg / argotorg/solidity

SMTChecker:the description of model-checker-timeout does not match the actual behavior.

Open
#15,609 0 comments 0 reactions 0 assignees View on GitHub
documentation :book:
Dominant language
C++
Stars
25.7k
Forks
6.2k
Avg merge
2d 19h
Merged PRs (30d)
29

Description

The model-checker-timeout does not match the description. If I set it to 5 seconds, the actual program runtime could be 10 seconds.

test.sol
```solidity
contract BugDetection {
struct Data {
uint256 value;
}
Data private data;
function initialize(uint256 initialValue) public {
data = Data(initialValue);
checkLiveness();
}
function checkLiveness() private view {
assert(data.value > 0 || data.value < 0); // Contradictory assertion
}
function modifyValue(uint256 newValue) public {
data.value = newValue;
bitwiseOperationCheck();
}
function bitwiseOperationCheck() internal view {
uint256 calculatedValue = data.value & 0xffffffffffffffffffffffffffffffff; // Intentionally incorrect bitwise operation
assert(calculatedValue == data.value);
}
}
```
test.py
```python
import time
import subprocess

start_time = time.time()
command="solc-0828 test.sol --model-checker-timeout 5000 --model-checker-ext-calls trusted --model-checker-engine bmc --model-checker-bmc-loop-iterations 1 --model-checker-solvers z3"
output = subprocess.check_output(command,shell=True)
end_time = time.time()
execution_time = end_time - start_time # Calculate the time difference
print(f"smtchecker: {execution_time:.4f} seconds")
```
```
Warning: BMC: 2 verification condition(s) could not be proved. Enable the model checker option "show unproved" to see all of them. Consider choosing a specific contract to be verified in order to reduce the solving problems. Consider increasing the timeout per query.

smtchecker: 10.1223 seconds
```

Contributor guide

Open the contributing guide

Research direction

Start with the test.sol and test.py reproducer, then trace how solc handles --model-checker-timeout with the listed SMTChecker options. Confirm whether the timeout applies per query or to the complete invocation, and make the behavior and description agree; the reproducer should no longer show the reported mismatch.

Written by the indexing model from the issue text.

Assessment

Tech stack
solidity
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.