A Library Modeling Language for the Static Analysis of C Programs

被引:4
|
作者
Ouadjaout, Abdelraouf [1 ]
Mine, Antoine [1 ,2 ]
机构
[1] Sorbonne Univ, LIP6, CNRS, F-75005 Paris, France
[2] Inst Univ France, F-75005 Paris, France
来源
STATIC ANALYSIS (SAS 2020) | 2020年 / 12389卷
基金
欧洲研究理事会;
关键词
DOMAINS;
D O I
10.1007/978-3-030-65474-0_11
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
We present a specification language aiming at soundly modeling unavailable functions in a static analyzer for C by abstract interpretation. It takes inspiration from Behavioral Interface Specification Languages popular in deductive verification, notably Frama-C's ACSL, as we annotate function prototypes with pre and post-conditions expressed concisely in a first-order logic, but with key differences. Firstly, the specification aims at replacing a function implementation in a safety analysis, not verifying its functional correctness. Secondly, we do not rely on theorem provers; instead, specifications are interpreted at function calls by our abstract interpreter. We implemented the language into Mopsa, a static analyzer designed to easily reuse abstract domains across widely different languages (such as C and Python). We show how its design helped us support a logic-based language with minimal effort. Notably, it was sufficient to add only a handful transfer functions (including very selective support for quantifiers) to achieve a sound and precise analysis. We modeled a large part of the GNU C library and C execution environment in our language, including the manipulation of unbounded strings, file descriptors, and programs with an unbounded number of symbolic command-line parameters, which allows verifying programs in a realistic setting. We report on the analysis of C programs from the Juliet benchmarks and Coreutils.
引用
收藏
页码:223 / 247
页数:25
相关论文
共 50 条
  • [1] Static Analysis of Lockless Microcontroller C Programs
    Beckschulze, Eva
    Biallas, Sebastian
    Kowalewski, Stefan
    [J]. ELECTRONIC PROCEEDINGS IN THEORETICAL COMPUTER SCIENCE, 2012, (102): : 103 - 114
  • [2] A Memory Model for Static Analysis of C Programs
    Xu, Zhongxing
    Kremenek, Ted
    Zhang, Jian
    [J]. LEVERAGING APPLICATIONS OF FORMAL METHODS, VERIFICATION, AND VALIDATION, PT I, 2010, 6415 : 535 - +
  • [3] On multi-language abstraction: Towards a static analysis of multi-language programs
    Buro, Samuele
    Crole, Roy
    Mastroeni, Isabella
    [J]. FORMAL METHODS IN SYSTEM DESIGN, 2023,
  • [4] On Multi-language Abstraction Towards a Static Analysis of Multi-language Programs
    Buro, Samuele
    Crole, Roy L.
    Mastroeni, Isabella
    [J]. STATIC ANALYSIS (SAS 2020), 2020, 12389 : 310 - 332
  • [5] SharpChecker: Static analysis tool for C# programs
    Koshelev, V. K.
    Ignatiev, V. N.
    Borzilov, A. I.
    Belevantsev, A. A.
    [J]. PROGRAMMING AND COMPUTER SOFTWARE, 2017, 43 (04) : 268 - 276
  • [6] Modular Static Analysis of String Manipulations in C Programs
    Journault, Matthieu
    Mine, Antoine
    Ouadjaout, Abdelraouf
    [J]. STATIC ANALYSIS (SAS 2018), 2018, 11002 : 243 - 262
  • [7] SharpChecker: Static analysis tool for C# programs
    V. K. Koshelev
    V. N. Ignatiev
    A. I. Borzilov
    A. A. Belevantsev
    [J]. Programming and Computer Software, 2017, 43 : 268 - 276
  • [8] Inferring Effective Types for Static Analysis of C Programs
    Jeannet, Bertrand
    Sotin, Pascal
    [J]. ELECTRONIC NOTES IN THEORETICAL COMPUTER SCIENCE, 2012, 288 : 37 - 47
  • [9] Type Inference for C: Applications to the Static Analysis of Incomplete Programs
    Melo, Leandro T. C.
    Ribeiro, Rodrigo G.
    Guimaraes, Breno C. F.
    Quintao Pereira, Fernando Magno
    [J]. ACM TRANSACTIONS ON PROGRAMMING LANGUAGES AND SYSTEMS, 2020, 42 (03):
  • [10] Static Bound Analysis of Dynamically Allocated Resources for C Programs
    Fan, Guangsheng
    Chen, Taoqing
    Yin, Banghu
    Chen, Liqian
    Wang, Tengbin
    Wang, Ji
    [J]. 2021 IEEE 32ND INTERNATIONAL SYMPOSIUM ON SOFTWARE RELIABILITY ENGINEERING (ISSRE 2021), 2021, : 390 - 400