Detecting memory access errors with flow-sensitive conditional range analysis

  • Authors:
  • Yimin Xia;Jun Luo;Minxuan Zhang

  • Affiliations:
  • School of Computer Science, National University of Defense Technology, Changsha, P.R. China;School of Computer Science, National University of Defense Technology, Changsha, P.R. China;School of Computer Science, National University of Defense Technology, Changsha, P.R. China

  • Venue:
  • ICESS'05 Proceedings of the Second international conference on Embedded Software and Systems
  • Year:
  • 2005

Quantified Score

Hi-index 0.01

Visualization

Abstract

Accessing an out-of-bounds memory address can lead to nondeterministic behaviors or elusive crashes. Static analysis can detect memory access errors from program source codes without runtime overhead, but existing techniques are either very imprecise or exponential cost. This paper proposes a precise and effective method to detect memory access errors. Firstly, it generates a state for each statement with a flow-sensitive, inter-procedural algorithm. A state includes not only range constraints like the traditional range analysis, but also occurrence conditions of the range constraints. Secondly, it solves states of memory access statement to evaluate the sizes of accessed memory bounds. The costs of state generation and state resolution are polynomial. We have implemented a prototype of the analysis method. Applied to 7 popular programs, the prototype found 40 memory access errors with a high precision of 80%.