Predicting and Witnessing Data Races Using CSP

  • Luis M. CarrilEmail author
  • Walter F. Tichy
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 9058)


Detecting and debugging data races is a complex task due to the large number of interleavings possible in a parallel program. Most tools can find the data races reliably in an observed execution, but they miss errors in alternative reorderings of events. In this paper we describe an automated approach to generate, from a single program trace, a model in CSP with alternative interleavings. We check for data races patterns and obtain a witness that allows the reproduction of errors. Reproduction reduces the developer effort to correct the error.


Data race Concurrent programs Debug CSP 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Barney, B.L.L.N.L.: POSIX Threads Programming.
  2. 2.
    Flanagan, C., Freund, S.N.S.: FastTrack: efficient and precise dynamic race detection. In: PLDI 2009 Proceedings of the 2009 ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2009, pp. 121–133. ACM, New York (2009).,
  3. 3.
    Gait, J.: A probe effect in concurrent programs. Software: Practice and Experience 16(3), 225–233 (1986)Google Scholar
  4. 4.
    Gibson-Robinson, T., Armstrong, P., Boulgakov, A., Roscoe, A.W.: FDR3 — a modern refinement checker for CSP. In: Ábrahám, E., Havelund, K. (eds.) TACAS 2014 (ETAPS). LNCS, vol. 8413, pp. 187–201. Springer, Heidelberg (2014) Google Scholar
  5. 5.
    Hoare, C.: Communicating Sequential Processes. Communications of the ACM 21(8), 666–677 (1978).
  6. 6.
    Huang, J., Meredith, P., Rosu, G.: Maximal sound predictive race detection with control flow abstraction. In: PLDI 2014 Proceedings of the 35th ACM SIGPLAN Conference on Programming Language Design and Implementation, pp. 337–348 (2014).
  7. 7.
    Jannesari, A., Tichy, W.F.: On-the-fly race detection in multi-threaded programs. In: Proceedings of the 6th Workshop on Parallel and Distributed Systems: Testing, Analysis, and Debugging, PADTAD 2008, pp. 6:1–6:10. ACM, New York (2008).,
  8. 8.
    Lamport, L.: Time, clocks, and the ordering of events in a distributed system. Communications of the ACM 21(7), 558–565 (1978).
  9. 9.
    Nethercote, N., Seward, J.: Valgrind: a framework for heavyweight dynamicbinary instrumentation. ACM Sigplan Notices, 89–100 (2007).
  10. 10.
    Pozniansky, E., Schuster, A.: MultiRace: efficient on the fly data race detection in multithreaded C++ programs. Concurrency and Computation: Practice and Experience 19(3), 327–340 (2007).
  11. 11.
    Said, M., Wang, C., Yang, Z., Sakallah, K.: Generating data race witnesses by an SMT-based analysis. In: Bobaru, M., Havelund, K., Holzmann, G.J., Joshi, R. (eds.) NFM 2011. LNCS, vol. 6617, pp. 313–327. Springer, Heidelberg (2011) Google Scholar
  12. 12.
    Savage, S., Burrows, M., Nelson, G., Sobalvarro, P., Anderson, T.: Eraser: a dynamic data race detector for multithreaded programs. ACM Transactions on Computer Systems 15(4), 391–411 (1997).,
  13. 13.
    Serebryany, K., Iskhodzhanov, T.: ThreadSanitizer: data race detection in practice. In: WBIA 2009 Proceedings of the Workshop on Binary Instrumentation and Applications, pp. 62–71 (2009).
  14. 14.
    Smaragdakis, Y., Evans, J., Sadowski, C., Yi, J., Flanagan, C.: Sound predictive race detection in polynomial time. In: Proceedings of the 39th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2012, p. 387 (2012).
  15. 15.
    Valgrind: Helgrind: a data-race detector (2007).

Copyright information

© Springer International Publishing Switzerland 2015

Authors and Affiliations

  1. 1.Institute for Program Structures and Data Organization (IPD)Karlsruhe Institute of Technology (KIT)KarlsruheGermany

Personalised recommendations