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 条
  • [41] Static Analysis Approach for Defect Detection in Multithreaded C/C plus plus Programs
    Moiseev, Mikhail
    [J]. SOFTWARE ENGINEERING FOR RESILIENT SYSTEMS, SERENE 2013, 2013, 8166 : 169 - 183
  • [42] A Context-Sensitive Memory Model for Verification of C/C plus plus Programs
    Gurfinkel, Arie
    Navas, Jorge A.
    [J]. STATIC ANALYSIS (SAS 2017), 2017, 10422 : 148 - 168
  • [43] HATI: Hardware Assisted Thread Isolation for Concurrent C/C plus plus Programs
    Santos, Juan Carlos Martinez
    Fei, Yunsi
    [J]. PROCEEDINGS OF 2014 IEEE INTERNATIONAL PARALLEL & DISTRIBUTED PROCESSING SYMPOSIUM WORKSHOPS (IPDPSW), 2014, : 322 - 331
  • [44] Automatic Test Generation for C and C plus plus Programs, Using Symbolic Execution
    Yoshida, Hiroaki
    Li, Guodong
    Kamiya, Takuki
    Ghosh, Indradeep
    Rajan, Sreeranga
    Tokumoto, Susumu
    Munakata, Kazuki
    Uehara, Tadahiro
    [J]. IEEE SOFTWARE, 2017, 34 (05) : 30 - 37
  • [45] HWASanIO: Detecting C/C plus plus Intra-object Overflows with Memory Shading
    Hohentanner, Konrad
    Kasten, Florian
    Auer, Lukas
    [J]. PROCEEDINGS OF THE 12TH ACM SIGPLAN INTERNATIONAL WORKSHOP ON THE STATE OF THE ART IN PROGRAM ANALYSIS, SOAP 2023, 2023, : 27 - 33
  • [46] Bounded Model Checking of C plus plus Programs Based on the Qt Framework
    Sousa, Felipe R. M.
    Cordeiro, Lucas C.
    de Lima Filho, Eddie B.
    [J]. 2015 IEEE 4TH GLOBAL CONFERENCE ON CONSUMER ELECTRONICS (GCCE), 2015, : 179 - 180
  • [47] Poster: Pairika-A Failure Diagnosis Benchmark for C plus plus Programs
    Rahman, Md. Rezaur
    Golagha, Mojdeh
    Pretschner, Alexander
    [J]. PROCEEDINGS 2018 IEEE/ACM 40TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING - COMPANION (ICSE-COMPANION, 2018, : 204 - 205
  • [48] SMT-Based Bounded Model Checking of C plus plus Programs
    Ramalho, Mikhail
    Freitas, Mauro
    Sousa, Felipe
    Marques, Hendrio
    Cordeiro, Lucas
    Fischer, Bernd
    [J]. 2013 20TH ANNUAL IEEE INTERNATIONAL CONFERENCE AND WORKSHOPS ON THE ENGINEERING OF COMPUTER BASED SYSTEMS (ECBS 2013), 2013, : 147 - 156
  • [49] SoAx: A generic C plus plus Structure of Arrays for handling particles in HPC codes
    Homann, Holger
    Laenen, Francois
    [J]. COMPUTER PHYSICS COMMUNICATIONS, 2018, 224 : 325 - 332
  • [50] Detecting use-after-free bugs in embedded C programs
    Wang, Yaxin
    Li, Xiaoqing
    Wu, Gaofei
    Tang, Shijian
    Zhu, Yajie
    Dong, Ting
    [J]. Xi'an Dianzi Keji Daxue Xuebao/Journal of Xidian University, 2021, 48 (01): : 124 - 132