Lune

ICSE2025顶会

Understanding Compiler Bugs in Real Development

Hao Zhong

摘要

Compilers are critical in development, but compiler bugs can cause hidden and serious bugs in their compiled code. To deepen the understanding of compiler bugs, in the prior empirical studies, researchers read the bug reports and patches of compilers, and analyze their causes, locations, and patterns. Although they derive many interesting findings, their studies are limited. First, as bug reports seldom explain which projects encounter compiler bugs, it is infeasible to understand the outreaching impact. Second, before compiler bugs are fixed, programmers can bypass such bugs. The bug reports of compilers do not introduce such workarounds. Finally, the distribution of compiler bugs can be distorted, since researchers and compiler developers also file bug reports. In this paper, we propose a novel angle to analyze compiler bugs. Instead of compiler bug reports, we collect compiler bugs that are mentioned in real development. When programmers encounter compiler bugs in real development, they can leave traces in their commit messages. By searching such messages, we collected 644 unique commits whose messages explicitly mention the urls of compiler bugs. From this angle, in this paper, we conduct the first empirical study to analyze compiler bugs in the wild. We summarize our results into seven useful findings for users, compiler developers, and researchers. For example, for researchers, we find that some large workarounds of compiler bugs involve repetitive and systematic changes, which indicates a new research opportunity for code migration tools. Furthermore, we attempt to apply our findings in real development, and we obtain positive feedback. 1return _mm_set_epi32( * (int * )__P, (int)0,(int)0,(int)0); 2 + return _mm_set_epi32(0, 0, 0, ( * (__m32_u * )__P)[0]); google / XNNPACK Public Commit Work around _mm_loadu_si32 broken on latest gcc See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99754 for details master (#3149) Mar* authored and xnnpack-bot committed on Jun 15, 2022 1 parent 56ddd07 commit b627348 Code Issues 15 Pull requests 39 Actions Security Insights Browse files 216 src/amalgam/avx.c Large diffs are not rendered by default. 224 src/amalgam/avx2.c Large diffs are not rendered by default. 8 src/amalgam/avx512skx.c 3511 3511 const __m512i vbias = _mm512_load_si512(params->avx512.bias); 3512 3512 const __m512i va_multiplier = _mm512_load_si512(params->avx512.a_multiplier); 3513 3513 const __m512i vb_multiplier = _mm512_load_si512(params->avx512.b_multiplier); 3514 const __m128i vshift = _mm_loadu_si32(params->avx512.shift); -3514 const __m128i vshift = _mm_load_si128((const __m128i*) params->avx512.shift); + Load diff Load diff Showing 343 changed files with 10,063 additions and 10,063 deletions. Split Unified (a) a commit of XNNPACK 1 src/amalgam/avx2.c 2 @@ -3231,19 +3231,19 ... 3 -...= _mm_loadu_si32(w); 4 +...= _mm_cvtsi32_si128(((const int * ) w)[0]); 5 src/amalgam/avx512skx.c 6 @@ -3511,7 +3511,7 ... 7 -...= _mm_loadu_si32(params->avx512.shift); 8 +...= _mm_load_si128((const __m128i * ) params->avx512.shift);

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

可以从这些问题问起

Lune 可以查阅

全文 · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Enriching Compiler Testing with Real Program from Bug Report 引用了 A comprehensive study of deep learning compiler bugs
  • Enriching Compiler Testing with Real Program from Bug Report 引用了 Enhanced Compiler Bug Isolation via Memoized Search
  • Compiler Test-Program Generation via Memoized Configuration Search 引用了 Enriching Compiler Testing with Real Program from Bug Report
  • Compiler Test-Program Generation via Memoized Configuration Search 引用了 A comprehensive study of deep learning compiler bugs
  • Compiler Test-Program Generation via Memoized Configuration Search 引用了 Enhanced Compiler Bug Isolation via Memoized Search
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

它引用的 Paper7

  1. A comprehensive study of deep learning compiler bugsQingchao Shen, Haoyang Ma, Junjie Chen, Yongqiang Tian 等FSE 2021 · 123 次引用
  2. UniSan: Proactive Kernel Memory Initialization to Eliminate Data LeakagesKangjie Lu, Chengyu Song, Taesoo Kim, Wenke LeeCCS 2016 · 81 次引用
  3. Enhanced Compiler Bug Isolation via Memoized SearchJunjie Chen, Haoyang Ma, Lingming ZhangASE 2020 · 36 次引用
  4. Enriching Compiler Testing with Real Program from Bug ReportHao ZhongASE 2022 · 24 次引用
  5. Compiler Test-Program Generation via Memoized Configuration SearchJunjie Chen, Chenyao Suo, Jiajun Jiang, Peiqi Chen 等ICSE 2023 · 19 次引用

相关 Paper

  1. Silent Bugs Matter: A Study of Compiler-Introduced Security BugsJianhao Xu, Kangjie Lu, Zhengjie Du, Zhu Ding 等USENIX Security 2023
  2. Well-typed programs can go wrong: a study of typing-related bugs in JVM compilersStefanos Chaliasos, Thodoris Sotiropoulos, Georgios-Petros Drosos, Charalambos Mitropoulos 等OOPSLA 2021 · 31 次引用
  3. FLUX: Finding Bugs with LLVM IR Based Unit Test CrossoversEric Liu, Shengjie Xu, David LieASE 2023 · 8 次引用
  4. CombCT: Compiler Testing via Combinatorial TestingChuan Luo, Shaoke Cui, Jiahao Yan, Junjie Chen 等ICSE 2026
  5. On the Feasibility of Deduplicating Compiler Bugs with BisectionXintong Zhou, Zhenyang Xu, Yongqiang Tian, Chengnian SunISSTA 2026 · 1 次引用
黄昏的海面,两侧是细线勾勒的悬崖