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.
- J.-R. Abrial. Modeling in Event-B: system and software engineering. Cambridge University Press, 2010. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- L. Aldridge. Memory allocation in C. Embedded Systems Programming, pages 35–42, August 2008. Google Scholar
Digital Library
- J. Bartlett. Inside memory management. http://www.ibm.com/ developerworks/library/l-memory/sidefile.html, 2004.Google Scholar
- 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 Scholar
Digital Library
- A. Chlipala. Mostly-automated verification of low-level programs in computational separation logic. In PLDI, pages 234–245. ACM, 2011. Google Scholar
Digital Library
- B. Fang and M. Sighireanu. Hierarchical shape abstraction for analysis of free-list memory allocators. In LOPSTR, LNCS. Springer, 2016.Google Scholar
- B. Fang and M. Sighireanu. A Refinement Hierarchy for Free List Memory Allocators. Research report, IRIF, Mar. 2017.Google Scholar
- 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 Scholar
- 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 Scholar
- C. Hawblitzel and E. Petrank. Automated verification of practical garbage collectors. In POPL, pages 441–453. ACM, 2009. Google Scholar
Digital Library
- B. W. Kernighan and D. Ritchie. The C Programming Language, Second Edition. Prentice-Hall, 1988. ISBN 0-13-110370-9. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- D. E. Knuth. The Art of Computer Programming, Volume I: Fundamental Algorithms, 2nd Edition. Addison-Wesley, 1973.Google Scholar
- D. Lea. dlmalloc. ftp://gee.cs.oswego.edu/pub/misc/ malloc.c, 2012.Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- H. Tuch, G. Klein, and M. Norrish. Types, bytes, and separation logic. In POPL, pages 97–108. ACM, 2007. Google Scholar
Digital Library
- 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 Scholar
Digital Library
Index Terms
A refinement hierarchy for free list memory allocators
Recommendations
A refinement hierarchy for free list memory allocators
ISMM 2017: Proceedings of the 2017 ACM SIGPLAN International Symposium on Memory ManagementExisting 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 ...
Refinement and state machine abstraction
Precise module interface specifications are essential in modular software development. The role of state in these specifications has been the issue of some debate and is central to the notion of data refinement. In previous work, Hoffman and Strooper ...
Towards the Composition of Specifications in Event-B
The development of a system can start with the creation of a specification. Following this viewpoint, we claim that often a specification can be constructed from the combination of specifications which can be seen as composition. Event-B is a formal ...






Comments