Precise Detection of Atomicity Violations

  • Ricardo J. Dias
  • Vasco Pessanha
  • João M. Lourenço
Part of the Lecture Notes in Computer Science book series (LNCS, volume 7857)

Abstract

Concurrent programs that are free of unsynchronized accesses to shared data may still exhibit unpredictable concurrency errors, called atomicity violations, which include both high-level data races and stale-value errors. Atomicity violations occur when programmers make wrong assumptions about the atomicity scope of a code block, incorrectly splitting it in two or more atomic blocks and allowing them to be interleaved with other atomic blocks. In this paper we propose a novel static analysis algorithm that works on a dependency graph of program variables and detects both high-level data races and stale-value errors. The algorithm was implemented for a Java Bytecode analyzer and its effectiveness was evaluated with well known faulty programs. The results obtained show that our algorithm performs better than previous approaches, achieving higher precision for small and medium sized programs, making it a good basis for a practical tool.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Alpern, B., Wegman, M.N., Zadeck, F.K.: Detecting equality of variables in programs. In: Proc. of the 15th ACM SIGPLAN-SIGACT Symp. on Principles of Programming Languages, POPL 1988, pp. 1–11. ACM, San Diego (1988)CrossRefGoogle Scholar
  2. 2.
    Artho, C., Havelund, K., Biere, A.: High-level data races. Software Testing, Verification and Reliability 13(4), 207–227 (2003)CrossRefGoogle Scholar
  3. 3.
    Artho, C., Havelund, K., Biere, A.: Using block-local atomicity to detect stale-value concurrency errors. In: Wang, F. (ed.) ATVA 2004. LNCS, vol. 3299, pp. 150–164. Springer, Heidelberg (2004)CrossRefGoogle Scholar
  4. 4.
    Beckman, N.E., Bierhoff, K., Aldrich, J.: Verifying correct usage of atomic blocks and typestate. SIGPLAN Not. 43(10), 227–244 (2008)CrossRefGoogle Scholar
  5. 5.
    Flanagan, C., Freund, S.N.: Atomizer: a dynamic atomicity checker for multithreaded programs. In: Proc. of the 31st ACM SIGPLAN-SIGACT Symp. on Principles of Programming Languages, POPL 2004, Venice, Italy, pp. 256–267 (2004)Google Scholar
  6. 6.
    IBM HRL — Concurrency Testing RepositoryGoogle Scholar
  7. 7.
    Teixeira, B., Lourenço, J.M., Farchi, E., Dias, R.J., Sousa, D.G.: Detection of transactional memory anomalies using static analysis. In: Proc. of the 8th Workshop on Parallel and Distributed Systems: Testing, Analysis, and Debugging, PADTAD 2010, pp. 26–36. ACM, New York (2010)Google Scholar
  8. 8.
    Vallée-Rai, R., Co, P., Gagnon, E., Hendren, L., Lam, P., Sundaresan, V.: Soot - a Java bytecode optimization framework. In: Proc. of the 1999 Conference of the Centre for Advanced Studies on Collaborative Research, CASCON 1999, pp. 125–135. IBM Press (1999)Google Scholar
  9. 9.
    von Praun, C., Gross, T.R.: Static detection of atomicity violations in object-oriented programs. Journal of Object Technology, 2004 (2003)Google Scholar
  10. 10.
    Wang, L., Stoller, S.: Run-Time Analysis for Atomicity. Electronic Notes in Theoretical Computer Science 89(2), 191–209 (2003)CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2013

Authors and Affiliations

  • Ricardo J. Dias
    • 1
  • Vasco Pessanha
    • 1
  • João M. Lourenço
    • 1
  1. 1.Departamento de Informática and CITIUniversidade Nova de LisboaPortugal

Personalised recommendations