Two Types of Deadlock Detection: Cyclic and Acyclic

  • Takao Shimomura
  • Kenji Ikeda
Part of the Studies in Computational Intelligence book series (SCI, volume 542)


Concurrent programs are difficult to test and debug due to their non-deterministic execution. For deadlocks, traditional deadlock detection algorithms depend on finding cycles in lock graphs created from application programs. This paper first introduces three kinds of blocked relations, lock-blocked, wait-blocked, and join-blocked for Java multi-threaded programs. Previous work does not consider the wait-blocked relations, nor the influence of thread interruption. The paper then proposes two types of deadlocks based on these blocked relations, that is, block-cycle type deadlocks and waiting-block type deadlocks which are acyclic. It also presents an example of implementation to detect these types of deadlocks, and addresses future directions.


Acyclic blocked relations deadlock lock table synchronization 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Agarwal, R., Stoller, S.: Run-time detection of potential deadlocks for programs with locks, semaphores, and condition variables. In: Proceedings of the 2006 Workshop on Parallel and Distributed Systems: Testing and Debugging, pp. 51–60. ACM (2006)Google Scholar
  2. 2.
    Bensalem, S., Fernandez, J., Havelund, K., Mounier, L.: Confirmation of deadlock potentials detected by runtime analysis. In: Proceedings of the 2006 Workshop on Parallel and Distributed Systems: Testing and Debugging, pp. 41–50. ACM (2006)Google Scholar
  3. 3.
    Bensalem, S., Griesmayer, A., Legay, A., Nguyen, T., Peled, D.: Efficient deadlock detection for concurrent systems. In: 2011 9th IEEE/ACM International Conference on Formal Methods and Models for Codesign (MEMOCODE), pp. 119–129. IEEE (2011)Google Scholar
  4. 4.
    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)CrossRefGoogle Scholar
  5. 5.
    Bradbury, J., Jalbert, K.: Defining a catalog of programming anti-patterns for concurrent java. In: Proc. of the 3rd International Workshop on Software Patterns and Quality (SPAQu 2009), pp. 6–11 (2009)Google Scholar
  6. 6.
    Chaki, S., Clarke, E., Ouaknine, J., Sharygina, N., Sinha, N.: Concurrent software verification with states, events, and deadlocks. Formal Aspects of Computing 17(4), 461–483 (2005)CrossRefzbMATHGoogle Scholar
  7. 7.
    Demartini, C., Iosif, R., Sisto, R.: A deadlock detection tool for concurrent java programs. Software: Practice and Experience 29(7), 577–603 (1999)Google Scholar
  8. 8.
    Deshmukh, J., Emerson, E., Sankaranarayanan, S.: Symbolic deadlock analysis in concurrent libraries and their clients. In: Proceedings of the 2009 IEEE/ACM International Conference on Automated Software Engineering, pp. 480–491. IEEE Computer Society (2009)Google Scholar
  9. 9.
    Deshmukh, J., Emerson, E., Sankaranarayanan, S.: Symbolic modular deadlock analysis. Automated Software Engineering, 1–38 (2011)Google Scholar
  10. 10.
    El-Zawawy, M., Nayel, H.: Type systems based data race detector. Computer and Information Science 5(4), 53–60 (2012)CrossRefGoogle Scholar
  11. 11.
    Ferrara, P.: A generic static analyzer for multithreaded java programs. Software: Practice and Experience (2012), doi:10.1002/spe.2126Google Scholar
  12. 12.
    Fiedor, J., Křena, B., Letko, Z., Vojnar, T.: A uniform classification of common concurrency errors. In: Moreno-Díaz, R., Pichler, F., Quesada-Arencibia, A. (eds.) EUROCAST 2011, Part I. LNCS, vol. 6927, pp. 519–526. Springer, Heidelberg (2012)CrossRefGoogle Scholar
  13. 13.
    Filman, R., Havelund, K.: Source-code instrumentation and quantification of events. In: FOAL 2002 Workshop (at AOSD 2002), pp. 45–49 (2002)Google Scholar
  14. 14.
    Flanagan, C., Freund, S., Yi, J.: Velodrome: a sound and complete dynamic atomicity checker for multithreaded programs. ACM SIGPLAN Notices 43(6), 293–303 (2008)CrossRefGoogle Scholar
  15. 15.
    Gordon, C., Ernst, M., Grossman, D.: Static lock capabilities for deadlock freedom. In: Proceedings of the 8th ACM SIGPLAN Workshop on Types in Language Design and Implementation, pp. 67–78. ACM (2012)Google Scholar
  16. 16.
    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)CrossRefGoogle Scholar
  17. 17.
    Havelund, K., Rosu, G.: Java pathexplorer–a runtime verification tool. In: The 6th International Symposium on Artificial Intelligence, Robotics and Automation in Space: A New Space Odyssey, pp. 18–21 (2001)Google Scholar
  18. 18.
    Johnsen, E.B., Tran, T.M.T., Owe, O., Steffen, M.: Safe locking for multi-threaded java with exceptions. The Journal of Logic and Algebraic Programming 81, 257–283 (2012)CrossRefzbMATHMathSciNetGoogle Scholar
  19. 19.
    Joshi, P., Naik, M., Sen, K., Gay, D.: An effective dynamic analysis for detecting generalized deadlocks. In: Proceedings of the Eighteenth ACM SIGSOFT International Symposium on Foundations of Software Engineering, pp. 327–336. ACM (2010)Google Scholar
  20. 20.
    Joshi, P., Park, C., Sen, K., Naik, M.: A randomized dynamic program analysis technique for detecting real deadlocks. ACM Sigplan Notices 44(6), 110–120 (2009)CrossRefGoogle Scholar
  21. 21.
    Jula, H., Andrica, S., Candea, G.: Efficiency optimizations for implementations of deadlock immunity. In: Khurshid, S., Sen, K. (eds.) RV 2011. LNCS, vol. 7186, pp. 78–93. Springer, Heidelberg (2012)CrossRefGoogle Scholar
  22. 22.
    Jula, H., Tozun, P., Candea, G.: Communix: A framework for collaborative deadlock immunity. In: 2011 IEEE/IFIP 41st International Conference on Dependable Systems & Networks (DSN), pp. 181–188. IEEE (2011)Google Scholar
  23. 23.
    Kahlon, V., Sinha, N., Kruus, E., Zhang, Y.: Static data race detection for concurrent programs with asynchronous calls. In: Proceedings of the the 7th Joint Meeting of the European Software Engineering Conference and the ACM SIGSOFT Symposium on the Foundations of Software Engineering, pp. 13–22. ACM (2009)Google Scholar
  24. 24.
    Kahlon, V., Yang, Y., Sankaranarayanan, S., Gupta, A.: Fast and accurate static data-race detection for concurrent programs. In: Damm, W., Hermanns, H. (eds.) CAV 2007. LNCS, vol. 4590, pp. 226–239. Springer, Heidelberg (2007)CrossRefGoogle Scholar
  25. 25.
    Koskinen, E., Herlihy, M.: Dreadlocks: efficient deadlock detection. In: Proceedings of the Twentieth Annual Symposium on Parallelism in Algorithms and Architectures, pp. 297–303. ACM (2008)Google Scholar
  26. 26.
    Lu, S., Park, S., Seo, E., Zhou, Y.: Learning from mistakes: a comprehensive study on real world concurrency bug characteristics. ACM Sigplan Notices 43(3), 329–339 (2008)CrossRefGoogle Scholar
  27. 27.
    Luo, Z., Das, R., Qi, Y.: Multicore sdk: A practical and efficient deadlock detector for real-world applications. In: 2011 IEEE Fourth International Conference on Software Testing, Verification and Validation (ICST), pp. 309–318. IEEE (2011)Google Scholar
  28. 28.
    Mahdian, F., Rafe, V., Rafeh, R.: A framework to automatic deadlock detection in concurrent programs. Przeglad Elektrotechniczny, 182–184 (2012) iSSN 0033-2097, R. 88 NR 1b/2012Google Scholar
  29. 29.
    Naik, M., Park, C., Sen, K., Gay, D.: Effective static deadlock detection. In: IEEE 31st International Conference on Software Engineering, ICSE 2009, pp. 386–396. IEEE (2009)Google Scholar
  30. 30.
    Nir-Buchbinder, Y., Tzoref, R., Ur, S.: Deadlocks: From exhibiting to healing. In: Leucker, M. (ed.) RV 2008. LNCS, vol. 5289, pp. 104–118. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  31. 31.
    Nonaka, Y., Ushijima, K.: A run-time deadlock detector for concurrent java programs. In: Eighth Asia-Pacific Software Engineering Conference, APSEC 2001, pp. 45–52. IEEE (2001)Google Scholar
  32. 32.
    Oracle Corporation: Java Bug Database (2013),
  33. 33.
    Oracle Corporation: Java Language Specification Java SE, 7th edn. (2013),
  34. 34.
  35. 35.
    Oracle Corporation. jstack (2013),
  36. 36.
    Oracle Corporation: NetBeans IDE (2013),
  37. 37.
    Park, S., Vuduc, R., Harrold, M.: A unified approach for localizing non-deadlock concurrency bugs. In: 2012 IEEE Fifth International Conference on Software Testing, Verification and Validation, pp. 51–60. IEEE (2012)Google Scholar
  38. 38.
    Pun, K., Steffen, M., Stolz, V.: Deadlock checking by a behavioral effect system for lock handling. Journal of Logic and Algebraic Programming 81(3), 331–354 (2012)CrossRefzbMATHMathSciNetGoogle Scholar
  39. 39.
    Shanbhag, V.: Deadlock-detection in java-library using static-analysis. In: 15th Asia-Pacific Software Engineering Conference, APSEC 2008, pp. 361–368. IEEE (2008)Google Scholar
  40. 40.
    Shimomura, T.: Easy, Enjoyable, Effective E-Learning. Nova Science Publishers, Inc. (2008)Google Scholar
  41. 41.
    Shimomura, T., Ikeda, K.: Extensible web-based learning architecture. In: The 2012 International Conference on Software Engineering Research and Practice, pp. 1–7 (2012)Google Scholar
  42. 42.
    Shimomura, T., Ikeda, K.: Waiting blocked-tree type deadlock detection. In: Proceedings of Science and Information Conference 2013 (SAI 2013), pp. 45–50 (2013)Google Scholar
  43. 43.
    Wang, Y., Kelly, T., Kudlur, M., Lafortune, S., Mahlke, S.: Gadara: Dynamic deadlock avoidance for multithreaded programs. In: Proceedings of the 8th USENIX Conference on Operating Systems Design and Implementation, pp. 281–294. USENIX Association (2008)Google Scholar
  44. 44.
    Wen, Y., Zhao, J., Huang, M., Chen, H.: Towards detecting thread deadlock in java programs with jvm introspection. In: 2011 IEEE 10th International Conference on Trust, Security and Privacy in Computing and Communications (TrustCom), pp. 1600–1607. IEEE (2011)Google Scholar
  45. 45.
    Williams, A., Thies, W., Awasthi, P.: Static deadlock detection for java libraries. In: Gao, X.-X. (ed.) ECOOP 2005. LNCS, vol. 3586, pp. 602–629. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  46. 46.
    Zhang, W., Sun, C., Lu, S.: Conmem: detecting severe concurrency bugs through an effect-oriented approach. ACM SIGARCH Computer Architecture News 38(1), 179–192 (2010)CrossRefGoogle Scholar

Copyright information

© Springer International Publishing Switzerland 2014

Authors and Affiliations

  1. 1.University of TokushimaTokushimaJapan

Personalised recommendations