Solidity Compiler Crash: A Perfect Storm of Ancient Bugs

2025-08-16
Solidity Compiler Crash: A Perfect Storm of Ancient Bugs

A perplexing crash in the Solidity compiler has recently emerged: it segfaults even when compiling perfectly valid code. The root cause was traced to a 12-year-old overload resolution bug in G++ versions below 11.4, interacting with C++20's implicit comparison rewrite rules when handling Boost's `boost::rational` type. This combination leads to infinite recursion and a stack overflow. The issue isn't in the Solidity code itself, but a surprising interaction between G++, Boost, and the C++20 specification. The solution is upgrading Boost to 1.75 or higher, or upgrading G++ to version 14 or later.

Development Compiler Bug