skip to main content
article

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

Published:01 November 2006Publication History
Skip Abstract Section

Abstract

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.

References

  1. Analysis, S. Ó. S. U. AbsInt Inc. http://www.absint.com/stackanalyzer/.Google ScholarGoogle Scholar
  2. Appel, A. W. and Ginsburg, M. 1998. Modern Compiler Implementation in C. Cambridge Univ. Press, Cambridge. Google ScholarGoogle Scholar
  3. Baynes, K., Collins, C., Fiterman, E., Ganesh, B., Kohout, P., Smit, C., Zhang, T., and Jacob, B. 2003. The performance and energy consumption of embedded real-time operating systems. IEEE Trans. Comput. 52, 11 (Nov.), 1454--1469. Google ScholarGoogle Scholar
  4. Behren, R. V., Condit, J., Zhou, F., Necula, G., and Brewer, E. 2003. Cappricio: Scalable threads for internet services. In Proc., ACM Symposium on Operating Systems Principles (SOSP) (New York). Google ScholarGoogle Scholar
  5. Bobrow, D. and Wegbreit, B. 1973. A model and stack implementation of multiple environments. In Communications of the ACM. 591--603. Google ScholarGoogle Scholar
  6. Brylow, D., Damgaard, N., and Palsberg, J. 2000. Stack-size Estimation for Interrupt-driven Microcontrollers. Tech. rep., Purdue University. June. http://www.brics.dk/~damgaard/Download/zilog-test.pdf.Google ScholarGoogle Scholar
  7. Carbone, J. 2004. Efficient memory protection for embedded systems. RTC Magazine. http://www.rtcmagazine.com/home/article.php?id=100120.Google ScholarGoogle Scholar
  8. Chatterjee, K., Ma, D., Majumdar, R., Zhao, T., Henzinger, T. A., and Palsberg, J. 2003. Stack size analysis of interrupt driven software. In Proceedings of the International Static Analysis Symposium (SAS). 109--126. Google ScholarGoogle Scholar
  9. Chen, G., Shetty, R., Kandemir, M., Vijaykrishnan, N., and Irwin, M. 2002. Tuning garbage collection in an embedded Java environment. In Eighth International Symposium on High-Performance Computer Architecture (HPCA'02). IEEE, Boston, MA. 92--106. Google ScholarGoogle Scholar
  10. compiler, T. G. Free Software Foundation. http://gcc.gnu.org/.Google ScholarGoogle Scholar
  11. Diwan, A., Moss, J. E., and McKinley, K. 1996. Simple and effective analysis of statically-typed object-oriented programs. In Proc. of the 11th ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications. ACM Press, New York. 292--305. Google ScholarGoogle Scholar
  12. Durrant, M. 2000. Running Linux on low cost, low power MMU-less processors. http://www.linuxdevices.com/articles/AT6245686197.html.Google ScholarGoogle Scholar
  13. Engblom, J. 1999. Static properties of commercial embedded real-time programs and their implication for worst-case execution time analysis. In Proc. of the IEEE Real-Time Technology & Applications Symposium (RTAS) Vancouver, Canada. Google ScholarGoogle Scholar
  14. Guthaus, M. R., Ringenberg, J. S., Ernst, D., Austin, T. M., Mudge, T., and Brown, R. B. 2001. Mibench: A free, commercially representative embedded benchmark suite. In Proceedings of the IEEE 4th Annual Workshop on Workload Characterization. Google ScholarGoogle Scholar
  15. Hauck, E. and Dent, B. 1968. Burroughs b 6500/b 7500 stack mechanism. In Proceedings of AFIPS, SJCC, Vol. 32. 245--251.Google ScholarGoogle Scholar
  16. Heckmann, R. and Ferdinand, C. 2005. Verifying safety-critical timing and memory-usage properties of embedded software by abstract interpretation. In Proceedings of Design, Automation and Test in Europe (DATE'05). 618--619. Google ScholarGoogle Scholar
  17. Hennessy, J. and Patterson, D. 2002. Computer Architecture: A Quantitative Approach, 3rd Ed. Morgan Kaufmann, San Mateo, CA. Google ScholarGoogle Scholar
  18. Jacob, B. L. and Mudge, T. N. 2001. Uniprocessor virtual memory without TLBs. IEEE Transactions on Computers 50, 5 (May), 482--499. Google ScholarGoogle Scholar
  19. Jagger, D. and Seal, D. 2000. ARM Architecture Reference Manual. Addison Wesley, Reading, MA. Google ScholarGoogle Scholar
  20. Janzen, J. 2001. Calculating Memory System Power for DDR SDRAM. In DesignLine Journal. Vol. 10(2). Micron Technology Inc. http://www.micron.com/publications/designline.html.Google ScholarGoogle Scholar
  21. Kleidermacher, D. and Griglock, M. 2001. Safety-Critical Operating Systems. Embedded Systems Programming 14, 10 (Sept.). http://www.embedded.com/story/OEG20010829S0055.Google ScholarGoogle Scholar
  22. Krapf, R. C., Mattos, J. C. B., Spellmeier, G., and Carro, L. 2002. A study on a garbage collector for embedded applications. In 15th Symposium on Integrated Circuits and Systems Design. Porto Alegre, Brazil. 127--134. Google ScholarGoogle Scholar
  23. Larin, S. Y. and Conte, T. M. 1999. Compiler-driven cached code compression schemes for embedded ILP processors. In 32nd Int'l Symposium on Microarchitecture. Haifa, Israel. 82--92. Google ScholarGoogle Scholar
  24. Lea, D. 2000. A Memory Allocator. http://gee.cs.oswego.edu/dl/html/malloc.html.Google ScholarGoogle Scholar
  25. micron-datasheet. 2003. 128Mb DDR SDRAM data sheet. (Dual data-rate synchronous DRAM) Micron Technology Inc. http://www.micron.com/products/dram/ddrsdram/.Google ScholarGoogle Scholar
  26. Neville-Neil, G. V. 2003. Programming without A net. ACM Queue: Tomorrow's Computing Today 1, 2 (Apr.), 16--23. Google ScholarGoogle Scholar
  27. Persson, P. 1999. Live memory analysis for garbage collection in embedded systems. In Proceedings of the ACM SIGPLAN 1999 Workshop on Languages, Compilers, and Tools for Embedded Systems. ACM Press, New York. 45--54. Google ScholarGoogle Scholar
  28. project debugger, G. T. G. Free Software Foundation. http://www.gnu.org/software/gdb/gdb.html.Google ScholarGoogle Scholar
  29. Red Hat, Inc. Newlib C Library. Red Hat, Inc. http://sources.redhat.com/newlib.Google ScholarGoogle Scholar
  30. Regehr, J., Reid, A., and Webb, K. 2003. Eliminating stack overflow by abstract interpretation. In Proceedings of the 3rd international conference on embedded software (EMSOFT). Springer-Verlag, New York.Google ScholarGoogle Scholar
  31. Simpson, M., Biswas, S., and Barua, R. 2003. Analysis of Compression Algorithms for Program Data. Tech. rep., U. of Maryland, ECE department. August. http://www.ece.umd.edu/~barua/matt-compress-tr.pdf.Google ScholarGoogle Scholar
  32. Simpson, M., Middha, B., and Barua, R. 2005. Segment protection for embedded systems using run-time checks. In Proceedings of the International Conference on Compilers, Architectures and Synthesis for Embedded Systems. Google ScholarGoogle Scholar
  33. Sinha, A. and Chandrakasan, A. 2001. JouleTrack---a web based tool for software energy profiling. In Design Automation Conference. 220--225. Google ScholarGoogle Scholar
  34. Solomon, D. 2000. Data Compression: The Complete Reference. Springer-Verlag, New York. Google ScholarGoogle Scholar
  35. Sundaresan, K. and Mahapatra, N. R. 2003. Code compression techniques for embedded systems and their effectiveness. In IEEE Computer Society Annual Symposium on VLSI (ISVLSI'03). Tampa, Florida. 262--263. Google ScholarGoogle Scholar
  36. Udayakumaran, S. and Barua, R. 2003. Compiler-decided dynamic memory allocation for scratch-pad based embedded systems. In Proceedings of the International Conference on Compilers, Architectures and Synthesis for Embedded Systems. ACM Press, New York. 276--286. Google ScholarGoogle Scholar
  37. Uhlig, R., Nagle, D., Stanley, T., Mudge, T., Sechrest, S., and Brown, R. 1994. Design tradeoffs for software-managed TLBs. Transactions on Computer Systems (TOCS) 12, 3, 175--205. Google ScholarGoogle Scholar
  38. Wilson, P. R., Kaplan, S. F., and Smaragdakis, Y. 1999. The case for compressed caching in virtual memory systems. In Proceedings of the USENIX Annual Technical Conference. Monterey, CA. Google ScholarGoogle Scholar
  39. Wind River, Inc. High availability design for embedded systems. Tech. rep., Wind River, Inc. http://www.windriver.com/whitepapers/high_availability_design.html.Google ScholarGoogle Scholar
  40. Witchel, E., Cates, J., and Asanović, K. 2002. Mondrian memory protection. In Proc. of the International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS). 304--316. Google ScholarGoogle Scholar
  41. Zhang, Y. and Gupta, R. 2002. Data compression transformations for dynamically allocated data structures. In Proceedings of the International Conference on Compiler Construction LNCS 2304. 14--28. Google ScholarGoogle Scholar

Index Terms

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

                  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!