skip to main content
article

A refinement hierarchy for free list memory allocators

Authors Info & Claims
Published:18 June 2017Publication History
Skip Abstract Section

Abstract

Existing implementations of dynamic memory allocators (DMA) employ a large spectrum of policies and techniques. The formal specifications of these techniques are quite complicated in isolation and very complex when combined. Therefore, the formal reasoning on a specific DMA implementation is difficult for automatic tools and mostly single-use. This paper proposes a solution to this problem by providing formal models for a full class of DMA, the free list class. To obtain manageable formal reasoning and reusable formal models, we organize these models in a hierarchy ranked by refinement relations. We prove the soundness of models and refinement relations using an off-the-shelf theorem prover. We demonstrate that our hierarchy is a basis for an algorithm theory for the class of free list DMA: it abstracts various existing implementations of DMA and leads to new DMA implementations. We illustrate its application to model-based code generation, testing, run-time verification, and static analysis.

References

  1. J.-R. Abrial. Modeling in Event-B: system and software engineering. Cambridge University Press, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. J.-R. Abrial, M. Butler, S. Hallerstede, T. S. Hoang, F. Mehta, and L. Voisin. Rodin: an open toolset for modelling and reasoning in eventb. International journal on software tools for technology transfer, 12 (6):447–466, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. L. Aldridge. Memory allocation in C. Embedded Systems Programming, pages 35–42, August 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. J. Bartlett. Inside memory management. http://www.ibm.com/ developerworks/library/l-memory/sidefile.html, 2004.Google ScholarGoogle Scholar
  5. C. Calcagno, D. Distefano, P. W. O’Hearn, and H. Yang. Beyond reachability: Shape abstraction in the presence of pointer arithmetic. In SAS, volume 4134 of LNCS, pages 182–203. Springer, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. A. Chlipala. Mostly-automated verification of low-level programs in computational separation logic. In PLDI, pages 234–245. ACM, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. B. Fang and M. Sighireanu. Hierarchical shape abstraction for analysis of free-list memory allocators. In LOPSTR, LNCS. Springer, 2016.Google ScholarGoogle Scholar
  8. B. Fang and M. Sighireanu. A Refinement Hierarchy for Free List Memory Allocators. Research report, IRIF, Mar. 2017.Google ScholarGoogle Scholar
  9. G. Fankhauser, C. Conrad, E. Zitzler, and B. Plattner. Topsy – A Teachable Operating System. Technical report, Computer Engineering and Networks Laboratory, ETH Zürich, Switzerland, 2000.Google ScholarGoogle Scholar
  10. A. Fürst, T. S. Hoang, D. Basin, K. Desai, N. Sato, and K. Miyazaki. Code generation for event-b. In iFM, pages 323–338. Springer, 2014.Google ScholarGoogle Scholar
  11. C. Hawblitzel and E. Petrank. Automated verification of practical garbage collectors. In POPL, pages 441–453. ACM, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. B. W. Kernighan and D. Ritchie. The C Programming Language, Second Edition. Prentice-Hall, 1988. ISBN 0-13-110370-9. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. G. Klein, K. Elphinstone, G. Heiser, J. Andronick, D. Cock, P. Derrin, D. Elkaduwe, K. Engelhardt, R. Kolanski, M. Norrish, T. Sewell, H. Tuch, and S. Winwood. seL4: formal verification of an OS kernel. In SOSP, pages 207–220. ACM, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. D. E. Knuth. The Art of Computer Programming, Volume I: Fundamental Algorithms, 2nd Edition. Addison-Wesley, 1973.Google ScholarGoogle Scholar
  15. D. Lea. dlmalloc. ftp://gee.cs.oswego.edu/pub/misc/ malloc.c, 2012.Google ScholarGoogle Scholar
  16. J. Liu and X. Rival. Abstraction of arrays based on non contiguous partitions. In VMCAI, volume 8931 of LNCS, pages 282–299. Springer, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Q. A. Malik, J. Lilius, and L. Laibinis. Model-based testing using scenarios and Event-B refinements. In Methods, Models and Tools for Fault Tolerance, pages 177–195. Springer, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. N. Marti, R. Affeldt, and A. Yonezawa. Formal verification of the heap manager of an operating system using separation logic. In ICFEM, volume 4260 of LNCS, pages 400–419. Springer, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. M. Masmano, I. Ripoll, A. Crespo, and J. Real. TLSF: A new dynamic memory allocator for real-time systems. In ECRTS, pages 79–86. IEEE Computer Society, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. P. W. O’Hearn, J. C. Reynolds, and H. Yang. Local reasoning about programs that alter data structures. In CSL, LNCS, pages 1–19. Springer, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. D. R. Smith and M. R. Lowry. Algorithm theories and design tactics. Science of Computer Programming, 14(2):305 – 321, 1990. ISSN 0167-6423. doi: http://dx. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. W. Su, J. Abrial, G. Pu, and B. Fang. Formal development of a real-time operating system memory manager. In ICECCS, pages 130–139. IEEE, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. H. Tuch, G. Klein, and M. Norrish. Types, bytes, and separation logic. In POPL, pages 97–108. ACM, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. P. R. Wilson, M. S. Johnstone, M. Neely, and D. Boles. Dynamic storage allocation: A survey and critical review. In IWMM, volume 986 of LNCS, pages 1–116. Springer, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. A refinement hierarchy for free list memory allocators

        Recommendations

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in

        Full Access

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader
        About Cookies On This Site

        We use cookies to ensure that we give you the best experience on our website.

        Learn more

        Got it!