# A framework for deadlock detection in core ABS

- 350 Downloads
- 19 Citations

## Abstract

We present a framework for statically detecting deadlocks in a concurrent object-oriented language with asynchronous method calls and cooperative scheduling of method activations. Since this language features recursion and dynamic resource creation, deadlock detection is extremely complex and state-of-the-art solutions either give imprecise answers or do not scale. In order to augment precision and scalability, we propose a modular framework that allows several techniques to be combined. The basic component of the framework is a front-end inference algorithm that extracts abstract behavioral descriptions of methods, called contracts, which retain resource dependency information. This component is integrated with a number of possible different back-ends that analyze contracts and derive deadlock information. As a proof-of-concept, we discuss two such back-ends: (1) an evaluator that computes a fixpoint semantics and (2) an evaluator using abstract model checking.

## Keywords

Type inference Deadlock analysis Asynchronous method invocation Concurrent object groups## References

- 1.Abadi, M., Flanagan, C., Freund, S.N.: Types for safe locking: static race detection for java. ACM Trans. Program. Lang. Syst.
**28**, 207–255 (2006)Google Scholar - 2.Boyapati, C., Lee, R., Rinard, M.: Ownership types for safe program: preventing data races and deadlocks. In: Proceedings of OOPSLA ’02, pp. 211–230. ACM, London (2002)Google Scholar
- 3.Carlsson, R., Millroth, H.: On cyclic process dependencies and the verification of absence of deadlocks in reactive systems (1997)Google Scholar
- 4.Caromel, D.: Towards a method of object-oriented concurrent programming. Commun. ACM
**36**(9), 90–102 (1993)CrossRefGoogle Scholar - 5.Caromel, D., Henrio, L., Serpette, B.P.: Asynchronous and deterministic objects. In: Proceedings of POPL’04, pp. 123–134. ACM, London (2004)Google Scholar
- 6.Comtet, L.: Advanced Combinatorics: The Art of Finite and Infinite Expansions. Reidel, Dordrecht (1974)CrossRefzbMATHGoogle Scholar
- 7.Coppo, M.: Type inference with recursive type equations. In: Proceedings of FoSSaCS, LNCS, vol. 2030, pp. 184–198. Springer, Berlin (2001)Google Scholar
- 8.de Boer, F., Bravetti, M., Grabe, I., Lee, M., Steffen, M., Zavattaro, G.: A petri net based analysis of deadlocks for active objects and futures. In: Proceedings of Formal Aspects of Component Software—9th International Workshop, FACS 2012, Lecture Notes in Computer Science, vol. 7684, pp. 110–127. Springer, Berlin (2012)Google Scholar
- 9.de Boer, F., Clarke, D., Johnsen, E.: A complete guide to the future. In: Programming Language and Systems, LNCS, vol. 4421, pp. 316–330. Springer, Berlin (2007)Google Scholar
- 10.Flanagan, C., Leino, K.R.M., Lillibridge, M., Nelson, G., Saxe, J.B., Stata, R.: Extended static checking for java. SIGPLAN Not.
**37**(5), 234–245 (2002)CrossRefGoogle Scholar - 11.Flanagan, C., Qadeer, S.: A type and effect system for atomicity. In: PLDI 03: Programming Language Design and Implementation, pp. 338–349. ACM, London (2003)Google Scholar
- 12.Flores-Montoya, A., Albert, E., Genaim, S.: May-happen-in-parallel based deadlock analysis for concurrent objects. In: Proceedings of FORTE/FMOODS 2013, Lecture Notes in Computer Science, vol. 7892, pp. 273–288. Springer, Berlin (2013)Google Scholar
- 13.Gay, S., Hole, M.: Subtyping for session types in the \(\pi \)-calculus. Acta Inf.
**42**(2–3), 191–225 (2005)MathSciNetCrossRefzbMATHGoogle Scholar - 14.Giachino, E., Grazia, C.A., Laneve, C., Lienhardt, M., Wong, P.Y.H.: Deadlock analysis of concurrent objects: theory and practice. In: iFM’13, LNCS, vol. 7940, pp. 394–411. Springer, Berlin (2013)Google Scholar
- 15.Giachino, E., Kobayashi, N., Laneve, C.: Deadlock detection of unbounded process networks. In: Proceedings of CONCUR 2014, LNCS, vol. 8704, pp. 63–77. Springer, Berlin (2014)Google Scholar
- 16.Giachino, E., Laneve, C.: Analysis of deadlocks in object groups. In: FMOODS/FORTE, Lecture Notes in Computer Science, vol. 6722, pp. 168–182. Springer, Berlin (2011)Google Scholar
- 17.Giachino, E., Laneve, C.: A beginner’s guide to the deadLock Analysis Model. In: Trustworthy Global Computing—7th International Symposium, TGC 2012, Revised Selected Papers, Lecture Notes in Computer Science, vol. 8191, pp. 49–63. Springer, Berlin (2013)Google Scholar
- 18.Giachino, E., Laneve, C.: Deadlock detection in linear recursive programs. In: Proceedings of SFM-14:ESM, LNCS, vol. 8483, pp. 26–64. Springer, Berlin (2014)Google Scholar
- 19.Giachino, E., Lascu, T.A.: Lock analysis for an asynchronous object calculus. In: Proceedings of 13th ICTCS (2012)Google Scholar
- 20.Henglein, F.: Type inference with polymorphic recursion. ACM Trans. Program. Lang. Syst.
**15**(2), 253–289 (1993)CrossRefGoogle Scholar - 21.Igarashi, A., Kobayashi, N.: A generic type system for the pi-calculus. Theor. Comput. Sci.
**311**(1–3), 121–163 (2004)MathSciNetCrossRefzbMATHGoogle Scholar - 22.Johnsen, E.B., Hähnle, R., Schäfer, J., Schlatte, R., Steffen, M.: ABS: A core language for abstract behavioral specification. In: Aichernig, B., de Boer, F.S., Bonsangue, M.M. (eds.) Proceedings of 9th International Symposium on Formal Methods for Components and Objects (FMCO 2010), LNCS, vol. 6957, pp. 142–164. Springer, Berlin (2011)Google Scholar
- 23.Johnsen, E.B., Owe, O.: An asynchronous communication model for distributed concurrent objects. Softw. Syst. Model.
**6**(1), 39–58 (2007)CrossRefGoogle Scholar - 24.Kerfoot, E., McKeever, S., Torshizi, F.: Deadlock freedom through object ownership. In: T. Wrigstad (ed.) 5rd International Workshop on Aliasing, Confinement and Ownership in object-oriented programming (IWACO), in conjunction with ECOOP 2009 (2009)Google Scholar
- 25.Kobayashi, N.: A partially deadlock-free typed process calculus. TOPLAS
**20**(2), 436–482 (1998)CrossRefGoogle Scholar - 26.Kobayashi, N.: A new type system for deadlock-free processes. In: Proceedings of CONCUR 2006, LNCS, vol. 4137, pp. 233–247. Springer, Berlin (2006)Google Scholar
- 27.Kobayashi, N.: TyPiCal (2007). http://www.kb.ecei.tohoku.ac.jp/~koba/typical/
- 28.Laneve, C., Padovani, L.: The must preorder revisited. In: Proceedings of CONCUR 2007, LNCS, vol. 4703, pp. 212–225. Springer, Berlin (2007)Google Scholar
- 29.Milner, R.: A Calculus of Communicating Systems. Springer, Berlin (1982)zbMATHGoogle Scholar
- 30.Milner, R., Parrow, J., Walker, D.: A calculus of mobile processes, ii. Inf. Comput.
**100**, 41–77 (1992)MathSciNetCrossRefzbMATHGoogle Scholar - 31.Naik, M., Park, C.S., Sen, K., Gay, D.: Effective static deadlock detection. In: IEEE 31st International Conference on Software Engineering, 2009. ICSE 2009, pp. 386–396 (2009)Google Scholar
- 32.Pun, K.I.: behavioural static analysis for deadlock detection. Ph.D. thesis, Faculty olf Mathematics and Natural Sciences, University of Oslo, Norway (2013)Google Scholar
- 33.Puntigam, F., Peter, C.: Types for active objects with static deadlock prevention. Fundam. Inf.
**48**(4), 315–341 (2001)MathSciNetzbMATHGoogle Scholar - 34.Requirement elicitation (2009). Deliverable 5.1 of project FP7-231620 (HATS). http://www.hats-project.eu/sites/default/files/Deliverable51_rev2.pdf
- 35.Tarjan, R.E.: Depth-first search and linear graph algorithms. SIAM J. Comput.
**1**(2), 146–160 (1972)MathSciNetCrossRefzbMATHGoogle Scholar - 36.Vasconcelos, V.T., Martins, F., Cogumbreiro, T.: Type inference for deadlock detection in a multithreaded polymorphic typed assembly language. In: Proceedings of PLACES’09, EPTCS, vol. 17, pp. 95–109 (2009)Google Scholar
- 37.Visser, W., Havelund, K., Brat, G., Park, S., Lerda, F.: Model checking programs. Autom. Softw. Eng.
**10**(2), 203–232 (2003)CrossRefGoogle Scholar - 38.West, S., Nanz, S., Meyer, B.: A modular scheme for deadlock prevention in an object-oriented programming model. In: ICFEM, pp. 597–612 (2010)Google Scholar
- 39.Wong, P.Y.H., Albert, E., Muschevici, R., Proença, J., Schäfer, J., Schlatte, R.: The ABS tool suite: modelling, executing and analysing distributed adaptable object-oriented systems. J. Softw. Tools Technol. Transf.
**14**(5), 567–588 (2012)CrossRefGoogle Scholar - 40.Yonezawa, A., Briot, J.P., Shibayama, E.: Object-oriented concurrent programming in ABCL/1. In: Proceedings of OOPSLA’86, pp. 258–268 (1986)Google Scholar