MemFix: Static analysis-based repair of memory deallocation errors for C

Junhee Lee, Seongjoon Hong, Hakjoo Oh

Research output: Chapter in Book/Report/Conference proceedingConference contribution

1 Citation (Scopus)

Abstract

We present MemFix, an automated technique for fixing memory deallocation errors in C programs. MemFix aims to fix memory-leak, double-free, and use-after-free errors, which occur when developers fail to properly deallocate memory objects. MemFix attempts to fix these errors by finding a set of free-statements that correctly deallocate all allocated objects without causing double-frees and use-after-frees. The key insight behind MemFix is that finding such a set of deallocation statements corresponds to solving an exact cover problem derived from a variant of typestate static analysis. We formally present the technique and experimentally show that MemFix is able to fix real errors found in open-source programs. Because MemFix is based on a sound static analysis, the generated patches guarantee to fix the original error without introducing new errors.

Original languageEnglish
Title of host publicationESEC/FSE 2018 - Proceedings of the 2018 26th ACM Joint Meeting on European So ftware Engineering Conference and Symposium on the Foundations of So ftware Engineering
EditorsAlessandro Garci, Corina S. Pasareanu, Gary T. Leavens
PublisherAssociation for Computing Machinery, Inc
Pages95-106
Number of pages12
ISBN (Electronic)9781450355735
DOIs
Publication statusPublished - 2018 Oct 26
Event26th ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering, ESEC/FSE 2018 - Lake Buena Vista, United States
Duration: 2018 Nov 42018 Nov 9

Publication series

NameESEC/FSE 2018 - Proceedings of the 2018 26th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering

Conference

Conference26th ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering, ESEC/FSE 2018
CountryUnited States
CityLake Buena Vista
Period18/11/418/11/9

Fingerprint

Static analysis
Repair
Data storage equipment
Acoustic waves

Keywords

  • Debugging
  • Program Analysis
  • Program Repair

ASJC Scopus subject areas

  • Software
  • Artificial Intelligence

Cite this

Lee, J., Hong, S., & Oh, H. (2018). MemFix: Static analysis-based repair of memory deallocation errors for C. In A. Garci, C. S. Pasareanu, & G. T. Leavens (Eds.), ESEC/FSE 2018 - Proceedings of the 2018 26th ACM Joint Meeting on European So ftware Engineering Conference and Symposium on the Foundations of So ftware Engineering (pp. 95-106). (ESEC/FSE 2018 - Proceedings of the 2018 26th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering). Association for Computing Machinery, Inc. https://doi.org/10.1145/3236024.3236079

MemFix : Static analysis-based repair of memory deallocation errors for C. / Lee, Junhee; Hong, Seongjoon; Oh, Hakjoo.

ESEC/FSE 2018 - Proceedings of the 2018 26th ACM Joint Meeting on European So ftware Engineering Conference and Symposium on the Foundations of So ftware Engineering. ed. / Alessandro Garci; Corina S. Pasareanu; Gary T. Leavens. Association for Computing Machinery, Inc, 2018. p. 95-106 (ESEC/FSE 2018 - Proceedings of the 2018 26th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering).

Research output: Chapter in Book/Report/Conference proceedingConference contribution

Lee, J, Hong, S & Oh, H 2018, MemFix: Static analysis-based repair of memory deallocation errors for C. in A Garci, CS Pasareanu & GT Leavens (eds), ESEC/FSE 2018 - Proceedings of the 2018 26th ACM Joint Meeting on European So ftware Engineering Conference and Symposium on the Foundations of So ftware Engineering. ESEC/FSE 2018 - Proceedings of the 2018 26th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering, Association for Computing Machinery, Inc, pp. 95-106, 26th ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering, ESEC/FSE 2018, Lake Buena Vista, United States, 18/11/4. https://doi.org/10.1145/3236024.3236079
Lee J, Hong S, Oh H. MemFix: Static analysis-based repair of memory deallocation errors for C. In Garci A, Pasareanu CS, Leavens GT, editors, ESEC/FSE 2018 - Proceedings of the 2018 26th ACM Joint Meeting on European So ftware Engineering Conference and Symposium on the Foundations of So ftware Engineering. Association for Computing Machinery, Inc. 2018. p. 95-106. (ESEC/FSE 2018 - Proceedings of the 2018 26th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering). https://doi.org/10.1145/3236024.3236079
Lee, Junhee ; Hong, Seongjoon ; Oh, Hakjoo. / MemFix : Static analysis-based repair of memory deallocation errors for C. ESEC/FSE 2018 - Proceedings of the 2018 26th ACM Joint Meeting on European So ftware Engineering Conference and Symposium on the Foundations of So ftware Engineering. editor / Alessandro Garci ; Corina S. Pasareanu ; Gary T. Leavens. Association for Computing Machinery, Inc, 2018. pp. 95-106 (ESEC/FSE 2018 - Proceedings of the 2018 26th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering).
@inproceedings{f8e46c48e9ff45f486ecf361e377f0d2,
title = "MemFix: Static analysis-based repair of memory deallocation errors for C",
abstract = "We present MemFix, an automated technique for fixing memory deallocation errors in C programs. MemFix aims to fix memory-leak, double-free, and use-after-free errors, which occur when developers fail to properly deallocate memory objects. MemFix attempts to fix these errors by finding a set of free-statements that correctly deallocate all allocated objects without causing double-frees and use-after-frees. The key insight behind MemFix is that finding such a set of deallocation statements corresponds to solving an exact cover problem derived from a variant of typestate static analysis. We formally present the technique and experimentally show that MemFix is able to fix real errors found in open-source programs. Because MemFix is based on a sound static analysis, the generated patches guarantee to fix the original error without introducing new errors.",
keywords = "Debugging, Program Analysis, Program Repair",
author = "Junhee Lee and Seongjoon Hong and Hakjoo Oh",
year = "2018",
month = "10",
day = "26",
doi = "10.1145/3236024.3236079",
language = "English",
series = "ESEC/FSE 2018 - Proceedings of the 2018 26th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering",
publisher = "Association for Computing Machinery, Inc",
pages = "95--106",
editor = "Alessandro Garci and Pasareanu, {Corina S.} and Leavens, {Gary T.}",
booktitle = "ESEC/FSE 2018 - Proceedings of the 2018 26th ACM Joint Meeting on European So ftware Engineering Conference and Symposium on the Foundations of So ftware Engineering",

}

TY - GEN

T1 - MemFix

T2 - Static analysis-based repair of memory deallocation errors for C

AU - Lee, Junhee

AU - Hong, Seongjoon

AU - Oh, Hakjoo

PY - 2018/10/26

Y1 - 2018/10/26

N2 - We present MemFix, an automated technique for fixing memory deallocation errors in C programs. MemFix aims to fix memory-leak, double-free, and use-after-free errors, which occur when developers fail to properly deallocate memory objects. MemFix attempts to fix these errors by finding a set of free-statements that correctly deallocate all allocated objects without causing double-frees and use-after-frees. The key insight behind MemFix is that finding such a set of deallocation statements corresponds to solving an exact cover problem derived from a variant of typestate static analysis. We formally present the technique and experimentally show that MemFix is able to fix real errors found in open-source programs. Because MemFix is based on a sound static analysis, the generated patches guarantee to fix the original error without introducing new errors.

AB - We present MemFix, an automated technique for fixing memory deallocation errors in C programs. MemFix aims to fix memory-leak, double-free, and use-after-free errors, which occur when developers fail to properly deallocate memory objects. MemFix attempts to fix these errors by finding a set of free-statements that correctly deallocate all allocated objects without causing double-frees and use-after-frees. The key insight behind MemFix is that finding such a set of deallocation statements corresponds to solving an exact cover problem derived from a variant of typestate static analysis. We formally present the technique and experimentally show that MemFix is able to fix real errors found in open-source programs. Because MemFix is based on a sound static analysis, the generated patches guarantee to fix the original error without introducing new errors.

KW - Debugging

KW - Program Analysis

KW - Program Repair

UR - http://www.scopus.com/inward/record.url?scp=85058294146&partnerID=8YFLogxK

UR - http://www.scopus.com/inward/citedby.url?scp=85058294146&partnerID=8YFLogxK

U2 - 10.1145/3236024.3236079

DO - 10.1145/3236024.3236079

M3 - Conference contribution

AN - SCOPUS:85058294146

T3 - ESEC/FSE 2018 - Proceedings of the 2018 26th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering

SP - 95

EP - 106

BT - ESEC/FSE 2018 - Proceedings of the 2018 26th ACM Joint Meeting on European So ftware Engineering Conference and Symposium on the Foundations of So ftware Engineering

A2 - Garci, Alessandro

A2 - Pasareanu, Corina S.

A2 - Leavens, Gary T.

PB - Association for Computing Machinery, Inc

ER -