skip to main content
article

Symbolic execution for memory consumption analysis

Published:13 June 2016Publication History
Skip Abstract Section

Abstract

With the advances in both hardware and software of embedded systems in the past few years, dynamic memory allocation can now be safely used in embedded software. As a result, the need to develop methods to avoid heap overflow errors in safety-critical embedded systems has increased. Resource analysis of imperative programs with non-regular loop patterns and signed integers, to support both memory allocation and deallocation, has long been an open problem. Existing methods can generate symbolic bounds that are parametric w.r.t. the program inputs; such bounds, however, are imprecise in the presence of non-regular loop patterns. In this paper, we present a worst-case memory consumption analysis, based upon the framework of symbolic execution. Our assumption is that loops (and recursions) of to-be-analyzed programs are indeed bounded. We then can exhaustively unroll loops and the memory consumption of each iteration can be precisely computed and summarized for aggregation. Because of path-sensitivity, our algorithm generates more precise bounds. Importantly, we demonstrate that by introducing a new concept of reuse, symbolic execution scales to a set of realistic benchmark programs.

References

  1. E. Albert, P. Arenas, S. Genaim, G. Puebla, and D. Zanardini. Cost analysis of java bytecode. In ESOP, pages 157–172. Springer, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. E. Albert, P. Arenas, S. Genaim, G. Puebla, and D. Zanardini. Cost analysis of object-oriented bytecode programs. Theor. Comput. Sci., 413(1):142–159, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. D. A. Alonso, S. Mamagkakis, C. Poucet, M. Pe´on-Quir´os, A. Bartzas, F. Catthoor, and D. Soudris. Dynamic memory management optimization for multimedia applications. In Dynamic Memory Management for Embedded Systems, pages 167–192. Springer, 2015.Google ScholarGoogle Scholar
  4. J. L. Andersen, M. Todberg, A. E. Dalsgaard, and R. R. Hansen. Worst-case memory consumption analysis for scj. In Proceedings of the 11th International Workshop on Java Technologies for Real-time and Embedded Systems, pages 2–10. ACM, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. T. Bøgholm, C. Frost, R. R. Hansen, C. S. Jensen, K. S. Luckow, A. P. Ravn, H. Søndergaard, and B. Thomsen. Towards harnessing theories through tool support for hard real-time java programming. Innov. Syst. Softw. Eng., 9(1):17–28, March 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. V. Braberman, F. Fernández, D. Garbervetsky, and S. Yovine. Parametric prediction of heap memory requirements. In ISMM, pages 141– 150. ACM, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. D. Bruening, T. Garnett, and S. Amarasinghe. An infrastructure for adaptive dynamic optimization. In CGO, pages 265–275. IEEE, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Q. Carbonneaux, J. Hoffmann, T. Ramananandro, and Z. Shao. Endto-end verification of stack-space bounds for c programs. In PLDI, pages 270–281. ACM, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Q. Carbonneaux, J. Hoffmann, and Z. Shao. Compositional certified resource bounds. In PLDI, pages 467–478. ACM, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. D.-H. Chu. Interpolation Methods for Symbolic Execution. PhD thesis, NATIONAL UNIVERSITY OF SINGAPORE, 2012.Google ScholarGoogle Scholar
  11. D.-H. Chu and J. Jaffar. Symbolic simulation on complicated loops for wcet path analysis. In EMSOFT, pages 319–328. ACM, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. D.-H. Chu and J. Jaffar. Path-sensitive resource analysis compliant with assertions. In EMSOFT, pages 1–10. IEEE, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. D.-H. Chu, J. Jaffar, and R. Maghareh. Precise cache timing analysis via symbolic execution. In RTAS, pages 293–304. IEEE, 2016.Google ScholarGoogle Scholar
  14. P. Cousot and N. Halbwachs. Automatic discovery of linear restraints among variables of a program. In POPL, pages 84–96. ACM, 1978. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. D. B. Emery, S. M. Kathryn, D. B. Robert, and R. W. Paul. Hoard: A scalable memory allocator for multithreaded applications. In ASPLOS, pages 117–128. ACM, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. A. Flores-Montoya and R. Hähnle. Resource analysis of complex programs with cost equations. In APLAS, pages 275–295. Springer, 2014.Google ScholarGoogle Scholar
  17. M. R. Guthaus, J. S. Ringenberg, D. Ernst, T. M. Austin, T. Mudge, and R. B. Brown. Mibench: A free, commercially representative embedded benchmark suite. In Proceedings of the Workload Characterization, pages 3–14. IEEE, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. R. Haemmerlé, P. L´opez-Garc´ıa, U. Liqat, M. Klemen, J. P. Gallagher, and M. V. Hermenegildo. A transformational approach to parametric accumulated-cost static profiling. In FLOPS, pages 163–180. Springer, 2016.Google ScholarGoogle Scholar
  19. J. Hoffmann, K. Aehlig, and M. Hofmann. Multivariate amortized resource analysis. TOPLAS, 34(3):14:1–14:62, November 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. J. Jaffar, A. E. Santosa, and R. Voicu. Efficient memoization for dynamic programming with ad-hoc constraints. In AAAI, pages 297– 303. AAAI Press, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. D. Kästner and C. Ferdinand. Proving the absence of stack overflows. In SAFECOMP, pages 202–213. Springer, 2014.Google ScholarGoogle Scholar
  22. Y. S. Li and S. Malik. Performance analysis of embedded software using implicit path enumeration. SIGPLAN Not., 30(11):88–98, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Llvm test suite guide. URL http://llvm.org/releases/2.2/docs/TestingGuide.html, 2015.Google ScholarGoogle Scholar
  24. C.-K. Luk, R. Cohn, R. Muth, H. Patil, A. Klauser, G. Lowney, S. Wallace, V. J. Reddi, and K. Hazelwood. Pin: Building customized program analysis tools with dynamic instrumentation. In PLDI, pages 190–200. ACM, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Mälardalen WCET research group benchmarks. URL http://www.mrtc.mdh.se/projects/wcet/benchmarks.html, 2006.Google ScholarGoogle Scholar
  26. M. Masmano, I. Ripoll, P. Balbastre, and A. Crespo. A constanttime dynamic storage allocator for real-time systems. Real-Time Syst., 40(2):149–179, November 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. M. Masmano, I. Ripoll, and A. Crespo. Dynamic storage allocation for real-time embedded systems. In RTSS, Work In Progress, 2003.Google ScholarGoogle Scholar
  28. N. Nethercote and J. Seward. Valgrind: A framework for heavyweight dynamic binary instrumentation. In PLDI, pages 89–100. ACM, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. O. Perks, S. D. Hammond, S. J. Pennycook, and S. A. Jarvis. Wmtrace – a lightweight memory allocation tracker and analysis framework. In Proceedings of the UK Performance Engineering Workshop, 2011.Google ScholarGoogle Scholar
  30. W. Puffitsch, B. Huber, and M. Schoeberl. Worst-case analysis of heap allocations. In Proceedings of the 4th International Conference on Leveraging Applications of Formal Methods, Verification, and Validation, pages 464–478. Springer, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. M. Schoeberl. Scala for real-time systems? In Proceedings of the 13th International Workshop on Java Technologies for Real-time and Embedded Systems, pages 1–5. ACM, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. P. W. Trinder, M. I. Cole, K. Hammond, H.-W. Loidl, and G. J. Michaelson. Resource analyses for parallel and distributed coordination. Concurrency and Computation: Practice and Experience, 25(3):309–348, 2013.Google ScholarGoogle ScholarCross RefCross Ref

Index Terms

  1. Symbolic execution for memory consumption analysis

      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

      • Published in

        cover image ACM SIGPLAN Notices
        ACM SIGPLAN Notices  Volume 51, Issue 5
        LCTES '16
        May 2016
        122 pages
        ISSN:0362-1340
        EISSN:1558-1160
        DOI:10.1145/2980930
        • Editor:
        • Andy Gill
        Issue’s Table of Contents
        • cover image ACM Conferences
          LCTES 2016: Proceedings of the 17th ACM SIGPLAN/SIGBED Conference on Languages, Compilers, Tools, and Theory for Embedded Systems
          June 2016
          122 pages
          ISBN:9781450343169
          DOI:10.1145/2907950

        Copyright © 2016 ACM

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 13 June 2016

        Check for updates

        Qualifiers

        • article

      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!