Program Repair Guided by Datalog-Defined Static Analysis

被引:3
作者
Liu, Yu [1 ]
Mechtaev, Sergey [2 ]
Subotic, Pavle [3 ]
Roychoudhury, Abhik [1 ]
机构
[1] Natl Univ Singapore, Singapore, Singapore
[2] UCL, London, England
[3] Microsoft, Belgrade, Serbia
来源
PROCEEDINGS OF THE 31ST ACM JOINT MEETING EUROPEAN SOFTWARE ENGINEERING CONFERENCE AND SYMPOSIUM ON THE FOUNDATIONS OF SOFTWARE ENGINEERING, ESEC/FSE 2023 | 2023年
关键词
program repair; static analysis; Datalog; symbolic execution; LARGE-SCALE DATALOG;
D O I
10.1145/3611643.3616363
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Automated program repair relying on static analysis complements test-driven repair, since it does not require failing tests to repair a bug, and it avoids test-overfitting by considering program properties. Due to the rich variety and complexity of program analyses, existing static program repair techniques are tied to specific analysers, and thus repair only narrow classes of defects. To develop a general-purpose static program repair framework that targets a wide range of properties and programming languages, we propose to integrate program repair with Datalog-based analysis. Datalog solvers are programmable fixed point engines which can be used to encode many program analysis problems in a modular fashion. The program under analysis is encoded as Datalog facts, while the fixed point equations of the program analysis are expressed as recursive Datalog rules. In this context, we view repairing the program as modifying the corresponding Datalog facts. This is accomplished by a novel technique, symbolic execution of Datalog, that evaluates Datalog queries over a symbolic database of facts, instead of a concrete set of facts. The result of symbolic query evaluation allows us to infer what changes to a given set of Datalog facts repair the program so that it meets the desired analysis goals. We developed a symbolic executor for Datalog called Symlog, on top of which we built a repair tool SymlogRepair. We show the versatility of our approach on several analysis problems - repairing null pointer exceptions in Java programs, repairing data leaks in Python notebooks, and repairing four types of security vulnerabilities in Solidity smart contracts.
引用
收藏
页码:1216 / 1228
页数:13
相关论文
共 50 条
  • [1] [Anonymous], 2023, CodeQL (formely Semmle)
  • [2] [Anonymous], 2023, Securify 2.0 security scanner for Ethereum smart contracts
  • [3] Arenas M., 1999, Proceedings of the Eighteenth ACM SIGMOD-SIGACT-SIGART Symposium on Principles of Database Systems, P68, DOI 10.1145/303976.303983
  • [4] Using static analysis to find bugs
    Ayewah, Nathaniel
    Pugh, William
    Hovemeyer, David
    Morgenthaler, J. David
    Penix, John
    [J]. IEEE SOFTWARE, 2008, 25 (05) : 22 - 29
  • [5] PHOENIX: Automated Data-Driven Synthesis of Repairs for Static Analysis Violations
    Bavishi, Rohan
    Yoshida, Hiroaki
    Prasad, Mukul R.
    [J]. ESEC/FSE'2019: PROCEEDINGS OF THE 2019 27TH ACM JOINT MEETING ON EUROPEAN SOFTWARE ENGINEERING CONFERENCE AND SYMPOSIUM ON THE FOUNDATIONS OF SOFTWARE ENGINEERING, 2019, : 613 - 624
  • [6] Formulog: Datalog for SMT-Based Static Analysis
    Bembenek, Aaron
    Greenberg, Michael
    Chong, Stephen
    [J]. PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2020, 4 (OOPSLA):
  • [7] Causes for query answers from databases: Datalog abduction, view-updates, and integrity constraints
    Bertossi, Leopoldo
    Salimi, Babak
    [J]. INTERNATIONAL JOURNAL OF APPROXIMATE REASONING, 2017, 90 : 226 - 252
  • [8] RACERD: Compositional Static Race Detection
    Blackshear, Sam
    Gorogiannis, Nikos
    O'Hearn, Peter W.
    Sergey, Ilya
    [J]. PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2018, 2 (02):
  • [9] Strictly Declarative Specification of Sophisticated Points-to Analyses
    Bravenboer, Martin
    Smaragdakis, Yannis
    [J]. ACM SIGPLAN NOTICES, 2009, 44 (10) : 243 - 261
  • [10] Cruz Alfredo, 2022, ACM Transactions on Software, DOI [10.1145/3548684EngineeringandMethodology, DOI 10.1145/3548684ENGINEERINGANDMETHODOLOGY]