Skip to Main content Skip to Navigation
Journal articles

Fast as a shadow, expressive as a tree: Optimized memory monitoring for C

Abstract : One classical approach to ensuring memory safety of C programs is based on storing block metadata in a tree-like datastructure. However it becomes relatively slow when the number of memory locations in the tree becomes high. Another solution, based on shadow memory, allows very fast constant-time access to metadata and led to development of several highly optimized tools for the detection of memory safety errors. However, this solution appears to be insufficient for evaluation of complex memory-related properties of an expressive specification language. In this work, we address memory monitoring in the context of runtime assertion checking of C programs annotated in E-ACSL, an expressive specification language offered by the FRAMA-C framework for the analysis of C code. We present an original combination of a tree-based and a shadow-memory-based techniques that reconciles the efficiency of shadow memory and the higher expressiveness of annotations that can be evaluated using a tree of metadata. Shadow memory with its instant access to stored metadata is used whenever small shadow metadata suffices to evaluate required annotations, while richer metadata stored in a compact prefix tree (Patricia trie) is used for evaluation of more complex memory annotations supported by E-ACSL. We also present a preliminary static analysis step that determines which variables should be monitored (and in which way) in order to be able to evaluate annotations present in the program. The combined monitoring technique and the pre-analysis step have been implemented in the runtime assertion checking tool for E-ACSL. Our initial experiments confirm that the proposed hybrid approach leads to a significant speedup with respect to an earlier implementation based on a Patricia trie alone without any loss of precision, while the proposed static analysis reduces the monitoring of irrelevant variables and further improves the performances of the instrumented code.
Document type :
Journal articles
Complete list of metadatas

https://hal-cea.archives-ouvertes.fr/cea-01845194
Contributor : Léna Le Roy <>
Submitted on : Friday, July 20, 2018 - 11:10:56 AM
Last modification on : Monday, February 10, 2020 - 6:14:14 PM

Identifiers

Collections

Citation

A. Jakobsson, N. Kosmatov, J. Signoles. Fast as a shadow, expressive as a tree: Optimized memory monitoring for C. Science of Computer Programming, Elsevier, 2016, 132, pp.226-246. ⟨10.1016/j.scico.2016.09.003⟩. ⟨cea-01845194⟩

Share

Metrics

Record views

83