Optimized Sound and Complete Data Race Detection in Structured Parallel Programs

  • Kyle Storey
  • Jacob Powell
  • Ben Ogles
  • Joshua Hooker
  • Peter Aldous
  • Eric MercerEmail author
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 11882)


Task parallel programs that are free of data race are guaranteed to be deterministic, serializable, and free of deadlock. Techniques for verification of data race freedom vary in both accuracy and asymptotic complexity. One work is particularly well suited to task parallel programs with isolation and lightweight threads. It uses the Java Pathfinder model checker to reason about different schedules and proves the presence or absence of data race in a program on a fixed input. However, it uses a direct and inefficient transitive closure on the happens-before relation to reason about data race. This paper presents Zipper, an alternative to this naïve algorithm, which identifies the presence or absence of data race in asymptotically superior time. Zipper is optimized for lightweight threads and, in the presence of many threads, has superior time complexity to leading vector clock algorithms. This paper includes an empirical study of Zipper and a comparison against the naïve computation graph algorithm, demonstrating the superior performance it achieves.


  1. 1.
    Audenaert, K.: Clock trees: Logical clocks for programs with nested parallelism. IEEE Trans. Softw. Eng. 23(10), 646–658 (1997)CrossRefGoogle Scholar
  2. 2.
    Bender, M.A., Fineman, J.T., Gilbert, S., Leiserson, C.E.: On-the-fly maintenance of series-parallel relationships in fork-join multithreaded programs. In: Proceedings of the Sixteenth Annual ACM Symposium on Parallelism in Algorithms and Architectures, SPAA 2004, pp. 133–144. ACM, New York (2004).
  3. 3.
    Brat, G., Visser, W.: Combining static analysis and model checking for software analysis. In: Proceedings 16th Annual International Conference on Automated Software Engineering (ASE 2001). IEEE Computer Society (2001).
  4. 4.
    Cavé, V., Zhao, J., Shirako, J., Sarkar, V.: Habanero-Java: the new adventures of old X10, August 2011Google Scholar
  5. 5.
    Cheng, G.I., Feng, M., Leiserson, C.E., Randall, K.H., Stark, A.F.: Detecting data races in CILK programs that use locks. In: Proceedings of the Tenth Annual ACM Symposium on Parallel Algorithms and Architectures, SPAA 1998, pp. 298–309. ACM, New York (1998).
  6. 6.
    Christiaens, M., De Bosschere, K.: Accordion clocks: logical clocks for data race detection. In: Sakellariou, R., Gurd, J., Freeman, L., Keane, J. (eds.) Euro-Par 2001. LNCS, vol. 2150, pp. 494–503. Springer, Heidelberg (2001). Scholar
  7. 7.
    Dennis, J.B., Gao, G.R., Sarkar, V.: Determinacy and repeatability of parallel program schemata. In: Data-Flow Execution Models for Extreme Scale Computing (DFM), pp. 1–9. IEEE (2012)Google Scholar
  8. 8.
    Dimitrov, D., Raychev, V., Vechev, M., Koskinen, E.: Commutativity race detection. SIGPLAN Not. 49(6), 305–315 (2014)CrossRefGoogle Scholar
  9. 9.
    Elmas, T., Qadeer, S., Tasiran, S.: Goldilocks: a race and transaction-aware Java runtime. In: Proceedings of the 28th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2007, pp. 245–255. ACM, New York (2007).
  10. 10.
    Engler, D., Ashcraft, K.: RacerX: effective, static detection of race conditions and deadlocks. In: Proceedings of the Nineteenth ACM Symposium on Operating Systems Principles, SOSP 2003 pp. 237–252. ACM, New York (2003).
  11. 11.
    Feng, M., Leiserson, C.E.: Efficient detection of determinacy races in CILK programs. Theory Comput. Syst. 32(3), 301–326 (1999). Scholar
  12. 12.
    Fidge, C.J.: Partial orders for parallel debugging. In: Proceedings of the 1988 ACM SIGPLAN and SIGOPS Workshop on Parallel and Distributed Debugging, PADD 1988, pp. 183–194. ACM, New York (1988).
  13. 13.
    Flanagan, C., Freund, S.N.: FastTrack: efficient and precise dynamic race detection. In: Proceedings of the 30th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2009, pp. 121–133. ACM, New York (2009).
  14. 14.
    Godefroid, P.: Model checking for programming languages using VeriSoft. In: Proceedings of the 24th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pp. 174–186 (1997)Google Scholar
  15. 15.
    Gotsman, A., Berdine, J., Cook, B., Sagiv, M.: Thread-modular shape analysis. SIGPLAN Not. 42(6), 266–277 (2007)CrossRefGoogle Scholar
  16. 16.
    Kahlon, V., Sinha, N., Kruus, E., Zhang, Y.: Static data race detection for concurrent programs with asynchronous calls. In: Proceedings of the 7th Joint Meeting of the European Software Engineering Conference and the ACM SIGSOFT Symposium on the Foundations of Software Engineering, pp. 13–22 (2009)Google Scholar
  17. 17.
    Kini, D., Mathur, U., Viswanathan, M.: Dynamic race prediction in linear time. In: ACM SIGPLAN Notices, vol. 52, pp. 157–170. ACM (2017)CrossRefGoogle Scholar
  18. 18.
    Kulikov, S., Shafiei, N., Van Breugel, F., Visser, W.: Detecting data races with Java PathFinder (2010).
  19. 19.
    Lamport, L.: Time, clocks, and the ordering of events in a distributed system. Commun. ACM 21(7), 558–565 (1978)CrossRefGoogle Scholar
  20. 20.
    Lu, L., Ji, W., Scott, M.L.: Dynamic enforcement of determinism in a parallel scripting language. SIGPLAN Not. 49(6), 519–529 (2014). Scholar
  21. 21.
    Malkis, A., Podelski, A., Rybalchenko, A.: Precise thread-modular verification. In: Nielson, H.R., Filé, G. (eds.) SAS 2007. LNCS, vol. 4634, pp. 218–232. Springer, Heidelberg (2007). Scholar
  22. 22.
    Mattern, F., et al.: Virtual time and global states of distributed systems. Parallel Distrib. Algorithms 1(23), 215–226 (1989)MathSciNetGoogle Scholar
  23. 23.
    Mellor-Crummey, J.: On-the-fly detection of data races for programs with nested fork-join parallelism. In: Proceedings of the 1991 ACM/IEEE Conference on Supercomputing, Supercomputing 1991, pp. 24–33. ACM, New York (1991).
  24. 24.
    Nakade, R., Mercer, E., Aldous, P., McCarthy, J.: Model-checking task parallel programs for data-race. In: Dutle, A., Muñoz, C., Narkawicz, A. (eds.) NFM 2018. LNCS, vol. 10811, pp. 367–382. Springer, Cham (2018). Scholar
  25. 25.
    Raman, R., Zhao, J., Sarkar, V., Vechev, M., Yahav, E.: Efficient data race detection for async-finish parallelism. In: Barringer, H., Falcone, Y., Finkbeiner, B., Havelund, K., Lee, I., Pace, G., Roşu, G., Sokolsky, O., Tillmann, N. (eds.) RV 2010. LNCS, vol. 6418, pp. 368–383. Springer, Heidelberg (2010). Scholar
  26. 26.
    Surendran, R., Sarkar, V.: Dynamic determinacy race detection for task parallelism with futures. In: Falcone, Y., Sánchez, C. (eds.) RV 2016. LNCS, vol. 10012, pp. 368–385. Springer, Cham (2016). Scholar
  27. 27.
    Vechev, M., Yahav, E., Raman, R., Sarkar, V.: Automatic verification of determinism for structured parallel programs. In: Cousot, R., Martel, M. (eds.) SAS 2010. LNCS, vol. 6337, pp. 455–471. Springer, Heidelberg (2010). Scholar
  28. 28.
    Voung, J.W., Jhala, R., Lerner, S.: RELAY: static race detection on millions of lines of code. In: Proceedings of the 6th Joint Meeting of the European Software Engineering Conference and the ACM SIGSOFT Symposium on the Foundations of Software Engineering, ESEC-FSE 2007, pp. 205–214. ACM, New York (2007).

Copyright information

© Springer Nature Switzerland AG 2019

Authors and Affiliations

  1. 1.Brigham Young UniversityProvoUSA

Personalised recommendations