Fuel: A Compiler Framework for Safe Memory Management

Flow-sensitive type systems offer an elegant way to ensurememorysafety in programming languages. Unfortunately, their adoption in new or existing languages is often hindered by a painful effort to implement or integrate them into compilers. This paper presents early results in our effort to alleviate this task. We introduce Fuel, a type capability-based library that can be plugged onto a compiler toolchain to check for memory-safety properties. Fuel builds upon well-established ideas in the domain of capability-based system, and adds a mechanism leveraging dynamic checks to recover capabilities where static reasoning is either too difficult or impossible. This approach allows the analysis to potentially cover situations where a typical type system might not be expressive enough to statically reason about memory safety. CCS CONCEPTS • Software and its engineering→ Retargetable compilers; Frameworks; Runtime environments.

[1]  BirkedalLars,et al.  A Retrospective on Region-Based Memory Management , 2004 .

[2]  John Tang Boyland,et al.  Capabilities for Sharing: A Generalisation of Uniqueness and Read-Only , 2001, ECOOP.

[3]  Jeffrey K. Hollingsworth,et al.  An API for Runtime Code Patching , 2000, Int. J. High Perform. Comput. Appl..

[4]  Takeo Kanade,et al.  Aliasing in object-oriented programming: types, analysis and verification , 2013 .

[5]  Mark N. Wegman,et al.  Efficiently computing static single assignment form and the control dependence graph , 1991, TOPL.

[6]  R. Sekar,et al.  Eternal War in Memory , 2014, IEEE Security & Privacy.

[7]  Konstantin Serebryany,et al.  MemorySanitizer: Fast detector of uninitialized memory use in C++ , 2015, 2015 IEEE/ACM International Symposium on Code Generation and Optimization (CGO).

[8]  Matthias Felleisen,et al.  Macros for domain-specific languages , 2020, Proc. ACM Program. Lang..

[9]  Philip Wadler,et al.  Linear Types can Change the World! , 1990, Programming Concepts and Methods.

[10]  Riccardo Pucella,et al.  Practical affine types , 2011, POPL '11.

[11]  David Aspinall,et al.  Subtyping with Singleton Types , 1994, CSL.

[12]  David Walker,et al.  Alias Types , 2000, ESOP.

[13]  Ifaz Kabir,et al.  ιDOT: a DOT calculus with object initialization , 2020, Proc. ACM Program. Lang..

[14]  Dave Clarke,et al.  Ownership Types: A Survey , 2013, Aliasing in Object-Oriented Programming.

[15]  Benjamin C. Pierce,et al.  Types and programming languages: the next generation , 2003, 18th Annual IEEE Symposium of Logic in Computer Science, 2003. Proceedings..

[16]  Martin Elsman,et al.  A Retrospective on Region-Based Memory Management , 2004, High. Order Symb. Comput..

[17]  Alexander Aiken,et al.  Flow-sensitive type qualifiers , 2002, PLDI '02.