Detecting and Escaping Infinite Loops with Jolt

  • Michael Carbin
  • Sasa Misailovic
  • Michael Kling
  • Martin C. Rinard
Part of the Lecture Notes in Computer Science book series (LNCS, 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.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
  2. 2.
  3. 3.
  4. 4.
  5. 5.
  6. 6.
  7. 7.
  8. 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. 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. 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)CrossRefGoogle Scholar
  11. 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)CrossRefGoogle Scholar
  12. 12.
    Dallmeier, V., Zeller, A., Meyer, B.: Generating fixes from object behavior anomalies. In: International Conference on Automated Software Engineering (2009)Google Scholar
  13. 13.
    Demsky, B., Rinard, M.: Data structure repair using goal-directed reasoning. In: International Conference on Software Engineering (2005)Google Scholar
  14. 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. 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. 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. 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. 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. 19.
    Metz, C.: Mozilla girds firefox with hang detector (June 2010), http://www.theregister.co.uk/2010/06/10/firefox_hang_detector/
  20. 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. 21.
    Muchnick, S.: Advanced Compiler Design and Implementation (1997)Google Scholar
  22. 22.
    Nagarajan, V., Jeffrey, D., Gupta, R.: Self-recovery in server programs. In: International Symposium on Memory Management (2009)Google Scholar
  23. 23.
    Nethercote, N., Seward, J.: Valgrind A Program Supervision Framework. Electronic Notes in Theoretical Computer Science 89(2), 44–66 (2003)CrossRefGoogle Scholar
  24. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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)CrossRefGoogle Scholar
  34. 34.
    Theiling, H.: Extracting safe and precise control flow from binaries. In: International Conference on Real-Time Systems and Applications (2000)Google Scholar
  35. 35.
    Velroyen, H., Rümmer, P.: Non-termination checking for imperative programs. In: International Conference on Tests and Proofs (2008)Google Scholar
  36. 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. 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. 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

Copyright information

© Springer-Verlag Berlin Heidelberg 2011

Authors and Affiliations

  • Michael Carbin
    • 1
  • Sasa Misailovic
    • 1
  • Michael Kling
    • 1
  • Martin C. Rinard
    • 1
  1. 1.Massachusetts Institute of TechnologyCambridgeUSA

Personalised recommendations