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 条
  • [31] Dynamically Checking Ownership Policies in Concurrent C/C plus plus Programs
    Martin, Jean-Phillipe
    Hicks, Michael
    Costa, Manuel
    Akritidis, Periklis
    Castro, Miguel
    [J]. POPL'10: PROCEEDINGS OF THE 37TH ANNUAL ACM SIGPLAN-SIGACT SYMPOSIUM ON PRINCIPLES OF PROGRAMMING LANGUAGES, 2010, : 457 - 470
  • [32] A Comprehensive Detection of Memory Corruption Vulnerabilities for C/C plus plus Programs
    Gao, Yuhan
    Chen, Liwei
    Shi, Gang
    Zhang, Fei
    [J]. 2018 IEEE INT CONF ON PARALLEL & DISTRIBUTED PROCESSING WITH APPLICATIONS, UBIQUITOUS COMPUTING & COMMUNICATIONS, BIG DATA & CLOUD COMPUTING, SOCIAL COMPUTING & NETWORKING, SUSTAINABLE COMPUTING & COMMUNICATIONS, 2018, : 354 - 360
  • [33] A Study on Developers' Perceptions About Exception Handling Bugs
    Ebert, Felipe
    Castor, Fernando
    [J]. 2013 29TH IEEE INTERNATIONAL CONFERENCE ON SOFTWARE MAINTENANCE (ICSM), 2013, : 448 - 451
  • [34] Tool for Detecting Standardwise Differences in C plus plus Legacy Code
    Brunner, Tibor
    Pataki, Norbert
    Porkolab, Zoltan
    [J]. 2015 IEEE 13TH INTERNATIONAL SCIENTIFIC CONFERENCE ON INFORMATICS, 2015, : 51 - 56
  • [35] perflint: A Context Sensitive Performance Advisor for C plus plus Programs
    Liu, Lixia
    Rus, Silvius
    [J]. CGO 2009: INTERNATIONAL SYMPOSIUM ON CODE GENERATION AND OPTIMIZATION, PROCEEDINGS, 2009, : 265 - +
  • [36] Examining Structural Correctness of Documentation Comments in C plus plus Programs
    Cseri, Tamas
    [J]. 2015 IEEE 13TH INTERNATIONAL SCIENTIFIC CONFERENCE ON INFORMATICS, 2015, : 73 - 78
  • [37] Designing clamps using CAD programs and C plus plus language
    Urdea, Mihaela
    Parv, Luminita
    Lupulescu, Nouras Barbu
    [J]. PROCEEDINGS OF THE 5TH WSEAS INTERNATIONAL CONFERENCE ON APPLIED AND THEORETICAL MECHANICS (MECHANICS '09), 2009, : 144 - 147
  • [38] Designing clamps using CAD programs and C plus plus language
    Urdea, Mihaela
    Parv, Luminita
    Lupulescu, Nouras Barbu
    [J]. ADVANCES IN MANUFACTURING ENGINEERING, QUALITY AND PRODUCTION SYSTEMS, VOL II, 2009, : 453 - 456
  • [39] 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
  • [40] MagicDetector: A Precise and Scalable Static Deadlock Detector for C/C plus plus Programs
    Cao, Huaxiong
    Gu, Naijie
    Du, Yunkai
    [J]. ARABIAN JOURNAL FOR SCIENCE AND ENGINEERING, 2016, 41 (12) : 5149 - 5167