CLower: Detecting Compiler Pessimization Bugs through Redundant Memory Accesses
Compilers are expected to generate optimized code, but they sometimes introduce
pessimizations, quality-degrading redundant instructions. These bugs not only incur
performance overhead but also, critically, expand the attack surface by introducing
unexpected side effects (e.g., redundant memory accesses) without breaking compilation
correctness. Existing bug-finding methods are neither designed for nor effective
at identifying such security-sensitive pessimizations.
This paper presents CLower, a novel, black-box approach for automatically detecting
compiler pessimizations via redundant memory accesses.
CLower's core insight is that any extra global memory accesses in a fully optimized
binary, compared to the source, indicate a pessimization. To reliably distinguish
compiler-introduced redundancy from source-level redundancy, we generate random
C programs in which each global variable has a predetermined, controlled number of memory accesses.
CLower then executes the instrumented binary and verifies whether superfluous accesses
have been introduced during compilation.
We applied CLower to GCC and LLVM, reporting 23 unique bugs (21 in GCC, 2 in Clang),
with 16 confirmed as new pessimization bugs.
Our evaluation shows that CLower accurately detects diverse, impactful pessimization
bugs, the majority of which (75%) also manifest for heap-allocated objects,
demonstrating that the underlying compiler flaws are general and not limited to global memory.
Furthermore, we identify a systematic conflict between
compiler optimizations and pessimization bugs, which causes many such bugs to remain hidden
in compiler versions. This study sheds light on the under-explored area of compiler
pessimization and provides a practical tool for improving compiler quality.
Wed 7 OctDisplayed time zone: Pacific Time (US & Canada) change
10:30 - 12:00 | Analysing Dependencies and AlarmsOOPSLA at East Hall 1 Chair(s): Manu Sridharan University of California at Riverside | ||
10:30 18mTalk | Floating-Point Usage on GitHub: A Large-Scale Study of Statically Typed Languages OOPSLA Andrea Gilot Uppsala University, Tobias Wrigstad Uppsala University, Eva Darulova Uppsala University DOI Pre-print | ||
10:48 18mTalk | A Tale of 1001 LoC: Potential Runtime Error-Guided Specification Synthesis for Verifying Large-Scale Programs OOPSLA Zhongyi Wang Zhejiang University, Tengjie Lin Zhejiang University, Mingshuai Chen Zhejiang University, Haokun Li Peking University, Mingqi Yang Zhejiang University, Xiao Yi Chinese University of Hong Kong, Shengchao Qin Xidian University, Yixing Luo Beijing Institute of Control Engineering, Xiaofeng Li Beijing Institute of Control Engineering, Bin Gu Beijing Institute of Control Engineering, Liqiang Lu Zhejiang University, Jianwei Yin Zhejiang University DOI | ||
11:06 18mTalk | Beer: Interactive Alarm Resolution in Bayesian Program Analysis via Exploration-Exploitation OOPSLA DOI | ||
11:24 18mTalk | CLower: Detecting Compiler Pessimization Bugs through Redundant Memory Accesses OOPSLA Jianhao Xu Southeast University, Kunbo Zhang State Key Laboratory for Novel Software Technology at Nanjing University, Mathias Payer EPFL, Kangjie Lu University of Minnesota, Bing Mao State Key Laboratory for Novel Software Technology at Nanjing University DOI | ||