Finding and Analyzing Compiler Warning Defects

被引:53
作者
Sun, Chengnian [1 ]
Le, Vu [1 ]
Su, Zhendong [1 ]
机构
[1] Univ Calif Davis, Dept Comp Sci, Davis, CA 95616 USA
来源
2016 IEEE/ACM 38TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING (ICSE) | 2016年
基金
美国国家科学基金会;
关键词
D O I
10.1145/2884781.2884879
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Good compiler diagnostic warnings facilitate software development as they indicate likely programming mistakes or code smells. However, due to compiler bugs, the warnings may be erroneous, superfluous or missing, even for mature production compilers like GCC and Clang. In this paper, we (1) propose the first randomized differential testing technique to detect compiler warning defects and (2) describe our extensive evaluation in finding warning defects in widely-used C compilers. At the high level, our technique starts with generating random programs to trigger compilers to emit a variety of compiler warnings, aligns the warnings from different compilers, and identifies inconsistencies as potential bugs. We develop effective techniques to overcome three specific challenges: (1) How to generate random programs, (2) how to align textual warnings, and (3) how to reduce test programs for bug reporting? Our technique is very effective - we have found and reported 60 bugs for GCC (38 confirmed, assigned or fixed) and 39 for Clang (14 confirmed or fixed). This case study not only demonstrates our technique's effectiveness, but also highlights the need to continue improving compilers' warning support, an essential, but rather neglected aspect of compilers.
引用
收藏
页码:203 / 213
页数:11
相关论文
共 28 条
[1]  
Allain A., WHY BOTHER COMPILER
[2]  
Ammann P., 2016, INTRO SOFTWARE TESTI
[3]  
[Anonymous], 2015, PROC INT S SOFTW TES
[4]   Evaluating Static Analysis Defect Warnings On Production Software [J].
Ayewah, Nathaniel ;
Pugh, William ;
Morgenthaler, J. David ;
Penix, John ;
Zhou, YuQian .
PASTE'07 PROCEEDINGS OF THE 2007 ACM SIGPLAN- SIGSOFT WORKSHOP ON PROGRAM ANALYSIS FOR SOFTWARE TOOLS & ENGINEERING, 2007, :1-+
[5]   ERROR MESSAGES - THE NEGLECTED AREA OF THE MAN-MACHINE INTERFACE [J].
BROWN, PJ .
COMMUNICATIONS OF THE ACM, 1983, 26 (04) :246-249
[6]   Taming Compiler Fuzzers [J].
Chen, Yang ;
Groce, Alex ;
Zhang, Chaoqiang ;
Wong, Weng-Keen ;
Fern, Xiaoli ;
Eide, Eric ;
Regehr, John .
ACM SIGPLAN NOTICES, 2013, 48 (06) :197-207
[7]  
Coull Natalie J, 2008, THESIS
[8]  
Cuoq Pascal, 2012, NASA Formal Methods. Proceedings of the 4th International Symposium, NFM 2012, P120, DOI 10.1007/978-3-642-28891-3_12
[9]  
Flowers T., 2004, FRONT ED 2004 FIE 20, V1, DOI 10.1109/FIE.2004
[10]  
Hartmann B, 2010, CHI2010: PROCEEDINGS OF THE 28TH ANNUAL CHI CONFERENCE ON HUMAN FACTORS IN COMPUTING SYSTEMS, VOLS 1-4, P1019