argotorg / argotorg/solidity

[OptimizedEVMCodeTransform] ICE due to "Could not create stack layout after 1000 iterations"

Open
#12,570 14 comments 0 reactions 0 assignees View on GitHub
bug :bug: high impact medium effort must have
Dominant language
C++
Stars
25.7k
Forks
6.2k
Avg merge
2d 19h
Merged PRs (30d)
29

Description

```
{
function f() -> o1, o2, o3, o4, o5, o6, o7, o8, o9, o10, o11, o12, o13, o14, o15, o16, o17, o18
{
for {} o13 { o18 := add(o1,0) } {
if eq(o4, 0) {
o7 := 0
{
for {o1 := 2} o13 {} { {leave} }
}
}
o9 := o6
}
}
}
```

throws

https://github.com/ethereum/solidity/blob/55467c1ccaffd5fcf6ea988d5e091d468a08f533/libyul/backends/evm/StackHelpers.h#L121

The fuzzer upstream reported this bug (see https://github.com/ethereum/solidity/blob/55467c1ccaffd5fcf6ea988d5e091d468a08f533/test/tools/ossfuzz/strictasm_assembly_ossfuzz.cpp#L49)

I could not reproduce via solc CLI.

Contributor guide

Open the contributing guide

Research direction

Inspect libyul/backends/evm/StackHelpers.h around line 121 and the strictasm OSS-Fuzz harness at test/tools/ossfuzz/strictasm_assembly_ossfuzz.cpp line 49. Run the supplied Yul input through the fuzzer path, since the report says it was not reproducible with the solc CLI. Done means the regression is reproducible in a test and the input no longer produces the stack-layout ICE.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.