Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Internal compiler error. /solidity/libsolidity/ast/ASTUtils.cpp(56) Recursion depth limit reached #15739

Open
Jizhou-Chen opened this issue Jan 20, 2025 · 0 comments
Labels

Comments

@Jizhou-Chen
Copy link

Description

Error:

Internal compiler error:
/solidity/libsolidity/ast/ASTUtils.cpp(56): Throw in function solidity::frontend::isConstantVariableRecursive(const solidity::frontend::VariableDeclaration&)::<lambda(const solidity::frontend::VariableDeclaration&, solidity::util::CycleDetector<solidity::frontend::VariableDeclaration>&, size_t)>
Dynamic exception type: boost::wrapexcept<solidity::langutil::InternalCompilerError>
std::exception::what: Recursion depth limit reached
[solidity::util::tag_comment*] = Recursion depth limit reached

Environment

  • Compiler version: Version: 0.8.28-develop.2025.1.19+commit.7893614a.mod.Linux.g++
  • Compilation pipeline (legacy, IR, EOF):
  • Target EVM version (as per compiler settings):
  • Framework/IDE (e.g. Foundry, Hardhat, Remix):
  • EVM execution environment / backend / blockchain client:
  • Operating system: Ubuntu 22.04

Steps to Reproduce

poc.sol (fuzzer-generated):
NOTE: I know this poc is unpleasantly long and have tried to reduce it (given its obvious iterative pattern). However, removing just an addtional assignment can make the error not reproducible. Hence I had to leave it this way after reducing other removable parts.

