Detecting Exception Handling Bugs in C plus plus Programs

被引:0
|
作者
Zhang, Hao [1 ,2 ]
Luo, Ji [2 ,3 ]
Hu, Mengze [1 ,4 ]
Yan, Jun [1 ,2 ]
Zhang, Jian [1 ,2 ]
Qiu, Zongyan [2 ,5 ]
机构
[1] Chinese Acad Sci, State Key Lab Comp Sci, Inst Software, Beijing, Peoples R China
[2] Univ Chinese Acad Sci, Beijing, Peoples R China
[3] Chinese Acad Sci, Tech Ctr Software Engn, Inst Software, Beijing, Peoples R China
[4] Univ Chinese Acad Sci, Hangzhou Inst Adv Study, Beijing, Peoples R China
[5] Peking Univ, Sch Math Sci, Beijing, Peoples R China
基金
中国国家自然科学基金;
关键词
static analysis; exception handling; bug finding;
D O I
10.1109/ICSE48619.2023.00098
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Exception handling is a mechanism in modern programming languages. Studies have shown that the exception handling code is error-prone. However, there is still limited research on detecting exception handling bugs, especially for C++ programs. To tackle the issue, we try to precisely represent the exception control flow in C++ programs and propose an analysis method that makes use of the control flow to detect such bugs. More specifically, we first extend control flow graph by introducing the concepts of five different kinds of basic blocks, and then modify the classic symbolic execution framework by extending the program state to a quadruple and properly processing try, throw and catch statements. Based on the above techniques, we develop a static analysis tool on the top of Clang Static Analyzer to detect exception handling bugs. We run our tool on projects with high stars from GitHub and find 36 exception handling bugs in 8 projects, with a precision of 84%. We compare our tool with four state-of-the-art static analysis tools (Cppcheck, Clang Static Analyzer, Facebook Infer and IKOS) on projects from GitHub and handmade benchmarks. On the GitHub projects, other tools are not able to detect any exception handling bugs found by our tool. On the handmade benchmarks, our tool has a significant higher recall.
引用
收藏
页码:1084 / 1095
页数:12
相关论文
共 50 条
  • [1] The Use of C plus plus Exception Handling Constructs: A Comprehensive Study
    Bonifacio, Rodrigo
    Carvalho, Fausto
    Ramos, Guilherme N.
    Kulesza, Uira
    Coelho, Roberta
    [J]. 2015 IEEE 15TH INTERNATIONAL WORKING CONFERENCE ON SOURCE CODE ANALYSIS AND MANIPULATION (SCAM), 2015, : 21 - 30
  • [2] An exploratory study on exception handling bugs in Java']Java programs
    Ebert, Felipe
    Castor, Fernando
    Serebrenik, Alexander
    [J]. JOURNAL OF SYSTEMS AND SOFTWARE, 2015, 106 : 82 - 101
  • [3] TCD: Statically Detecting Type Confusion Errors in C plus plus Programs
    Zou, Changwei
    Sui, Yulei
    Yan, Hua
    Xue, Jingling
    [J]. 2019 IEEE 30TH INTERNATIONAL SYMPOSIUM ON SOFTWARE RELIABILITY ENGINEERING (ISSRE), 2019, : 292 - 302
  • [4] EXCEPTION HANDLING IN C-PROGRAMS
    LEE, PA
    [J]. SOFTWARE-PRACTICE & EXPERIENCE, 1983, 13 (05): : 389 - 405
  • [5] Detecting and Eliminating Potential Violation of Sequential Consistency for Concurrent C/C plus plus Programs
    Duan, Yuelu
    Feng, Xiaobing
    Wang, Lei
    Zhang, Chao
    Yew, Pen-Chung
    [J]. CGO 2009: INTERNATIONAL SYMPOSIUM ON CODE GENERATION AND OPTIMIZATION, PROCEEDINGS, 2009, : 25 - +
  • [6] A Reflection on "An Exploratory Study on Exception Handling Bugs in Java']Java Programs"
    Ebert, Felipe
    Castor, Fernando
    Serebrenikt, Alexander
    [J]. PROCEEDINGS OF THE 2020 IEEE 27TH INTERNATIONAL CONFERENCE ON SOFTWARE ANALYSIS, EVOLUTION, AND REENGINEERING (SANER '20), 2020, : 552 - 556
  • [7] Detecting C plus plus Compiler Front-End Bugs via Grammar Mutation and Differential Testing
    Tu, Haoxin
    Jiang, He
    Zhou, Zhide
    Tang, Yixuan
    Ren, Zhilei
    Qiao, Lei
    Jiang, Lingxiao
    [J]. IEEE TRANSACTIONS ON RELIABILITY, 2023, 72 (01) : 343 - 357
  • [8] Detecting Memory-Related Bugs by Tracking Heap Memory Management of C plus plus Smart Pointers
    Ma, Xutong
    Yan, Jiwei
    Wang, Wei
    Yan, Jun
    Zhang, Jian
    Qiu, Zongyan
    [J]. 2021 36TH IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMATED SOFTWARE ENGINEERING ASE 2021, 2021, : 880 - 891
  • [9] Interprocedural Exception Analysis for C plus
    Prabhu, Prakash
    Maeda, Naoto
    Balakrishnan, Gogul
    Ivancic, Franjo
    Gupta, Aarti
    [J]. ECOOP 2011 - OBJECT-ORIENTED PROGRAMMING, 2011, 6813 : 583 - 608
  • [10] Model checking C plus plus programs
    Monteiro, Felipe R.
    Gadelha, Mikhail R.
    Cordeiro, Lucas C.
    [J]. SOFTWARE TESTING VERIFICATION & RELIABILITY, 2022, 32 (01):