Comments (2)
Hi @hedgar2017, I can confirm that this is an issue, so thank for the report.
from solidity.
I also managed to reproduce it earlier today and it looks like it's specifically the SSATransform step in the optimizer sequence that triggers this.
Repro on the CLI (after extracting PoseidonT3.sol
)
solc PoseidonT3.sol --via-ir --optimize --yul-optimizations a
I let it run for > 20 min and it ended up eating all memory on a machine with 32 GB RAM and being killed by the OOM killer.
It only happens with Yul optimizer enabled and is reproducible down to v0.8.10 (with --experimental-via-ir
), which seems to be the version that introduced the optimized EVM transform and also included various changes to data flow analyzer. Before that it compiles fine.
I also took a quick look at the call stack in a debugger and the relevant bits look like this:
OptimiserSuite::run()
StackCompressor::run()
eliminateVariablesOptimizedCodegen()
Rematerialiser::run()
DataFlowAnalyzer::operator(Block)
- Then lots of alternating between calls to
Rematerialiser
,ASTModifier
andDataFlowAnalyzer
- Then deep chains of calls into the
CodeCost
metric
The stack is generally pretty deep and getting a little deeper each time I pause the execution. Got up to something like ~575 calls deep after ~10 min (in a debug build, so not necessarily comparable with the ~20 I mentioned above). The call chains measured by the metric seem weirdly long. Much longer than what I'd expect from nesting visible in unoptimized IR and there are no recursive calls there.
What it looks like to me is that probably StackCompressor
keeps repeatedly using Rematerialiser
to inline all those intermediate variables and ending up with very deep nesting, which is then very expensive to measure and analyze. Still not sure if it is actually doing infinite recursion or if it would finish eventually but is just pathologically costly to run.
from solidity.
Related Issues (20)
- SMTChecker: Unable to correctly determine the result of function pointer comparison
- SMTChecker: Unable to determine the return value of the function HOT 5
- SMTChecker: Unable to correctly determine the return value of a function-type variable call.
- SMTChecker: Unable to accurately describe the balance
- SMTChecker: Incorrectly determines insufficient balance.
- SMTChecker: Unable to accurately determine the value of an empty array HOT 3
- SMTChecker is unable to accurately determine the output of abi.decoder
- SMTChecker: Unable to accurately determine the modification of global variables by functions called using call() HOT 1
- SMTChecker: Unable to accurately determine the correctness of operations following assembly code HOT 3
- Optimizer's optimization effectiveness varies for different opcodes.
- Pattern PUSH0 SHR appears in optimized code HOT 4
- There is a place to initialize immutable parameters in the UpgradeableProxy type contract. HOT 1
- Avoid tab-space mix in compiler output HOT 1
- Document the use cases for verbatim and why it cannot be used in inline assembly HOT 1
- Single return works but Multiple return fails outside a function HOT 1
- Incorrect docs about '*' in outputSelection
- add stop-after stage for semantic analysis HOT 4
- IR-based Codegen fails to generate bin at version of 0820 HOT 1
- IR-based Codegen fails to compile at version of 0.8.13
- AST-importer fails at version 0.7.6 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from solidity.