Hostname: page-component-74656f9884-54qdv Total loading time: 0 Render date: 2026-11-10T05:14:37.987Z Has data issue: false hasContentIssue false

Shape Neutral Analysis of Graph-based Data-structures

Published online by Cambridge University Press:  10 August 2018

GREGORY J. DUCK
Affiliation:
Department of Computer Science, National University of Singapore (e-mail: gregory@comp.nus.edu.sg, joxan@comp.nus.edu.sg, ryap@comp.nus.edu.sg)
JOXAN JAFFAR
Affiliation:
Department of Computer Science, National University of Singapore (e-mail: gregory@comp.nus.edu.sg, joxan@comp.nus.edu.sg, ryap@comp.nus.edu.sg)
ROLAND H. C. YAP
Affiliation:
Department of Computer Science, National University of Singapore (e-mail: gregory@comp.nus.edu.sg, joxan@comp.nus.edu.sg, ryap@comp.nus.edu.sg)
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the 'Save PDF' action button.

Malformed data-structures can lead to runtime errors such as arbitrary memory access or corruption. Despite this, reasoning over data-structure properties for low-level heap manipulating programs remains challenging. In this paper we present a constraint-based program analysis that checks data-structure integrity, w.r.t. given target data-structure properties, as the heap is manipulated by the program. Our approach is to automatically generate a solver for properties using the type definitions from the target program. The generated solver is implemented using a Constraint Handling Rules (CHR) extension of built-in heap, integer and equality solvers. A key property of our program analysis is that the target data-structure properties are shape neutral, i.e., the analysis does not check for properties relating to a given data-structure graph shape, such as doubly-linked-lists versus trees. Nevertheless, the analysis can detect errors in a wide range of data-structure manipulating programs, including those that use lists, trees, DAGs, graphs, etc. We present an implementation that uses the Satisfiability Modulo Constraint Handling Rules (SMCHR) system. Experimental results show that our approach works well for real-world C programs.

Information

Type
Original Article
Copyright
Copyright © Cambridge University Press 2018