Skip to main content
Log in

A decision procedure for detecting atomicity violations for communicating processes with locks

  • SPIN 2009
  • Published:
International Journal on Software Tools for Technology Transfer Aims and scope Submit manuscript

Abstract

The problem of interest is to verify data consistency of a concurrent Java program. In particular, we present a new decision procedure for verifying that a class of data races caused by inconsistent accesses on multiple fields of an object cannot occur (so-called atomic-set serializability). Atomic-set serializability generalizes the ordinary notion of a data race (i.e., inconsistent coordination of accesses on a single memory location) to a broader class of races that involve accesses on multiple memory locations. Previous work by some of the authors presented a technique to abstract a concurrent Java program into an EML program, a modeling language based on pushdown systems and a finite set of reentrant locks. Our previous work used only a semi-decision procedure, and hence provides a definite answer only some of the time. In this paper, we rectify this shortcoming by developing a decision procedure for verifying data consistency, i.e., atomic-set serializability, of an EML program. When coupled with the previous work, it provides a decision procedure for verifying data consistency of a concurrent Java program. We implemented the decision procedure, and applied it to detect both single-location and multi-location data races in models of concurrent Java programs. Compared with the prior method based on a semi-decision procedure, not only was the decision procedure 34 times faster overall, but the semi-decision procedure timed out on about 50% of the queries, whereas the decision procedure timed out on none of the queries.

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

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Bouajjani, A., Esparza, J., Maler, O.: Reachability analysis of pushdown automata: Application to model checking. In: CONCUR (1997)

  2. Bouajjani, A., Esparza, J., Touili, T.: A generic approach to the static analysis of concurrent programs with procedures. In: POPL (2003)

  3. Bouajjani, A., Müller-Olm, M., Touili, T.: Regular symbolic analysis of dynamic networks of pushdown systems. In: CONCUR (2005)

  4. BuDDy: A BDD package. http://buddy.wiki.sourceforge.net/ (2004)

  5. Chaki, S., Clarke, E., Kidd, N., Reps, T., Touili, T.: Verifying concurrent message-passing C programs with recursive calls. In: TACAS (2006)

  6. Eytani Y., Havelund K., Stoller S.D., Ur S.: Towards a framework and a benchmark for testing tools for multi-threaded programs. Conc. Comp. Prac. Exp. 19(3), 267–279 (2007)

    Article  Google Scholar 

  7. Finkel A., Willems B., Wolper P.: A direct symbolic approach to model checking pushdown systems. Electron. Notes Theor. Comput. Sci 9, 27–37 (1997)

    Article  Google Scholar 

  8. Flanagan, C., Qadeer, S.: A type and effect system for atomicity. In: PLDI (2003)

  9. Harrison M.: Introduction to Formal Language Theory. Addison-Wesley, Reading (1978)

    MATH  Google Scholar 

  10. Kahlon, V., Gupta, A.: On the analysis of interacting pushdown systems. In: POPL (2007)

  11. Kahlon, V., Gupta, A.: Personal communication (2009)

  12. Kahlon, V., Ivancic, F., Gupta, A.: Reasoning about threads communicating via locks. In: CAV (2005)

  13. Kidd, N., Lal, A., Reps, T.: Language strength reduction. In: SAS (2008)

  14. Kidd, N., Lal, A., Reps, T.: WALi: The Weighted Automaton Library. http://www.cs.wisc.edu/wpis/wpds/download.php (2009)

  15. Kidd, N., Reps, T., Dolby, J., Vaziri, M.: Finding concurrency-related bugs using random isolation. In: VMCAI (2009)

  16. Kidd, N.A., Lammich, P., Touili, T., Reps, T.: A decision procedure for detecting atomicity violations for communicating processes with locks. In: SPIN (2009)

  17. Lal, A., Touili, T., Kidd, N., Reps, T.: Interprocedural analysis of concurrent programs under a context bound. In: TACAS (2008)

  18. Lammich, P., Müller-Olm, M., Wenner, A.: Predecessor sets of dynamic pushdown networks with tree-regular constraints. In: CAV (2009)

  19. Lu, S., Park, S., Seo, E., Zhou, Y.: Learning from mistakes—a comprehensive study on real world concurrency bug characteristics. In: ASPLOS (2008)

  20. Qadeer, S., Rehof, J.: Context-bounded model checking of concurrent software. In: TACAS (2005)

  21. Ramalingam G.: Context-sensitive synchronization-sensitive analysis is undecidable. ACM Trans. Programming. Lang. Syst. 22, 416–430 (2000)

    Article  Google Scholar 

  22. Reps T.: Program analysis via graph reachability. Inf. Softw. Technol. 40, 5–19 (1998)

    Article  Google Scholar 

  23. Reps T., Schwoon S., Jha S., Melski D.: Weighted pushdown systems and their application to interprocedural dataflow analysis. SCP 58, 206–263 (2005)

    MATH  MathSciNet  Google Scholar 

  24. Schwoon, S.: Model-checking pushdown systems. PhD thesis, TUM (2002)

  25. Vaziri, M., Tip, F., Dolby, J.: Associating synchronization constraints with data in an object-oriented language. In: POPL (2006)

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Nicholas Kidd.

Additional information

Supported by NSF under grants CCF-0540955, CCF-0524051, and CCF-0810053, by AFRL under contract FA8750-06-C-0249, and by ONR under grant N00014-09-1-0510.

This work was performed while N. Kidd was at the University of Wisconsin.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Kidd, N., Lammich, P., Touili, T. et al. A decision procedure for detecting atomicity violations for communicating processes with locks. Int J Softw Tools Technol Transfer 13, 37–60 (2011). https://doi.org/10.1007/s10009-010-0159-5

Download citation

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10009-010-0159-5

Keywords

Navigation