Advertisement

Dataflow Analysis for Datarace-Free Programs

  • Arnab De
  • Deepak D’Souza
  • Rupesh Nasre
Part of the Lecture Notes in Computer Science book series (LNCS, volume 6602)

Abstract

Memory models for shared-memory concurrent programming languages typically guarantee sequential consistency (SC) semantics for datarace-free (DRF) programs, while providing very weak or no guarantees for non-DRF programs. In effect programmers are expected to write only DRF programs, which are then executed with SC semantics. With this in mind, we propose a novel scalable solution for dataflow analysis of concurrent programs, which is proved to be sound for DRF programs with SC semantics. We use the synchronization structure of the program to propagate dataflow information among threads without requiring to consider all interleavings explicitly. Given a dataflow analysis that is sound for sequential programs and meets certain criteria, our technique automatically converts it to an analysis for concurrent programs.

Keywords

dataflow analysis datarace-free program concurrency 

References

  1. 1.
    Andersen, L.O.: Program Analysis and Specialization for the C Programming Language. Ph.D. thesis, DIKU, University of Copenhagen (1994)Google Scholar
  2. 2.
    Boehm, H.J., Adve, S.V.: Foundations of the C++ Concurrency Memory Model. In: Proceedings of the 2008 ACM SIGPLAN Conference on Programming Language Design and Implementation, pp. 68–78. ACM, New York (2008)CrossRefGoogle Scholar
  3. 3.
    Chugh, R., Voung, J.W., Jhala, R., Lerner, S.: Dataflow Analysis for Concurrent Programs Using Datarace Detection. In: Proceedings of the 2008 ACM SIGPLAN Conference on Programming Language Design and Implementation, pp. 316–326. ACM, New York (2008)CrossRefGoogle Scholar
  4. 4.
    Cousot, P., Cousot, R.: Abstract Interpretation: A Unified Lattice Model for Static Analysis of Programs by Construction or Approximation of Fixpoints. In: Proceedings of the 4th ACM SIGACT-SIGPLAN Symposium on Principles of programming languages, pp. 238–252. ACM, New York (1977)Google Scholar
  5. 5.
    De, A., D’Souza, D., Nasre, R.: Dataflow Analysis for Datarace-Free Programs. Tech. Rep. IISc-CSA-TR-2010-8, Computer Science and Automation, Indian Institute of Science, India (December 2010), http://aditya.csa.iisc.ernet.in/TR/2010/8/
  6. 6.
    Dwyer, M.B., Clarke, L.A.: Data Flow Analysis for Verifying Properties of Concurrent Programs. In: Proceedings of the 2nd ACM SIGSOFT Symposium on Foundations of Software Engineering, pp. 62–75. ACM, New York (1994)CrossRefGoogle Scholar
  7. 7.
    Farzan, A., Kincaid, Z.: Compositional Bitvector Analysis for Concurrent Programs with Nested Locks. In: Cousot, R., Martel, M. (eds.) SAS 2011. LNCS, vol. 6337, pp. 253–270. Springer, Heidelberg (2011)CrossRefGoogle Scholar
  8. 8.
    Flanagan, C., Freund, S., Qadeer, S.: Thread-Modular Verification for Shared-Memory Programs. In: Le Métayer, D. (ed.) ESOP 2002. LNCS, vol. 2305, pp. 262–277. Springer, Heidelberg (2002)CrossRefGoogle Scholar
  9. 9.
    Flanagan, C., Qadeer, S.: Thread-Modular Model Checking. In: Ball, T., Rajamani, S.K. (eds.) SPIN 2003. LNCS, vol. 2648, p. 624. Springer, Heidelberg (2003)CrossRefGoogle Scholar
  10. 10.
    Gotsman, A., Berdine, J., Cook, B., Sagiv, M.: Thread-Modular Shape Analysis. In: Proceedings of the 2007 ACM SIGPLAN Conference on Programming Language Design and Implementation, pp. 266–277. ACM, New York (2007)CrossRefGoogle Scholar
  11. 11.
    Grunwald, D., Srinivasan, H.: Data Flow Equations for Explicitly Parallel Programs. In: Proceedings of the 4th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, pp. 159–168. ACM, New York (1993)Google Scholar
  12. 12.
    JSR-133 Expert Group: JSR-133: Java Memory Model and Thread Specification (August 2004), http://www.cs.umd.edu/~pugh/java/memoryModel/jsr133.pdf
  13. 13.
    Kam, J.B., Ullman, J.D.: Monotone Data Flow Analysis Frameworks. Acta Inf. 7, 305–317 (1977)MathSciNetCrossRefzbMATHGoogle Scholar
  14. 14.
    Kildall, G.A.: A Unified Approach to Global Program Optimization. In: Proceedings of the 1st ACM SIGACT-SIGPLAN Symposium on Principles of Programming Languages, pp. 194–206. ACM, New York (1973)Google Scholar
  15. 15.
    Knoop, J., Steffen, B., Vollmer, J.: Parallelism for Free: Efficient and Optimal Bitvector Analyses for Parallel Programs. ACM Trans. Program. Lang. Syst. 18(3), 268–299 (1996)CrossRefGoogle Scholar
  16. 16.
    Lee, J., Padua, D.A., Midkiff, S.P.: Basic Compiler Algorithms for Parallel Programs. In: Proceedings of the 7th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, pp. 1–12. ACM, New York (1999)Google Scholar
  17. 17.
    Lhoták, O.: Spark: A Flexible Points-to Analysis Framework for Java. Master’s thesis, McGill University (December 2002)Google Scholar
  18. 18.
    LLVM Project. The LLVM Compiler Infrastructure, http://llvm.org/
  19. 19.
    Malkis, A., Podelski, A., Rybalchenko, A.: Thread-Modular Counterexample-Guided Abstraction Refinement. In: Cousot, R., Martel, M. (eds.) SAS 2010. LNCS, vol. 6337, pp. 356–372. Springer, Heidelberg (2010)CrossRefGoogle Scholar
  20. 20.
    Manson, J., Pugh, W., Adve, S.V.: The Java Memory Model. In: Proceedings of the 32nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pp. 378–391. ACM, New York (2005)Google Scholar
  21. 21.
    Musuvathi, M., Qadeer, S.: Iterative Context Bounding for Systematic Testing of Multithreaded Programs. In: Proceedings of the 2007 ACM SIGPLAN Conference on Programming Language Design and Implementation, pp. 446–455. ACM, New York (2007)CrossRefGoogle Scholar
  22. 22.
    Naik, M., Aiken, A., Whaley, J.: Effective Static Race Detection for Java. In: Proceedings of the 2006 ACM SIGPLAN conference on Programming Language Design and Implementation, pp. 308–319. ACM, New York (2006)CrossRefGoogle Scholar
  23. 23.
    Rugina, R., Rinard, M.: Pointer Analysis for Multithreaded Programs. In: Proceedings of the ACM SIGPLAN 1999 Conference on Programming Language Design and Implementation, pp. 77–90. ACM, New York (1999)CrossRefGoogle Scholar
  24. 24.
    Sevcik, J.: Program Transformations in Weak Memory Models. Ph.D. thesis, University of Edinburgh (2008)Google Scholar
  25. 25.
    Sharir, M., Pnueli, A.: Two Approaches to Interprocedural Data Flow Analysis, ch. 7, pp. 189–234. Prentice-Hall, Englewood Cliffs (1981)Google Scholar
  26. 26.
    Valle-Rai, R.: Soot: A Java Bytecode Optimization Framework. Master’s thesis, McGill University (July 2000)Google Scholar
  27. 27.
    Visser, W., Havelund, K., Brat, G., Park, S.: Model Checking Programs. In: Proceedings of the 15th IEEE International Conference on Automated Software Engineering, p. 3. IEEE Computer Society, Washington, DC (2000)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2011

Authors and Affiliations

  • Arnab De
    • 1
  • Deepak D’Souza
    • 1
  • Rupesh Nasre
    • 1
  1. 1.Department of Computer Science and AutomationIndian Institute of ScienceBangaloreIndia

Personalised recommendations