Skip to main content

Dynamic Livelock Analysis of Multi-threaded Programs

  • Conference paper
Runtime Verification (RV 2012)

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

Included in the following conference series:

Abstract

Compared to deadlocks, where one or more threads are blocked forever, livelocks are harder to detect as it is not easy to distinguish between a long and an infinite busy wait (i.e., no progress) cycle. We propose a dynamic livelock analysis for a multi-threaded program by examining its execution trace. From the observed trace events, our approach uncovers livelock potentials due to infinite executions where one or more threads in a group are acquiring and releasing resources in busy-wait cycles to avoid deadlocks. Furthermore, to confirm a livelock potential, we orchestrate a partial-order schedule to induce a livelock during a program re-execution. We implemented our proposed approach in a prototype tool CBuster, comprising a light-weight binary instrumentation framework for C/C++ programs to record events, and to replay partial-order schedules. We applied our approach to identify and confirm livelocks in a case study based on SQLite, a widely used embedded multi-threaded database engine.

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

Access this chapter

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

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Ho, A., Smith, S., Hand, S.: On deadlock, livelock, and forward progress. Technical Report UCAM-CL-Tr-633, University of Cambridge, Computer Laboratory (2005)

    Google Scholar 

  2. Stallings, W.: Operating Systems: Internals and Design Principles. Prentice Hall (2001)

    Google Scholar 

  3. Mogul, J.C., Ramakrishnan, K.K.: Eliminating receive livelock in an interrupt-driven kemel. ACM Trans. Comput. Syst. 15(3), 217–252 (1997)

    Article  Google Scholar 

  4. Tai, K.-C.: Definitions and detection of deadlock, livelock, and starvation in concurrent programs. In: ICPP, pp. 69–72 (1994)

    Google Scholar 

  5. Owicki, S.S., Lamport, L.: Proving liveness properties of concurrent programs. ACM Trans. Program. Lang. Syst. 4(3), 455–495 (1982)

    Article  MATH  Google Scholar 

  6. Sqlite-Users, http://www.mail-archive.com/sqlite-userssqlite.org/msg41725.html

  7. Sqlite-Users, http://www.mail-archive.com/sqlite-userssqlite.org/msg32658.html

  8. Sqlite-Users, http://www.mail-archive.com/sqlite-userssqlite.org/msg54618.html

  9. Blieberger, J., Burgstaller, B., Mittermayr, R.: Static Detection of Livelocks in Ada Multitasking Programs. In: Abdennadher, N., Kordon, F. (eds.) Ada-Europe 2007. LNCS, vol. 4498, pp. 69–83. Springer, Heidelberg (2007)

    Chapter  Google Scholar 

  10. Ouaknine, J., Palikareva, H., Roscoe, A.W., Worrell, J.: Static Livelock Analysis in CSP. In: Katoen, J.-P., König, B. (eds.) CONCUR 2011. LNCS, vol. 6901, pp. 389–403. Springer, Heidelberg (2011)

    Chapter  Google Scholar 

  11. Holzmann, G.: The model checker spin. IEEE Transactions on Software Engineering (1997)

    Google Scholar 

  12. Visser, W., Havelund, K., Brat, G., Park, S.: Model checking programs. In: Proc. of ASE (2000)

    Google Scholar 

  13. Li, T., Lebeck, A.R., Sorin, D.J.: Spin detection hardware for improved management of multithreaded systems. IEEE Transactions on Parallel and Distrubuted Systems 17, 508–521 (2006)

    Article  Google Scholar 

  14. Engler, D.R., Ashcraft, K.: RacerX: effective, static detection of race conditions and deadlocks. In: SOSP, pp. 237–252 (2003)

    Google Scholar 

  15. Williams, A., Thies, W., Ernst, M.D.: Static Deadlock Detection for Java Libraries. In: Gao, X.-X. (ed.) ECOOP 2005. LNCS, vol. 3586, pp. 602–629. Springer, Heidelberg (2005)

    Chapter  Google Scholar 

  16. Shanbhag, V.K.: Deadlock-detection in Java-library using static-analysis. In: APSEC, pp. 361–368 (2008)

    Google Scholar 

  17. Naik, M., Park, C.-S., Sen, K., Gay, D.: Effective static deadlock detection. In: Proc. of ICSE, pp. 386–396 (2009)

    Google Scholar 

  18. Havelund, K.: Using Runtime Analysis to Guide Model Checking of Java Programs. In: Havelund, K., Penix, J., Visser, W. (eds.) SPIN 2000. LNCS, vol. 1885, pp. 245–264. Springer, Heidelberg (2000)

    Chapter  Google Scholar 

  19. Wang, Y., Kelly, T., Kudlur, M., Lafortune, S., Mahlke, S.A.: Gadara: Dynamic deadlock avoidance for multithreaded programs. In: OSDI, pp. 281–294 (2008)

    Google Scholar 

  20. Jula, H., Tralamazza, D.M., Zamfir, C., Candea, G.: Deadlock immunity: Enabling systems to defend against deadlocks. In: OSDI (2008)

    Google Scholar 

  21. Bensalem, S., Havelund, K.: Dynamic Deadlock Analysis of Multi-threaded Programs. In: Ur, S., Bin, E., Wolfsthal, Y. (eds.) HVC 2005. LNCS, vol. 3875, pp. 208–223. Springer, Heidelberg (2006)

    Chapter  Google Scholar 

  22. Agarwal, R., Wang, L., Stoller, S.D.: Detecting Potential Deadlocks with Static Analysis and Run-Time Monitoring. In: Ur, S., Bin, E., Wolfsthal, Y. (eds.) HVC 2005. LNCS, vol. 3875, pp. 191–207. Springer, Heidelberg (2006)

    Chapter  Google Scholar 

  23. Bensalem, S., Fernandez, J.-C., Havelund, K., Mounier, L.: Confirmation of deadlock potentials detected by runtime analysis. In: PADTAD, pp. 41–50 (2006)

    Google Scholar 

  24. Agarwal, R., Stoller, S.D.: Run-time detection of potential deadlocks for programs with locks, semaphores, and condition variables. In: PADTAD, pp. 51–60 (2006)

    Google Scholar 

  25. Joshi, P., Park, C.-S., Sen, K., Naik, M.: A randomized dynamic program analysis technique for detecting real deadlocks. In: Proc. of PLDI, pp. 110–120 (2009)

    Google Scholar 

  26. Joshi, P., Naik, M., Sen, K., Gay, D.: An effective dynamic analysis for detecting generalized deadlocks. In: FSE (2010)

    Google Scholar 

  27. Luo, Z.D., Das, R., Qi, Y.: Multicore SDK: A practical and efficient deadlock detector for real-world applications. In: ICST, pp. 309–318 (2011)

    Google Scholar 

  28. Cai, Y., Chan, W.K.: Magicfuzzer: Scalable deadlock detection for large-scale applications. In: Proc. of ICSE (2012)

    Google Scholar 

  29. Qin, F., Tucek, J., Sundaresan, J., Zhou, Y.: Rx: treating bugs as allergies - a safe method to survive software failures. In: SOSP, pp. 235–248 (2005)

    Google Scholar 

  30. Harrow, J.J.: Runtime Checking of Multithreaded Applications with Visual Threads. In: Havelund, K., Penix, J., Visser, W. (eds.) SPIN 2000. LNCS, vol. 1885, pp. 331–342. Springer, Heidelberg (2000)

    Chapter  Google Scholar 

  31. SQLite home page, http://www.sqlite.org/

  32. Mattern, F.: Virtual time and global states of distributed systems. In: Workshop on Parallel and Distributed Algorithms, France (1988)

    Google Scholar 

  33. Fidge, J.: Timestamps in message-passing systems that preserve the partial ordering. In: Australian Computer Science Conference (1988)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2013 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Ganai, M.K. (2013). Dynamic Livelock Analysis of Multi-threaded Programs. In: Qadeer, S., Tasiran, S. (eds) Runtime Verification. RV 2012. Lecture Notes in Computer Science, vol 7687. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-35632-2_3

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-35632-2_3

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-35631-5

  • Online ISBN: 978-3-642-35632-2

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics