Skip to main content

Detecting and Escaping Infinite Loops with Jolt

  • Conference paper

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 6813))

Abstract

Infinite loops can make applications unresponsive. Potential problems include lost work or output, denied access to application functionality, and a lack of responses to urgent events. We present Jolt, a novel system for dynamically detecting and escaping infinite loops. At the user’s request, Jolt attaches to an application to monitor its progress. Specifically, Jolt records the program state at the start of each loop iteration. If two consecutive loop iterations produce the same state, Jolt reports to the user that the application is in an infinite loop. At the user’s option, Jolt can then transfer control to a statement following the loop, thereby allowing the application to escape the infinite loop and ideally continue its productive execution. The immediate goal is to enable the application to execute long enough to save any pending work, finish any in-progress computations, or respond to any urgent events.

We evaluated Jolt by applying it to detect and escape eight infinite loops in five benchmark applications. Jolt was able to detect seven of the eight infinite loops (the eighth changes the state on every iteration). We also evaluated the effect of escaping an infinite loop as an alternative to terminating the application. In all of our benchmark applications, escaping an infinite loop produced a more useful output than terminating the application. Finally, we evaluated how well escaping from an infinite loop approximated the correction that the developers later made to the application. For two out of our eight loops, escaping the infinite loop produced the same output as the corrected version of the application.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Exuberant ctags, http://ctags.sourceforge.net

  2. GNU grep, http://www.gnu.org/software/grep

  3. GNU indent, http://www.gnu.org/software/indent

  4. GNU sed, http://www.gnu.org/software/sed

  5. GStreamer, http://www.gstreamer.net

  6. numpy, http://numpy.scipy.org

  7. scipy, http://www.scipy.org

  8. Bradley, A.R., Manna, Z., Sipma, H.B.: Termination of polynomial programs. In: International Conference on Verification, Model Checking, and Abstract Interpretation (2005)

    Google Scholar 

  9. Burnim, J., Jalbert, N., Stergiou, C., Sen, K.: Looper: Lightweight detection of infinite loops at runtime. In: International Conference on Automated Software Engineering (2009)

    Google Scholar 

  10. Colón, M.A., Sipma, H.B.: Practical methods for proving program termination. In: Brinksma, E., Larsen, K.G. (eds.) CAV 2002. LNCS, vol. 2404, pp. 442–454. Springer, Heidelberg (2002)

    Chapter  Google Scholar 

  11. Cook, B., Podelski, A., Rybalchenko, A.: Terminator: beyond safety. In: Ball, T., Jones, R.B. (eds.) CAV 2006. LNCS, vol. 4144, pp. 415–418. Springer, Heidelberg (2006)

    Chapter  Google Scholar 

  12. Dallmeier, V., Zeller, A., Meyer, B.: Generating fixes from object behavior anomalies. In: International Conference on Automated Software Engineering (2009)

    Google Scholar 

  13. Demsky, B., Rinard, M.: Data structure repair using goal-directed reasoning. In: International Conference on Software Engineering (2005)

    Google Scholar 

  14. Gupta, A., Henzinger, T.A., Majumdar, R., Rybalchenko, A., Xu, R.G.: Proving non-termination. In: Symposium on Principles of Programming Languages (2008)

    Google Scholar 

  15. Hayashizaki, H., Wu, P., Inoue, H., Serrano, M., Nakatani, T.: Improving the performance of trace-based systems by false loop filtering. In: International Conference on Architectural Support for Programming Languages and Operating Systems (2011)

    Google Scholar 

  16. Lattner, C., Adve, V.: LLVM: A Compilation Framework for Lifelong Program Analysis & Transformation. In: International Symposium on Code Generation and Optimization (2004)

    Google Scholar 

  17. Li, Z., Tan, L., Wang, X., Lu, S., Zhou, Y., Zhai, C.: Have things changed now? an empirical study of bug characteristics in modern open source software. In: Workshop on Architectural and System Support for Improving Software Dependability (2006)

    Google Scholar 

  18. Luk, C., Cohn, R., Muth, R., Patil, H., Klauser, A., Lowney, G., Wallace, S., Reddi, V., Hazelwood, K.: Pin: Building customized program analysis tools with dynamic instrumentation. In: Conference on Programming Language Design and Implementation (2005)

    Google Scholar 

  19. Metz, C.: Mozilla girds firefox with hang detector (June 2010), http://www.theregister.co.uk/2010/06/10/firefox_hang_detector/

  20. Miller, B., Koski, D., Lee, C., Maganty, V., Murthy, R., Natarajan, A., Steidl, J.: Fuzz revisited: A re-examination of the reliability of Unix utilities and services. TR #1268, Computer Sciences Department, University of Wisconsin (1995)

    Google Scholar 

  21. Muchnick, S.: Advanced Compiler Design and Implementation (1997)

    Google Scholar 

  22. Nagarajan, V., Jeffrey, D., Gupta, R.: Self-recovery in server programs. In: International Symposium on Memory Management (2009)

    Google Scholar 

  23. Nethercote, N., Seward, J.: Valgrind A Program Supervision Framework. Electronic Notes in Theoretical Computer Science 89(2), 44–66 (2003)

    Article  Google Scholar 

  24. Nguyen, H.H., Rinard, M.: Detecting and eliminating memory leaks using cyclic memory allocation. In: International Symposium on Memory Management (2007)

    Google Scholar 

  25. Palix, N., Thomas, G., Saha, S., Calvès, C., Lawall, J., Muller, G.: Faults in Linux: Ten years later. In: International Conference on Architectural Support for Programming Languages and Operating Systems (2011)

    Google Scholar 

  26. Perkins, J., Kim, S., Larsen, S., Amarasinghe, S., Bachrach, J., Carbin, M., Pacheco, C., Sherwood, F., Sidiroglou, S., Sullivan, G., Wong, W., Zibin, Y., Ernst, M., Rinard, M.: Automatically patching errors in deployed software. In: Symposium on Operating Systems Principles (2009)

    Google Scholar 

  27. Qin, F., Tucek, J., Sundaresan, J., Zhou, Y.: Rx: treating bugs as allergies—a safe method to survive software failures. In: Symposium on Operating Systems Principles (2005)

    Google Scholar 

  28. Rinard, M., Cadar, C., Dumitran, D., Roy, D.M., Leu, T., Beebee Jr., W.S.: Enhancing server availability and security through failure-oblivious computing. In: Symposium on Operating Systems Design and Implementation (2004)

    Google Scholar 

  29. Schulte, E., Forrest, S., Weimer, W.: Automated program repair through the evolution of assembly code. In: International Conference on Automated Software Engineering (2010)

    Google Scholar 

  30. Sidiroglou, S., Laadan, O., Perez, C., Viennot, N., Nieh, J., Keromytis, A.: Assure: automatic software self-healing using rescue points. In: International Conference on Architectural Support for Programming Languages and Operating Systems (2009)

    Google Scholar 

  31. Sidiroglou, S., Locasto, M., Boyd, S., Keromytis, A.: Building a reactive immune system for software services. In: USENIX Annual Technical Conference (2005)

    Google Scholar 

  32. Song, X., Chen, H., Zang, B.: Why software hangs and what can be done with it. In: International Conference on Dependable Systems and Networks (2010)

    Google Scholar 

  33. Spoto, F., Mesnard, F., Payet, É.: A termination analyzer for java bytecode based on path-length. Transactions on Programming Languages and Systems 32, 1–70 (2010)

    Article  Google Scholar 

  34. Theiling, H.: Extracting safe and precise control flow from binaries. In: International Conference on Real-Time Systems and Applications (2000)

    Google Scholar 

  35. Velroyen, H., Rümmer, P.: Non-termination checking for imperative programs. In: International Conference on Tests and Proofs (2008)

    Google Scholar 

  36. Wei, Y., Pei, Y., Furia, C., Silva, L., Buchholz, S., Meyer, B., Zeller, A.: Automated fixing of programs with contracts. In: International Symposium on Software Testing and Analysis (2010)

    Google Scholar 

  37. Weimer, W., Nguyen, T.V., Le Goues, C., Forrest, S.: Automatically finding patches using genetic programming. In: International Conference on Software Engineering (2009)

    Google Scholar 

  38. Xiong, W., Park, S., Zhang, J., Zhou, Y., Ma, Z.: Ad hoc synchronization considered harmful. In: Symposium on Operating Systems Design and Implementation (2010)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2011 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Carbin, M., Misailovic, S., Kling, M., Rinard, M.C. (2011). Detecting and Escaping Infinite Loops with Jolt. In: Mezini, M. (eds) ECOOP 2011 – Object-Oriented Programming. ECOOP 2011. Lecture Notes in Computer Science, vol 6813. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-22655-7_28

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-22655-7_28

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-22654-0

  • Online ISBN: 978-3-642-22655-7

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics