Skip to main content
Log in

A divide-and-conquer approach for analysing overlaid data structures

  • Published:
Formal Methods in System Design Aims and scope Submit manuscript

Abstract

We present a static program analysis for overlaid data structures such that a node in the structure includes links for multiple data structures and these links are intended to be used at the same time. These overlaid data structures are frequently used in systems code, in order to impose multiple types of indexing structures over the same set of nodes. Our analysis implements two main ideas. The first is to run multiple sub-analyses that track information about non-overlaid data structures, such as lists. The second idea is to control the communication among the sub-analyses using ghost states and ghost instructions. The purpose of this control is to achieve a high level of efficiency by allowing only necessary information to be transferred among sub-analyses and at as few program points as possible. Our analysis has been successfully applied to prove the memory safety of the Linux deadline IO scheduler and AFS server.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Institutional subscriptions

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9

Similar content being viewed by others

Notes

  1. Concretely, \(\varphi(\texttt{q1t},\hspace{-0.2pt}\texttt{c},\alpha)\) is \(\exists uvwxy.\hspace{-0.2pt}\ \mathsf {tseg}(\texttt{q1t},\hspace{-0.2pt}0,\hspace{-0.2pt}\texttt{c},\hspace{-0.2pt}u)_{\alpha}\texttt{c}{\,{\mapsto }\,}\{\texttt{p}{:}u,\hspace{-0.2pt}\texttt{l}{:}v,\hspace{-0.2pt}\texttt{r}{:}x\}_{\alpha}* \mathsf {tseg}(v,\hspace{-0.2pt}\texttt{c},\hspace{-0.2pt} 0,w)_{\alpha} * \mathsf {tseg}(x,\texttt {c},0,y)_{\alpha}\) where \(\mathsf {tseg}\) is a tree segment predicate explained in Sect. 5.

  2. Formally, \(\varphi* \mathsf {tseg}(a,b,c,\_)\) is an abbreviation for \(\exists d.\varphi* \mathsf {tseg}(a,b,c,d)\) for a fresh d.

References

  1. Arnold G, Manevich R, Sagiv M, Shaham R (2006) Combining shape analyses by intersecting abstractions. In: Proc of the international conference on verification, model checking, and abstract interpretation, pp 33–48

    Google Scholar 

  2. Ball T, Levin V, Rajamani SK (2011) A decade of software model checking with SLAM. Commun ACM 54(7):68–76

    Article  Google Scholar 

  3. Ball T, Podelski A, Rajamani S (2001) Boolean and Cartesian abstraction for model checking C programs. In: Proc of the tools and algorithms for the construction and analysis of systems, pp 268–283

    Chapter  Google Scholar 

  4. Blanchet B, Cousot P, Cousot R, Feret J, Mauborgne L, Miné A, Monniaux D, Rival X (2003) A static analyzer for large safety-critical software. In: Proc of the ACM Conference on programming language design and implementation, pp 196–207

    Google Scholar 

  5. Calcagno C, Distefano D, O’Hearn P, Yang H (2009) Compositional shape analysis by means of bi-abduction. In: Proc of the ACM symposium on principles of programming languages, pp 289–300

    Google Scholar 

  6. Cherini R, Rearte L, Blanco J (2010) A shape analysis for non-linear data structures. In: Proc of the international static analysis symposium, pp 201–217

    Google Scholar 

  7. Cousot P, Cousot R (1979) Systematic design of program analysis frameworks. In: Proc of the ACM symposium on principles of programming languages, pp 269–282

    Google Scholar 

  8. Distefano D, O’Hearn P, Yang H (2006) A local shape analysis based on separation logic. In: Proc of the tools and algorithms for the construction and analysis of systems, pp 287–302

    Chapter  Google Scholar 

  9. Hawkins P, Aiken A, Fisher K (2010) Reasoning about shared mutable data structures. Manuscript

  10. Hawkins P, Aiken A, Fisher K, Rinard M, Sagiv M (2010) Data structure fusion. In: Proc of the Asian symposium on programming languages and systems, pp 204–221

    Google Scholar 

  11. Kreiker J, Seidl H, Vojdani V (2010) Shape analysis of low-level C with overlapping structures. In: Proc of the international conference on verification, model checking, and abstract interpretation, pp 214–230

    Chapter  Google Scholar 

  12. Kuncak V, Lam P, Zee K, Rinard M (2006) Modular pluggable analyses for data structure consistency. IEEE Trans Softw Eng 32(12):988–1005

    Article  Google Scholar 

  13. Lee O, Yang H, Petersen R (2011) Program analysis for overlaid data structures. In: Proc of the international conference on computer aided verification, pp 592–608

    Chapter  Google Scholar 

  14. Reps T, Horwitz S, Sagiv S (1995) Precise interprocedural dataflow analysis via graph reachability. In: Proc of the ACM symposium on principles of programming languages, pp 49–61

    Google Scholar 

  15. Reynolds JC (2002) Separation logic: a logic for shared mutable data structures. In: Proc. of the IEEE symposium on logic in computer science, pp 55–74

    Google Scholar 

  16. Sagiv M, Reps T, Wilhelm R (2002) Parametric shape analysis via 3-valued logic. ACM Trans Program Lang Syst 24(3):217–298

    Article  Google Scholar 

  17. Yang H, Lee O, Berdine J, Calcagno C, Cook B, Distefano D, O’Hearn P (2008) Scalable shape analysis for systems code. In: Proc of the international conference on computer aided verification, pp 285–398

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Oukseh Lee.

Additional information

We want to thank Gilad Arnold, Patrick Cousot, Peter Hawkins, Peter O’Hearn, Martin Rinard, Noam Rinetzky, Xavier Rival, and John Wickerson for helpful comments. This work was supported by EPSRC, and Lee by the Engineering Research Center of Excellence Program of Korea Ministry of Education, Science and Technology (MEST)/National Research Foundation of Korea (NRF) (Grant 2012-0000465).

Rights and permissions

Reprints and permissions

About this article

Cite this article

Lee, O., Yang, H. & Petersen, R. A divide-and-conquer approach for analysing overlaid data structures. Form Methods Syst Des 41, 4–24 (2012). https://doi.org/10.1007/s10703-012-0151-7

Download citation

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10703-012-0151-7

Keywords

Navigation