Memory overflow protection for embedded systems using run-time checks, reuse, and compression

Embedded systems usually lack virtual memory and are vulnerable to memory overflow since they lack a mechanism to detect overflow or use swap space thereafter. We present a method to detect memory overflows using compiler-inserted software run-time checks. Its overheads in run-time and energy are 1.35 and 1.12%, respectively. Detection of overflow allows system-specific remedial action. We also present techniques to grow the stack or heap segment after they overflow, into previously unutilized space, such as dead variables, free holes in the heap, and space freed by compressing live variables. These may avoid the out-of-memory error if the space recovered is enough to complete execution. The reuse methods are able to grow the stack or heap beyond its overflow by an amount that varies widely by application---the amount of recovered space ranges from 0.7 to 93.5% of the combined stack and heap size.

[1]  Krste Asanovic,et al.  Mondrian memory protection , 2002, ASPLOS X.

[2]  Thomas M. Conte,et al.  Compiler-driven cached code compression schemes for embedded ILP processors , 1999, MICRO-32. Proceedings of the 32nd Annual ACM/IEEE International Symposium on Microarchitecture.

[3]  Yannis Smaragdakis,et al.  The Case for Compressed Caching in Virtual Memory Systems , 1999, USENIX Annual Technical Conference, General Track.

[4]  Trevor N. Mudge,et al.  Design tradeoffs for software-managed TLBs , 1994, TOCS.

[5]  David Seal,et al.  ARM Architecture Reference Manual , 2001 .

[6]  Daniel G. Bobrow,et al.  A model and stack implementation of multiple environments , 1973, CACM.

[7]  John Regehr,et al.  Eliminating Stack Overflow by Abstract Interpretation , 2003, EMSOFT.

[8]  Amer Diwan,et al.  Simple and effective analysis of statically-typed object-oriented programs , 1996, OOPSLA '96.

[9]  David A. Patterson,et al.  Computer Architecture: A Quantitative Approach , 1969 .

[10]  Andrew W. Appel,et al.  Modern Compiler Implementation in ML , 1997 .

[11]  Nihar R. Mahapatra,et al.  Code compression techniques for embedded systems and their effectiveness , 2003, IEEE Computer Society Annual Symposium on VLSI, 2003. Proceedings..

[12]  Patrik Persson Live memory analysis for garbage collection in embedded systems , 1999, LCTES '99.

[13]  Rajeev Barua,et al.  Segment protection for embedded systems using run-time checks , 2005, CASES '05.

[14]  Jakob Engblom Static properties of commercial embedded real-time programs, and their implication for worst-case execution time analysis , 1999, Proceedings of the Fifth IEEE Real-Time Technology and Applications Symposium.

[15]  Trevor N. Mudge,et al.  Uniprocessor Virtual Memory without TLBs , 2001, IEEE Trans. Computers.

[16]  Trevor Mudge,et al.  MiBench: A free, commercially representative embedded benchmark suite , 2001 .

[17]  Mahmut T. Kandemir,et al.  Tuning garbage collection in an embedded Java environment , 2002, Proceedings Eighth International Symposium on High Performance Computer Architecture.

[18]  Rajiv Gupta,et al.  Data Compression Transformations for Dynamically Allocated Data Structures , 2002, CC.

[19]  Bruce Jacob,et al.  The Performance and Energy Consumption of Embedded Real-Time Operating Systems , 2003, IEEE Trans. Computers.

[20]  Reinhold Heckmann,et al.  Verifying safety-critical timing and memory-usage properties of embedded software by abstract interpretation , 2005, Design, Automation and Test in Europe.

[21]  David Salomon,et al.  Data Compression: The Complete Reference , 2006 .

[22]  L. Carro,et al.  A study on a garbage collector for embedded applications , 2002, Proceedings. 15th Symposium on Integrated Circuits and Systems Design.

[23]  David A. Patterson,et al.  Computer Architecture - A Quantitative Approach, 5th Edition , 1996 .

[24]  George C. Necula,et al.  Capriccio: scalable threads for internet services , 2003, SOSP '03.

[25]  George Neville-Neil Programming Without a Net , 2003, ACM Queue.

[26]  Sumesh Udayakumaran,et al.  Compiler-decided dynamic memory allocation for scratch-pad based embedded systems , 2003, CASES '03.

[27]  Anantha Chandrakasan,et al.  JouleTrack: a web based tool for software energy profiling , 2001, DAC '01.