You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If two libs have external functions that call each other then recurse_link enters an infinite loop. It attempts to link Lib A to Lib B, then B to A, then A to B..., until a stack overflow. Below is a minimal repro demonstrating the issue
Create a starter project via forge init
Append the following code to Counter.sol
library Foo {
function foo() external {
Bar.bar();
}
function flum() external {}
}
library Bar {
function bar() external {
Foo.flum();
}
}
Run RUST_LOG=forge forge test
Observe crash output (duplicate lines omitted for brevity):
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.2.0 (59f026f 2023-05-23T17:21:42.593814000Z)
What command(s) is the bug in?
forge test
Operating System
macOS (Apple Silicon)
Describe the bug
If two libs have external functions that call each other then recurse_link enters an infinite loop. It attempts to link Lib A to Lib B, then B to A, then A to B..., until a stack overflow. Below is a minimal repro demonstrating the issue
forge init
Counter.sol
RUST_LOG=forge forge test
The trace logs narrowed the issue down to
recurse_link
. Note this only happens when the lib's functions areexternal
.The text was updated successfully, but these errors were encountered: