ethereum / solidity

Solidity, the Smart Contract Programming Language
https://soliditylang.org
GNU General Public License v3.0
23.31k stars 5.77k forks source link

ENS external test fails compilation via IR: `Could not create stack layout after 1000 iterations` #13224

Open Marenz opened 2 years ago

Marenz commented 2 years ago

Our CI currently fails a required test "ens": https://app.circleci.com/pipelines/github/ethereum/solidity/25009/workflows/5155870a-20fb-421d-8e17-10c02edf8aa0/jobs/1101684

YulException: Could not create stack layout after 1000 iterations.

Error HH600: Compilation failed
Marenz commented 2 years ago

Here is a coredump of the problem after it triggered the too deep error:

Catchpoint 1 (exception thrown), 0x00007fc7649e1672 in __cxa_throw () from /lib/x86_64-linux-gnu/libstdc++.so.6
(gdb) up
#1  0x000055d442da4831 in boost::throw_exception<solidity::evmasm::StackTooDeepException> (e=...) at /usr/include/boost/throw_exception.hpp:70
70      throw exception_detail::enable_both( e );
(gdb)
#2  0x000055d442da1a6e in solidity::evmasm::CSECodeGenerator::appendDup (this=0x7ffff6c50ab0, _fromPosition=-8, _location=...) at /home/marenz/eth/solidity/libevmasm/CommonSubexpressionEliminator.cpp:475
475         assertThrow(instructionNum <= 16, StackTooDeepException, util::stackTooDeepString);
(gdb) bt
#0  0x00007fc7649e1672 in __cxa_throw () from /lib/x86_64-linux-gnu/libstdc++.so.6
#1  0x000055d442da4831 in boost::throw_exception<solidity::evmasm::StackTooDeepException> (e=...) at /usr/include/boost/throw_exception.hpp:70
#2  0x000055d442da1a6e in solidity::evmasm::CSECodeGenerator::appendDup (this=0x7ffff6c50ab0, _fromPosition=-8, _location=...) at /home/marenz/eth/solidity/libevmasm/CommonSubexpressionEliminator.cpp:475
#3  0x000055d442da0085 in solidity::evmasm::CSECodeGenerator::generateClassElement (this=0x7ffff6c50ab0, _c=16, _allowSequenced=false) at /home/marenz/eth/solidity/libevmasm/CommonSubexpressionEliminator.cpp:381
#4  0x000055d442d9dca0 in solidity::evmasm::CSECodeGenerator::generateCode (this=0x7ffff6c50ab0, _initialSequenceNumber=1, _initialStackHeight=0, _initialStack=std::map with 11 elements = {...}, _targetStackContents=std::map with 21 elements = {...})
    at /home/marenz/eth/solidity/libevmasm/CommonSubexpressionEliminator.cpp:181
#5  0x000055d442d9c91c in solidity::evmasm::CommonSubexpressionEliminator::getOptimizedItems (this=0x7ffff6c50eb0) at /home/marenz/eth/solidity/libevmasm/CommonSubexpressionEliminator.cpp:70
#6  0x000055d442d77eea in solidity::evmasm::Assembly::optimiseInternal (this=0x55d446a14810, _settings=..., _tagsReferencedFromOutside=std::set with 0 elements) at /home/marenz/eth/solidity/libevmasm/Assembly.cpp:443
#7  0x000055d442d7756e in solidity::evmasm::Assembly::optimiseInternal (this=0x7ffff6c518d0, _settings=..., _tagsReferencedFromOutside=std::set with 0 elements) at /home/marenz/eth/solidity/libevmasm/Assembly.cpp:358
#8  0x000055d442d7726b in solidity::evmasm::Assembly::optimise (this=0x7ffff6c518d0, _settings=...) at /home/marenz/eth/solidity/libevmasm/Assembly.cpp:338
#9  0x000055d442a3741e in solidity::yul::YulStack::assembleEVMWithDeployed (this=0x7ffff6c51d10, _deployName=std::optional<std::string_view> = {...}) at /home/marenz/eth/solidity/libyul/YulStack.cpp:291
#10 0x000055d44236542b in solidity::frontend::CompilerStack::generateEVMFromIR (this=0x7ffff6c523c0, _contract=...) at /home/marenz/eth/solidity/libsolidity/interface/CompilerStack.cpp:1401
#11 0x000055d442358f3b in solidity::frontend::CompilerStack::compile (this=0x7ffff6c523c0, _stopAfter=solidity::frontend::CompilerStack::CompilationSuccessful) at /home/marenz/eth/solidity/libsolidity/interface/CompilerStack.cpp:667
#12 0x000055d4423f0379 in solidity::frontend::StandardCompiler::compileSolidity (this=0x7ffff6c52fc0, _inputsAndSettings=...) at /home/marenz/eth/solidity/libsolidity/interface/StandardCompiler.cpp:1101
#13 0x000055d4423f69cb in solidity::frontend::StandardCompiler::compile (this=0x7ffff6c52fc0, _input=...) at /home/marenz/eth/solidity/libsolidity/interface/StandardCompiler.cpp:1515
#14 0x000055d4423f7157 in solidity::frontend::StandardCompiler::compile (this=0x7ffff6c52fc0,
    _input="{\"language\":\"Solidity\",\"sources\":{\"contracts/dnsregistrar/DNSClaimChecker.sol\":{\"content\":\"pragma solidity >=0.0;\\n\\nimport \\\"../dnssec-oracle/DNSSEC.sol\\\";\\nimport \\\"../dnssec-oracle/BytesUtils.sol\\\""...)
    at /home/marenz/eth/solidity/libsolidity/interface/StandardCompiler.cpp:1554
#15 0x000055d4421fdb22 in solidity::frontend::CommandLineInterface::processInput (this=0x7ffff6c53330) at /home/marenz/eth/solidity/solc/CommandLineInterface.cpp:646
#16 0x000055d4421fd5a4 in solidity::frontend::CommandLineInterface::run (this=0x7ffff6c53330, _argc=2, _argv=0x7ffff6c53788) at /home/marenz/eth/solidity/solc/CommandLineInterface.cpp:593
#17 0x000055d4421e0770 in main (argc=2, argv=0x7ffff6c53788) at /home/marenz/eth/solidity/solc/main.cpp:41

This and the one after are the stack traces a bit earlier before it happened

(gdb) bt
#0  0x000055d442adc60c in std::_Head_base<1ul, __gnu_cxx::__normal_iterator<std::variant<solidity::yul::FunctionCallReturnLabelSlot, solidity::yul::FunctionReturnLabelSlot, solidity::yul::VariableSlot, solidity::yul::LiteralSlot, solidity::yul::TemporarySlot, solidity::yul::JunkSlot> const*, std::vector<std::variant<solidity::yul::FunctionCallReturnLabelSlot, solidity::yul::FunctionReturnLabelSlot, solidity::yul::VariableSlot, solidity::yul::LiteralSlot, solidity::yul::TemporarySlot, solidity::yul::JunkSlot>, std::allocator<std::variant<solidity::yul::FunctionCallReturnLabelSlot, solidity::yul::FunctionReturnLabelSlot, solidity::yul::VariableSlot, solidity::yul::LiteralSlot, solidity::yul::TemporarySlot, solidity::yul::JunkSlot> > > >, false>::_Head_base<__gnu_cxx::__normal_iterator<std::variant<solidity::yul::FunctionCallReturnLabelSlot, solidity::yul::FunctionReturnLabelSlot, solidity::yul::VariableSlot, solidity::yul::LiteralSlot, solidity::yul::TemporarySlot, solidity::yul::JunkSlot> const*, std::vector<std::variant<solidity::yul::FunctionCallReturnLabelSlot, solidity::yul::FunctionReturnLabelSlot, solidity::yul::VariableSlot, solidity::yul::LiteralSlot, solidity::yul::TemporarySlot, solidity::yul::JunkSlot>, std::allocator<std::variant<solidity::yul::FunctionCallReturnLabelSlot, solidity::yul::FunctionReturnLabelSlot, solidity::yul::VariableSlot, solidity::yul::LiteralSlot, solidity::yul::TemporarySlot, solidity::yul::JunkSlot> > > > > (this=0x7ffff6c50688, __h=...) at /usr/include/c++/9/tuple:133
#1  0x000055d442ad9024 in std::_Tuple_impl<1ul, __gnu_cxx::__normal_iterator<std::variant<solidity::yul::FunctionCallReturnLabelSlot, solidity::yul::FunctionReturnLabelSlot, solidity::yul::VariableSlot, solidity::yul::LiteralSlot, solidity::yul::TemporarySlot, solidity::yul::JunkSlot> const*, std::vector<std::variant<solidity::yul::FunctionCallReturnLabelSlot, solidity::yul::FunctionReturnLabelSlot, solidity::yul::VariableSlot, solidity::yul::LiteralSlot, solidity::yul::TemporarySlot, solidity::yul::JunkSlot>, std::allocator<std::variant<solidity::yul::FunctionCallReturnLabelSlot, solidity::yul::FunctionReturnLabelSlot, solidity::yul::VariableSlot, solidity::yul::LiteralSlot, solidity::yul::TemporarySlot, solidity::yul::JunkSlot> > > > >::_Tuple_impl (this=0x7ffff6c50688,
    __in=...) at /usr/include/c++/9/tuple:360
#2  0x000055d442ada09c in std::_Tuple_impl<0ul, ranges::basic_iterator<ranges::detail::index_view<unsigned long, long>::cursor>, __gnu_cxx::__normal_iterator<std::variant<solidity::yul::FunctionCallReturnLabelSlot, solidity::yul::FunctionReturnLabelSlot, solidity::yul::VariableSlot, solidity::yul::LiteralSlot, solidity::yul::TemporarySlot, solidity::yul::JunkSlot> const*, std::vector<std::variant<solidity::yul::FunctionCallReturnLabelSlot, solidity::yul::FunctionReturnLabelSlot, solidity::yul::VariableSlot, solidity::yul::LiteralSlot, solidity::yul::TemporarySlot, solidity::yul::JunkSlot>, std::allocator<std::variant<solidity::yul::FunctionCallReturnLabelSlot, solidity::yul::FunctionReturnLabelSlot, solidity::yul::VariableSlot, solidity::yul::LiteralSlot, solidity::yul::TemporarySlot, solidity::yul::JunkSlot> > > > >::_Tuple_impl (this=0x7ffff6c50688, __in=...) at /usr/include/c++/9/tuple:231
#3  0x000055d442ad57c9 in std::tuple<ranges::basic_iterator<ranges::detail::index_view<unsigned long, long>::cursor>, __gnu_cxx::__normal_iterator<std::variant<solidity::yul::FunctionCallReturnLabelSlot, solidity::yul::FunctionReturnLabelSlot, solidity::yul::VariableSlot, solidity::yul::LiteralSlot, solidity::yul::TemporarySlot, solidity::yul::JunkSlot> const*, std::vector<std::variant<solidity::yul::FunctionCallReturnLabelSlot, solidity::yul::FunctionReturnLabelSlot, solidity::yul::VariableSlot, solidity::yul::LiteralSlot, solidity::yul::TemporarySlot, solidity::yul::JunkSlot>, std::allocator<std::variant<solidity::yul::FunctionCallReturnLabelSlot, solidity::yul::FunctionReturnLabelSlot, solidity::yul::VariableSlot, solidity::yul::LiteralSlot, solidity::yul::TemporarySlot, solidity::yul::JunkSlot> > > > >::tuple (this=0x7ffff6c50688) at /usr/include/c++/9/tuple:983
#4  0x000055d442ad580c in ranges::iter_zip_with_view<ranges::detail::indirect_zip_fn_, ranges::detail::index_view<unsigned long, long>, ranges::ref_view<std::vector<std::variant<solidity::yul::FunctionCallReturnLabelSlot, solidity::yul::FunctionReturnLabelSlot, solidity::yul::VariableSlot, solidity::yul::LiteralSlot, solidity::yul::TemporarySlot, solidity::yul::JunkSlot>, std::allocator<std::variant<solidity::yul::FunctionCallReturnLabelSlot, solidity::yul::FunctionReturnLabelSlot, solidity::yul::VariableSlot, solidity::yul::LiteralSlot, solidity::yul::TemporarySlot, solidity::yul::JunkSlot> > > const> >::cursor<false>::cursor (this=0x7ffff6c50680, fun=..., its=std::tuple containing = {...}) at /home/marenz/eth/solidity/build/deps/include/range/v3/view/zip_with.hpp:219
#5  0x000055d442acdf3b in ranges::iter_zip_with_view<ranges::detail::indirect_zip_fn_, ranges::detail::index_view<unsigned long, long>, ranges::ref_view<std::vector<std::variant<solidity::yul::FunctionCallReturnLabelSlot, solidity::yul::FunctionReturnLabelSlot, solidity::yul::VariableSlot, solidity::yul::LiteralSlot, solidity::yul::TemporarySlot, solidity::yul::JunkSlot>, std::allocator<std::variant<solidity::yul::FunctionCallReturnLabelSlot, solidity::yul::FunctionReturnLabelSlot, solidity::yul::VariableSlot, solidity::yul::LiteralSlot, solidity::yul::TemporarySlot, solidity::yul::JunkSlot> > > const> >::begin_cursor (this=0x7ffff6c50720) at /home/marenz/eth/solidity/build/deps/include/range/v3/view/zip_with.hpp:323
#6  0x000055d442ac6f63 in ranges::range_access::begin_cursor<ranges::iter_zip_with_view<ranges::detail::indirect_zip_fn_, ranges::detail::index_view<unsigned long, long>, ranges::ref_view<std::vector<std::variant<solidity::yul::FunctionCallReturnLabelSlot, solidity::yul::FunctionReturnLabelSlot, solidity::yul::VariableSlot, solidity::yul::LiteralSlot, solidity::yul::TemporarySlot, solidity::yul::JunkSlot>, std::allocator<std::variant<solidity::yul::FunctionCallReturnLabelSlot, solidity::yul::FunctionReturnLabelSlot, solidity::yul::VariableSlot, solidity::yul::LiteralSlot, solidity::yul::TemporarySlot, solidity::yul::JunkSlot> > > const> > > (rng=...) at /home/marenz/eth/solidity/build/deps/include/range/v3/detail/range_access.hpp:85
#7  0x000055d442ac0ed2 in ranges::view_facade<ranges::iter_zip_with_view<ranges::detail::indirect_zip_fn_, ranges::detail::index_view<unsigned long, long>, ranges::ref_view<std::vector<std::variant<solidity::yul::FunctionCallReturnLabelSlot, solidity::yul::FunctionReturnLabelSlot, solidity::yul::VariableSlot, solidity::yul::LiteralSlot, solidity::yul::TemporarySlot, solidity::yul::JunkSlot>, std::allocator<std::variant<solidity::yul::FunctionCallReturnLabelSlot, solidity::yul::FunctionReturnLabelSlot, solidity::yul::VariableSlot, solidity::yul::LiteralSlot, solidity::yul::TemporarySlot, solidity::yul::JunkSlot> > > const> >, (ranges::cardinality)-1>::begin<ranges::iter_zip_with_view<ranges::detail::indirect_zip_fn_, ranges::detail::index_view<unsigned long, long>, ranges::ref_view<std::vector<std::variant<solidity::yul::FunctionCallReturnLabelSlot, solidity::yul::FunctionReturnLabelSlot, solidity::yul::VariableSlot, solidity::yul::LiteralSlot, solidity::yul::TemporarySlot, solidity::yul::JunkSlot>, std::allocator<std::variant<solidity::yul::FunctionCallReturnLabelSlot, solidity::yul::FunctionReturnLabelSlot, solidity::yul::VariableSlot, solidity::yul::LiteralSlot, solidity::yul::TemporarySlot, solidity::yul::JunkSlot> > > const> >, true, 0> (this=0x7ffff6c50720)
    at /home/marenz/eth/solidity/build/deps/include/range/v3/view/facade.hpp:100
#8  0x000055d442aeb454 in solidity::yul::ShuffleOperations::ShuffleOperations(solidity::yul::Stack &, const solidity::yul::Stack &, (anonymous namespace)::<lambda(unsigned int)>, (anonymous namespace)::<lambda(const StackSlot&)>, (anonymous namespace)::<lambda()>) (this=0x7ffff6c50900, _currentStack=std::vector of length 6, capacity 6 = {...}, _targetStack=std::vector of length 8, capacity 12 = {...}, _swap=..., _pushOrDup=..., _pop=...) at /home/marenz/eth/solidity/libyul/backends/evm/StackHelpers.h:414
#9  0x000055d442afa2f1 in solidity::yul::Shuffler<solidity::yul::createStackLayout(solidity::yul::Stack&, const Stack&, Swap, PushOrDup, Pop) [with Swap = (anonymous namespace)::findStackTooDeep(const Stack&, const Stack&)::<lambda(unsigned int)>; PushOrDup = (anonymous namespace)::findStackTooDeep(const Stack&, const Stack&)::<lambda(const StackSlot&)>; Pop = (anonymous namespace)::findStackTooDeep(const Stack&, const Stack&)::<lambda()>; solidity::yul::Stack = std::vector<std::variant<solidity::yul::FunctionCallReturnLabelSlot, solidity::yul::FunctionReturnLabelSlot, solidity::yul::VariableSlot, solidity::yul::LiteralSlot, solidity::yul::TemporarySlot, solidity::yul::JunkSlot> >]::ShuffleOperations>::shuffleStep<std::vector<std::variant<solidity::yul::FunctionCallReturnLabelSlot, solidity::yul::FunctionReturnLabelSlot, solidity::yul::VariableSlot, solidity::yul::LiteralSlot, solidity::yul::TemporarySlot, solidity::yul::JunkSlot>, std::allocator<std::variant<solidity::yul::FunctionCallReturnLabelSlot, solidity::yul::FunctionReturnLabelSlot, solidity::yul::VariableSlot, solidity::yul::LiteralSlot, solidity::yul::TemporarySlot, solidity::yul::JunkSlot> > >&, const std::vector<std::variant<solidity::yul::FunctionCallReturnLabelSlot, solidity::yul::FunctionReturnLabelSlot, solidity::yul::VariableSlot, solidity::yul::LiteralSlot, solidity::yul::TemporarySlot, solidity::yul::JunkSlot>, std::allocator<std::variant<solidity::yul::FunctionCallReturnLabelSlot, solidity::yul::FunctionReturnLabelSlot, solidity::yul::VariableSlot, solidity::yul::LiteralSlot, solidity::yul::TemporarySlot, solidity::yul::JunkSlot> > >&, (anonymous namespace)::findStackTooDeep(const Stack&, const Stack&)::<lambda(unsigned int)>&, (anonymous namespace)::findStackTooDeep(const Stack&, const Stack&)::<lambda(const StackSlot&)>&, (anonymous namespace)::findStackTooDeep(const Stack&, const Stack&)::<lambda()>&>(void) () at /home/marenz/eth/solidity/libyul/backends/evm/StackHelpers.h:215
#10 0x000055d442af61f8 in solidity::yul::Shuffler<solidity::yul::createStackLayout(solidity::yul::Stack&, const Stack&, Swap, PushOrDup, Pop) [with Swap = (anonymous namespace)::findStackTooDeep(const Stack&, const Stack&)::<lambda(unsigned int)>; PushOrDup = (anonymous namespace)::findStackTooDeep(const Stack&, const Stack&)::<lambda(const StackSlot&)>; Pop = (anonymous namespace)::findStackTooDeep(const Stack&, const Stack&)::<lambda()>; solidity::yul::Stack = std::vector<std::variant<solidity::yul::FunctionCallReturnLabelSlot, solidity::yul::FunctionReturnLabelSlot, solidity::yul::VariableSlot, solidity::yul::LiteralSlot, solidity::yul::TemporarySlot, solidity::yul::JunkSlot> >]::ShuffleOperations>::shuffle<std::vector<std::variant<solidity::yul::FunctionCallReturnLabelSlot, solidity::yul::FunctionReturnLabelSlot, solidity::yul::VariableSlot, solidity::yul::LiteralSlot, solidity::yul::TemporarySlot, solidity::yul::JunkSlot>, std::allocator<std::variant<solidity::yul::FunctionCallReturnLabelSlot, solidity::yul::FunctionReturnLabelSlot, solidity::yul::VariableSlot, solidity::yul::LiteralSlot, solidity::yul::TemporarySlot, solidity::yul::JunkSlot> > >&, const std::vector<std::variant<solidity::yul::FunctionCallReturnLabelSlot, solidity::yul::FunctionReturnLabelSlot, solidity::yul::VariableSlot, solidity::yul::LiteralSlot, solidity::yul::TemporarySlot, solidity::yul::JunkSlot>, std::allocator<std::variant<solidity::yul::FunctionCallReturnLabelSlot, solidity::yul::FunctionReturnLabelSlot, solidity::yul::VariableSlot, solidity::yul::LiteralSlot, solidity::yul::TemporarySlot, solidity::yul::JunkSlot> > >&, (anonymous namespace)::findStackTooDeep(const Stack&, const Stack&)::<lambda(unsigned int)>&, (anonymous namespace)::findStackTooDeep(const Stack&, const Stack&)::<lambda(const StackSlot&)>&, (anonymous namespace)::findStackTooDeep(const Stack&, const Stack&)::<lambda()>&>(void) () at /home/marenz/eth/solidity/libyul/backends/evm/StackHelpers.h:119
#11 0x000055d442aeb939 in solidity::yul::createStackLayout<(anonymous namespace)::findStackTooDeep(const Stack&, const Stack&)::<lambda(unsigned int)>, (anonymous namespace)::findStackTooDeep(const Stack&, const Stack&)::<lambda(const StackSlot&)>, (anonymous namespace)::findStackTooDeep(const Stack&, const Stack&)::<lambda()> >(solidity::yul::Stack &, const solidity::yul::Stack &, (anonymous namespace)::<lambda(unsigned int)>, (anonymous namespace)::<lambda(const StackSlot&)>, (anonymous namespace)::<lambda()>) (
    _currentStack=std::vector of length 6, capacity 6 = {...}, _targetStack=std::vector of length 8, capacity 12 = {...}, _swap=..., _pushOrDup=..., _pop=...) at /home/marenz/eth/solidity/libyul/backends/evm/StackHelpers.h:457
#12 0x000055d442ae6e86 in (anonymous namespace)::findStackTooDeep (_source=std::vector of length 6, capacity 10 = {...}, _target=std::vector of length 8, capacity 12 = {...}) at /home/marenz/eth/solidity/libyul/backends/evm/StackLayoutGenerator.cpp:111
--Type <RET> for more, q to quit, c to continue without paging--
#13 0x000055d442ae763a in solidity::yul::StackLayoutGenerator::propagateStackThroughBlock (this=0x7ffff6c51170, _exitStack=std::vector of length 6, capacity 6 = {...}, _block=..., _aggressiveStackCompression=false)
    at /home/marenz/eth/solidity/libyul/backends/evm/StackLayoutGenerator.cpp:325
#14 0x000055d442ae7ace in solidity::yul::StackLayoutGenerator::processEntryPoint (this=0x7ffff6c51170, _entry=...) at /home/marenz/eth/solidity/libyul/backends/evm/StackLayoutGenerator.cpp:359
#15 0x000055d442ae6917 in solidity::yul::StackLayoutGenerator::reportStackTooDeep (_cfg=..., _functionName=...) at /home/marenz/eth/solidity/libyul/backends/evm/StackLayoutGenerator.cpp:88
#16 0x000055d442ae6499 in solidity::yul::StackLayoutGenerator::reportStackTooDeep (_cfg=...) at /home/marenz/eth/solidity/libyul/backends/evm/StackLayoutGenerator.cpp:67
#17 0x000055d442d31000 in solidity::yul::StackLimitEvader::run (_context=..., _object=...) at /home/marenz/eth/solidity/libyul/optimiser/StackLimitEvader.cpp:135
#18 0x000055d442b7ed94 in solidity::yul::OptimiserSuite::run (_dialect=..., _meter=0x55d4465c1420, _object=..., _optimizeStackAllocation=true,
    _optimisationSequence="dhfoDgvulfnTUtnIf[xa[r]EscLMcCTUtTOntnfDIulLculVcul [j]Tpeulxa[rul]xa[r]cLgvifCTUca[r]LSsTFOtfDnca[r]Iulc]jmul[jul] VcTOcul jmul", _expectedExecutionsPerDeployment=std::optional<unsigned long> = {...},
    _externallyUsedIdentifiers=std::set with 0 elements) at /home/marenz/eth/solidity/libyul/optimiser/Suite.cpp:157
#19 0x000055d442a34f26 in solidity::yul::YulStack::optimize (this=0x7ffff6c51d10, _object=..., _isCreation=false) at /home/marenz/eth/solidity/libyul/YulStack.cpp:206
#20 0x000055d442a34d52 in solidity::yul::YulStack::optimize (this=0x7ffff6c51d10, _object=..., _isCreation=true) at /home/marenz/eth/solidity/libyul/YulStack.cpp:199
#21 0x000055d442a3375e in solidity::yul::YulStack::optimize (this=0x7ffff6c51d10) at /home/marenz/eth/solidity/libyul/YulStack.cpp:122

#22 0x000055d442365231 in solidity::frontend::CompilerStack::generateEVMFromIR (this=0x7ffff6c523c0, _contract=...) at /home/marenz/eth/solidity/libsolidity/interface/CompilerStack.cpp:1395
#23 0x000055d442358f3b in solidity::frontend::CompilerStack::compile (this=0x7ffff6c523c0, _stopAfter=solidity::frontend::CompilerStack::CompilationSuccessful) at /home/marenz/eth/solidity/libsolidity/interface/CompilerStack.cpp:667
#24 0x000055d4423f0379 in solidity::frontend::StandardCompiler::compileSolidity (this=0x7ffff6c52fc0, _inputsAndSettings=...) at /home/marenz/eth/solidity/libsolidity/interface/StandardCompiler.cpp:1101
#25 0x000055d4423f69cb in solidity::frontend::StandardCompiler::compile (this=0x7ffff6c52fc0, _input=...) at /home/marenz/eth/solidity/libsolidity/interface/StandardCompiler.cpp:1515
#26 0x000055d4423f7157 in solidity::frontend::StandardCompiler::compile (this=0x7ffff6c52fc0,
    _input="{\"language\":\"Solidity\",\"sources\":{\"contracts/dnsregistrar/DNSClaimChecker.sol\":{\"content\":\"pragma solidity >=0.0;\\n\\nimport \\\"../dnssec-oracle/DNSSEC.sol\\\";\\nimport \\\"../dnssec-oracle/BytesUtils.sol\\\""...)
    at /home/marenz/eth/solidity/libsolidity/interface/StandardCompiler.cpp:1554
#27 0x000055d4421fdb22 in solidity::frontend::CommandLineInterface::processInput (this=0x7ffff6c53330) at /home/marenz/eth/solidity/solc/CommandLineInterface.cpp:646
#28 0x000055d4421fd5a4 in solidity::frontend::CommandLineInterface::run (this=0x7ffff6c53330, _argc=2, _argv=0x7ffff6c53788) at /home/marenz/eth/solidity/solc/CommandLineInterface.cpp:593
#29 0x000055d4421e0770 in main (argc=2, argv=0x7ffff6c53788) at /home/marenz/eth/solidity/solc/main.cpp:41
#0  0x000055d4426993a3 in std::_Rb_tree_node<solidity::yul::YulString>::_M_valptr (this=0x55d44746f2f0) at /usr/include/c++/9/bits/stl_tree.h:238
#1  0x000055d442a47d4d in std::_Rb_tree_const_iterator<solidity::yul::YulString>::operator* (this=0x7ffff6c50710) at /usr/include/c++/9/bits/stl_tree.h:357
#2  0x000055d442b7b3f7 in solidity::yul::SideEffectsPropagator::sideEffects (_dialect=..., _directCallGraph=...) at /home/marenz/eth/solidity/libyul/optimiser/Semantics.cpp:145
#3  0x000055d442c59837 in solidity::yul::CommonSubexpressionEliminator::run (_context=..., _ast=...) at /home/marenz/eth/solidity/libyul/optimiser/CommonSubexpressionEliminator.cpp:42
#4  0x000055d442ba96a1 in solidity::yul::OptimiserStepInstance<solidity::yul::CommonSubexpressionEliminator>::run (this=0x55d44620e780, _context=..., _ast=...) at /home/marenz/eth/solidity/libyul/optimiser/OptimiserStep.h:81
#5  0x000055d442b82610 in solidity::yul::OptimiserSuite::runSequence (this=0x7ffff6c51060, _steps=std::vector of length 28, capacity 32 = {...}, _ast=...) at /home/marenz/eth/solidity/libyul/optimiser/Suite.cpp:435
#6  0x000055d442b82292 in solidity::yul::OptimiserSuite::runSequence (this=0x7ffff6c51060, _stepAbbreviations="xa[r]EscLMcCTUtTOntnfDIulLculVcul [j]Tpeulxa[rul]xa[r]cLgvifCTUca[r]LSsTFOtfDnca[r]Iulc", _ast=..., _repeatUntilStable=true)
    at /home/marenz/eth/solidity/libyul/optimiser/Suite.cpp:413
#7  0x000055d442b82249 in solidity::yul::OptimiserSuite::runSequence (this=0x7ffff6c51060, _stepAbbreviations="dhfoDgvulfnTUtnIf[xa[r]EscLMcCTUtTOntnfDIulLculVcul [j]Tpeulxa[rul]xa[r]cLgvifCTUca[r]LSsTFOtfDnca[r]Iulc]jmul[jul] VcTOcul jmul", _ast=...,
    _repeatUntilStable=false) at /home/marenz/eth/solidity/libyul/optimiser/Suite.cpp:411
#8  0x000055d442b7ea94 in solidity::yul::OptimiserSuite::run (_dialect=..., _meter=0x55d446a8cef0, _object=..., _optimizeStackAllocation=true,
    _optimisationSequence="dhfoDgvulfnTUtnIf[xa[r]EscLMcCTUtTOntnfDIulLculVcul [j]Tpeulxa[rul]xa[r]cLgvifCTUca[r]LSsTFOtfDnca[r]Iulc]jmul[jul] VcTOcul jmul", _expectedExecutionsPerDeployment=std::optional<unsigned long> = {...},
    _externallyUsedIdentifiers=std::set with 0 elements) at /home/marenz/eth/solidity/libyul/optimiser/Suite.cpp:127
#9  0x000055d442a34f26 in solidity::yul::YulStack::optimize (this=0x7ffff6c518d0, _object=..., _isCreation=false) at /home/marenz/eth/solidity/libyul/YulStack.cpp:206
#10 0x000055d442a34d52 in solidity::yul::YulStack::optimize (this=0x7ffff6c518d0, _object=..., _isCreation=true) at /home/marenz/eth/solidity/libyul/YulStack.cpp:199
#11 0x000055d442a3375e in solidity::yul::YulStack::optimize (this=0x7ffff6c518d0) at /home/marenz/eth/solidity/libyul/YulStack.cpp:122
#12 0x000055d4427a4f13 in solidity::frontend::IRGenerator::run[abi:cxx11](solidity::frontend::ContractDefinition const&, std::vector<unsigned char, std::allocator<unsigned char> > const&, std::map<solidity::frontend::ContractDefinition const*, std::basic_string_view<char, std::char_traits<char> > const, std::less<solidity::frontend::ContractDefinition const*>, std::allocator<std::pair<solidity::frontend::ContractDefinition const* const, std::basic_string_view<char, std::char_traits<char> > const> > > const&) (
    this=0x7ffff6c51af0, _contract=..., _cborMetadata=std::vector of length 90, capacity 128 = {...}, _otherYulSources=std::map with 108 elements = {...}) at /home/marenz/eth/solidity/libsolidity/codegen/ir/IRGenerator.cpp:114
#13 0x000055d442364975 in solidity::frontend::CompilerStack::generateIR (this=0x7ffff6c523c0, _contract=...) at /home/marenz/eth/solidity/libsolidity/interface/CompilerStack.cpp:1366
#14 0x000055d442358f01 in solidity::frontend::CompilerStack::compile (this=0x7ffff6c523c0, _stopAfter=solidity::frontend::CompilerStack::CompilationSuccessful) at /home/marenz/eth/solidity/libsolidity/interface/CompilerStack.cpp:663
#15 0x000055d4423f0379 in solidity::frontend::StandardCompiler::compileSolidity (this=0x7ffff6c52fc0, _inputsAndSettings=...) at /home/marenz/eth/solidity/libsolidity/interface/StandardCompiler.cpp:1101
#16 0x000055d4423f69cb in solidity::frontend::StandardCompiler::compile (this=0x7ffff6c52fc0, _input=...) at /home/marenz/eth/solidity/libsolidity/interface/StandardCompiler.cpp:1515
#17 0x000055d4423f7157 in solidity::frontend::StandardCompiler::compile (this=0x7ffff6c52fc0,
    _input="{\"language\":\"Solidity\",\"sources\":{\"contracts/dnsregistrar/DNSClaimChecker.sol\":{\"content\":\"pragma solidity >=0.0;\\n\\nimport \\\"../dnssec-oracle/DNSSEC.sol\\\";\\nimport \\\"../dnssec-oracle/BytesUtils.sol\\\""...)
    at /home/marenz/eth/solidity/libsolidity/interface/StandardCompiler.cpp:1554
#18 0x000055d4421fdb22 in solidity::frontend::CommandLineInterface::processInput (this=0x7ffff6c53330) at /home/marenz/eth/solidity/solc/CommandLineInterface.cpp:646
#19 0x000055d4421fd5a4 in solidity::frontend::CommandLineInterface::run (this=0x7ffff6c53330, _argc=2, _argv=0x7ffff6c53788) at /home/marenz/eth/solidity/solc/CommandLineInterface.cpp:593
#20 0x000055d4421e0770 in main (argc=2, argv=0x7ffff6c53788) at /home/marenz/eth/solidity/solc/main.cpp:41
Marenz commented 2 years ago

We temporarily fixed that in #13229 by using an older commit

ekpyron commented 2 years ago

This is the case triggering the bug: https://gist.github.com/ekpyron/faca83a32a77ba4393f88cace7e79663

NunoFilipeSantos commented 1 year ago

Hey! 👋 What is the impact of this bug? (High, Medium, Low)

ekpyron commented 1 year ago

Rather high. It's, in principle, covered by our roadmap item https://github.com/ethereum/solidity/issues/13721. As in it's an example of the issues to be addressed there.

MarcBickel commented 3 days ago

Hi, I still got this one today, so I would like to push this up if possible 😄 (As well as #13721)

fabriziogianni7 commented 3 days ago

getting the same error