Abstract
This paper presents a static analysis-based regression analysis for multithreaded Java applications to help detect changes that may introduce potential deadlocks. Our approach leverages the correct/intended ordering of lock acquires and proposes to keep a watch list of lock type pairs that the developers may want to keep an eye on as the software evolves. The idea is to filter code changes that may employ the locks in the wrong order. We also present a heuristic that can automatically infer the intended order most of the time. Our experiments on several case studies with large code bases show that our approach is effective in pinpointing code changes that may introduce deadlocks and a cost-effective way of utilizing static analysis.





Similar content being viewed by others
Notes
We follow the syntax provided by the diff utility.
Our code and data is available at http://www.tuba.ece.ufl.edu/chimp.zip.
We used the abbreviated version unregFraListsForContSearch to denote unregisterFrameworkListsForContextSearch.
We have created mock versions of jobdetails.jsp by extracting the java code and compiling in a file called JobDetailsMock.java as mentioned in Table 1.
“.. I am trying to prevent mistakes which break the synchronization order..”
It is remarkable that the developers introduced documentation on the correct order of acquiring JobTracker and JobInProgress locks at the API level only after manifestation of MAPREDUCE-805, a reappearance of HADOOP-2001.
References
Agarwal, R., Wang, L., & Stoller, S. D. (2005). Detecting potential deadlocks with static analysis and run-time monitoring, Proceedings of the parallel and distributed systems: testing and debugging track of the 2005 IBM verification conference.
Andersen, L. O. (1994). Program analysis and specialization of the C programming language. Technical report, DIKU, University of Kopenhagen.
Bensalem, S., Fernandez, J., Havelund, K., & Mounier, L. (2006). Confirmation of deadlock potentails detected by runtime analysis, Proceedings of the 2006 workshop on parallel and distributed dystems: testing and debugging, (PADTAD?06) (pp. 41–50).
Bensalem, S., & Havelund, K. (2005). Dynamic deadlock analysis of multi-threaded programs, Haifa verification conference (pp. 208–223).
Boyapati, C., Lee, R., & Rinard, M. (2002). Ownership types for safe programming: preventing data races and deadlocks, Proceedings of the 17th ACM SIGPLAN conference on object-oriented programming, systems, languages, and applications, OOPSLA ’02 (pp. 211–230).
Cai, Y., & Cao, L. (2016). Fixing deadlocks via lock pre-acquisitions, Proceedings of the 38th international conference on software engineering ICSE’16.
Cai, Y., & Chan, W. K. (2012). Magicfuzzer: scalable deadlock detection for large-scale applications, 34th international conference on software engineering, ICSE 2012, June 2-9, 2012, Zurich, Switzerland (pp. 606–616).
Demartini, C., Iosif, R., & Sisto, R. (1999). A deadlock detection tool for concurrent java programs. Software - Practice and Experience, 29(7), 577–603.
Edelstein, O., Farchi, E., Goldin, E., Nir, Y., Ratsaby, G., & Ur, S. (2003). Framework for testing multi-threaded java programs. Concurrency and Computation: Practice and Experience, 15(3–5), 485– 499.
Engler, D., & Ashcraft, K. (2003). Racerx: effective, static detection of race conditions and deadlocks, Proceedings of the 19th ACM symposium on operating systems principles (SOSP?03) (pp. 237– 252).
Eslamimehr, M., & Palsberg, J. (2014). Sherlock: scalable deadlock detection for concurrent programs, Proceedings of the 22nd ACM SIGSOFT international symposium on foundations of software engineering, FSE 2014 (pp. 353–365).
Flanagan, C., Leino, K. R. M., Lillibridge, M., Nelson, G., Saxe, J. B., & Stata, R. (2002). Extended static checking for java, Proceedings of the ACM SIGPLAN 2002 conference on programming language design and implementation, PLDI ’02 (pp. 234–245).
Havelund, K. (2000). Using runtime analysis to guide model checking of java programs, Proceedings of the 7th international SPIN workshop on SPIN model checking and software verification (pp. 245–264).
Hovemeyer, D., & Pugh, W. (2004). Finding bugs is easy. SIGPLAN Notices, 39(12), 92–106.
Jagannath, V., Luo, Q., & Marinov, D. (2011). Change-aware preemption prioritization, Proceedings of the 20th international symposium on software testing and analysis, ISSTA 2011, Toronto, ON, Canada, July 17-21, 2011 (pp. 133–143).
Joshi, P., Naik, M., Sen, K., & Gay, D. (2010). An effective dynamic analysis for detecting generalized deadlocks, Proceedings of the 18th ACM SIGSOFT international symposium on foundations of software engineering, FSE ’10 (pp. 327–336).
Joshi, P., Park, C., Sen, K., & Naik, M. (2009). A randomized dynamic program analysis technique for detecting real deadlocks, Proceedings of the 2009 ACM SIGPLAN conference on programming language design and implementation (PLDI?09) (pp. 110–120).
Joshi, P., Park, C. -S., Sen, K., & Naik, M. (2009). A randomized dynamic program analysis technique for detecting real deadlocks, Proceedings of the 30th ACM SIGPLAN conference on programming language design and implementation, PLDI ’09 (pp. 110–120).
Marino, D., Hammer, C., Dolby, J., Vaziri, M., Tip, F., & Vitek, J. (2013). Detecting deadlock in programs with data-centric synchronization, Proceedings of the 2013 international conference on software engineering, ICSE ’13 (pp. 322–331).
Naik, M., Park, C., Sen, K., & Gay, D. (2009). Effective static deadlock detection, Proceedings of the 31st international conference on software engineering, ICSE 2009, May 16-24, 2009, Vancouver, Canada (pp. 386–396).
Păsăreanu, C. S. , & Rungta, N. (2010). Symbolic pathfinder: symbolic execution of java bytecode, Proceedings of the IEEE/ACM international conference on automated software engineering ASE’10.
Terragni, V., Cheung, S., & Zhang, C. (2015). RECONTEST: effective regression testing of concurrent programs, 37th IEEE/ACM international conference on software engineering, ICSE 2015, Florence, Italy, May 16-24, 2015, Volume 1 (pp. 246–256).
Visser, W., Havelund, K., Brat, G. P., Park, S., & Lerda, F. (2003). Model checking programs. Automated Software Engineering, 10(2), 203–232.
Wang, H., Liu, T., Guan, X., Shen, C., Zheng, Q., & Yang, Z. (2017). Dependence guided symbolic execution. IEEE Transactions on Software Engineering, 43(3), 252–271.
Williams, A., Thies, W., & Ernst, M. (2005). Static deadlock detection for java libraries, Proceedings of the 19th European conference on object-oriented programming (ECOOP?05) (pp. 602–629).
Yang, G., Dwyer, M. B., & Rothermel, G. (2009). Regression model checking, 25th IEEE international conference on software maintenance (ICSM 2009), September 20-26, 2009, Edmonton, Alberta, Canada (pp. 115–124).
Yin, Z., Yuan, D., Zhou, Y., Pasupathy, S., & Bairavasundaram, L. N. (2011). How do fixes become bugs?, SIGSOFT/FSE’11 19th ACM SIGSOFT symposium on the foundations of software engineering (FSE-19) and ESEC’11: 13rd European software engineering conference (ESEC-13), Szeged, Hungary, September 5-9, 2011 (pp. 26–36).
Yu, T., Srisa-an, W., & Rothermel, G. (2014). Simrt: an automated framework to support regression testing for data races. In Proceedings of the 36th International conference on software engineering, ICSE 2014, (pp 4859), New York, NY, USA: ACM.
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
About this article
Cite this article
Metcalf, C.A., Yavuz, T. Detecting potential deadlocks through change impact analysis. Software Qual J 26, 1015–1036 (2018). https://doi.org/10.1007/s11219-017-9377-3
Published:
Issue Date:
DOI: https://doi.org/10.1007/s11219-017-9377-3