contract C
{
    A constant B = C;
    A constant C = D;
    A constant D = E;
    A constant E = F;
    A constant F = G;
    A constant G = H;
    A constant H = I;
    A constant I = J;
    A constant J = K;
    A constant K = L;
    A constant L = M;
    A constant M = N;
    A constant N = O;
    A constant O = P;
    A constant P = Q;
    A constant Q = R;
    A constant R = S;
    A constant S = T;
    A constant T = U;
    A constant U = V;
    A constant V = W;
    A constant W = X;
    A constant X = Y;
    A constant Y = Z;
    A constant Z = BA;
    A constant BA = BB;
    A constant BB = BC;
    A constant BC = BD;
    A constant BD = BE;
    A constant BE = BF;
    A constant BF = BG;
    A constant BG = BH;
    A constant BH = BI;
    A constant BI = BJ;
    A constant BJ = BK;
    A constant BK = BL;
    A constant BL = BM;
    A constant BM = BN;
    A constant BN = BO;
    A constant BO = BP;
    A constant BP = BQ;
    A constant BQ = BR;
    A constant BR = BS;
    A constant BS = BT;
    A constant BT = BU;
    A constant BU = BV;
    A constant BV = BW;
    A constant BW = BX;
    A constant BX = BY;
    A constant BY = BZ;
    A constant BZ = CA;
    A constant CA = CB;
    A constant CB = CC;
    A constant CC = CD;
    A constant CD = CE;
    A constant CE = CF;
    A constant CF = CG;
    A constant CG = CH;
    A constant CH = CI;
    A constant CI = CJ;
    A constant CJ = CK;
    A constant CK = CL;
    A constant CL = CM;
    A constant CM = CN;
    A constant CN = CO;
    A constant CO = CP;
    A constant CP = CQ;
    A constant CQ = CR;
    A constant CR = CS;
    A constant CS = CT;
    A constant CT = CU;
    A constant CU = CV;
    A constant CV = CW;
    A constant CW = CX;
    A constant CX = CY;
    A constant CY = CZ;
    A constant CZ = DA;
    A constant DA = DB;
    A constant DB = DC;
    A constant DC = DD;
    A constant DD = DE;
    A constant DE = DF;
    A constant DF = DG;
    A constant DG = DH;
    A constant DH = DI;
    A constant DI = DJ;
    A constant DJ = DK;
    A constant DK = DL;
    A constant DL = DM;
    A constant DM = DN;
    A constant DN = DO;
    A constant DO = DP;
    A constant DP = DQ;
    A constant DQ = DR;
    A constant DR = DS;
    A constant DS = DT;
    A constant DT = DU;
    A constant DU = DV;
    A constant DV = DW;
    A constant DW = DX;
    A constant DX = DY;
    A constant DY = EA;
    A constant EA = EB;
    A constant EB = EC;
    A constant EC = ED;
    A constant ED = EE;
    A constant EE = EF;
    A constant EF = EG;
    A constant EG = EH;
    A constant EH = EI;
    A constant EI = EJ;
    A constant EJ = EK;
    A constant EK = EL;
    A constant EL = EM;
    A constant EM = EN;
    A constant EN = EO;
    A constant EO = EP;
    A constant EP = EQ;
    A constant EQ = ER;
    A constant ER = ES;
    A constant ES = ET;
    A constant ET = EU;
    A constant EU = EV;
    A constant EV = EW;
    A constant EW = EX;
    A constant EX = EY;
    A constant EY = EZ;
    A constant EZ = FA;
    A constant FA = FB;
    A constant FB = FC;
    A constant FC = FD;
    A constant FD = FE;
    A constant FE = FF;
    A constant FF = FG;
    A constant FG = FH;
    A constant FH = FI;
    A constant FI = FJ;
    A constant FJ = FK;
    A constant FK = FL;
    A constant FL = FM;
    A constant FM = FN;
    A constant FN = FO;
    A constant FO = FP;
    A constant FP = FQ;
    A constant FQ = FR;
    A constant FR = FS;
    A constant FS = FT;
    A constant FT = FU;
    A constant FU = FV;
    A constant FV = FW;
    A constant FW = FX;
    A constant FX = FY;
    A constant FY = FZ;
    A constant FZ = GA;
    A constant GA = GB;
    A constant GB = GC;
    A constant GC = GD;
    A constant GD = GE;
    A constant GE = GF;
    A constant GF = GG;
    A constant GG = GH;
    A constant GH = GI;
    A constant GI = GJ;
    A constant GJ = GK;
    A constant GK = GL;
    A constant GL = GM;
    A constant GM = GN;
    A constant GN = GO;
    A constant GO = GP;
    A constant GP = GQ;
    A constant GQ = GR;
    A constant GR = GS;
    A constant GS = GT;
    A constant GT = GU;
    A constant GU = GV;
    A constant GV = GW;
    A constant GW = GX;
    A constant GX = GY;
    A constant GY = GZ;
    A constant GZ = HA;
    A constant HA = HB;
    A constant HB = HC;
    A constant HC = HD;
    A constant HD = HE;
    A constant HE = HF;
    A constant HF = HG;
    A constant HG = HH;
    A constant HH = HI;
    A constant HI = HJ;
    A constant HJ = HK;
    A constant HK = HL;
    A constant HL = HM;
    A constant HM = HN;
    A constant HN = HO;
    A constant HO = HP;
    A constant HP = HQ;
    A constant HQ = HR;
    A constant HR = HS;
    A constant HS = HT;
    A constant HT = HU;
    A constant HU = HV;
    A constant HV = HW;
    A constant HW = HX;
    A constant HX = HY;
    A constant HY = HZ;
    A constant HZ = IA;
    A constant IA = IB;
    A constant IB = IC;
    A constant IC = ID;
    A constant ID = IE;
    A constant IE = IF;
    A constant IF = IG;
    A constant IG = IH;
    A constant IH = II;
    A constant II = IJ;
    A constant IJ = IK;
    A constant IK = IL;
    A constant IL = IM;
    A constant IM = IN;
    A constant IN = IO;
    A constant IO = IP;
    A constant IP = IQ;
    A constant IQ = IR;
    A constant IR = IS;
    A constant IS = IT;
    A constant IT = IU;
    A constant IU = IV;
    A constant IV = IW;
    A constant IW = IX;
    A constant IX = IY;
    A constant IY = IZ;
    A constant IZ = JA;
    A constant JA = JB;
    A constant JB = JC;
    A constant JC = JD;
    A constant JD = JE;
    A constant JE = JF;
    A constant JF = JG;
    A constant JG = JH;
    A constant JH = JI;
    A constant JI = JJ;
    A constant JJ = JK;
    A constant JK = JL;
    A constant JL = JM;
    A constant JM = JN;
    A constant JN = JO;
    A constant JO = JP;
    A constant JP = JQ;
    A constant JQ = JR;
    A constant JR = JS;
    A constant JS = JT;
    A constant JT = JU;
    A constant JU = JV;
    A constant JV = JW;
    A constant JW = JX;
    A constant JX = A(address(0x00));
}
contract A is C { constructor() C(2) {} }
contract B is C { constructor() C(2) {} }
contract D is C, B {
	uint8 constant x = C;

	function f() public view returns(uint) {
        assembly { sstore(x.slot, 64) }
    }
}

To reproduce:
solc --bin -o poc poc.sol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant