An integer overflow occurred during the Executing AUTONAME pass
.
#4983
Labels
error handling
Error handling and reporting
fix pending
PR with a fix is pending
Fuzzer
Fuzzer generated issue
Version
Yosys 0.50+49 (git sha1 05c81b3, clang++ 14.0.0-1ubuntu1.1 -Og -fPIC -O1 -fno-omit-frame-pointer -fno-optimize-sibling-calls -fsanitize=address,undefined)
On which OS did this happen?
Linux
Reproduction Steps
The following is the Verilog code file
bug.v
that triggers the bug. I have already minimized it as much as possible.Running the following script will trigger the bug.
I discovered this bug while testing Yosys using a fuzzing tool I am developing. While reviewing historical issues, I found that #4509 reported a similar problem. However, the code snippet that caused the error in that issue is different from the one in the current case, so I believe they might be different issues. Specifically, the code snippet that leads to the integer overflow is in
passes/cmds/autoname.cc:80:17
:The issue was triggered by the line
if (best_score*2 < it.second.first)
.Expected Behavior
The synthesis process should either succeed or fail due to an error; integer overflows and other abnormal behaviors (such as OOM) should not occur.
Actual Behavior
The synthesis process hangs during
Executing AUTONAME pass
. After some time, it triggers a runtime error:passes/cmds/autoname.cc:80:17: runtime error: signed integer overflow: 1136330020 * 2 cannot be represented in type 'int'
.Later, it results in:
AddressSanitizer: Out of memory. The process has exhausted 65536MB for size class 32
.The detailed log is as follows:
Below is the call stack I obtained using GDB at the point when the integer overflow occurred:
The text was updated successfully, but these errors were encountered: