kirancodes.me
To Proof Maintenance & Beyond!

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

Junhee Lee, Seongjoon Hong, Hakjoo Oh

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 errors without introducing new errors.

BibTeX
@inproceedings{Lee-al:FSE18,
  author    = {Junhee Lee and
               Seongjoon Hong and
               Hakjoo Oh},
  title     = {{MemFix:} static analysis-based repair of memory deallocation errors for C},
  booktitle = {{ESEC/SIGSOFT} {FSE}},
  pages     = {95--106},
  publisher = {{ACM}},
  year      = {2018},
}

Related papers