Predicting and Witnessing Data Races Using CSP

Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 9058)

Abstract

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.

Keywords

Data race Concurrent programs Debug CSP 

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Barney, B.L.L.N.L.: POSIX Threads Programming. https://computing.llnl.gov/tutorials/pthreads/
  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). http://doi.acm.org/10.1145/1542476.1542490, http://dl.acm.org/citation.cfm?id=1542490
  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). http://www.cs.ucf.edu/courses/cop4020/sum2009/CSP-hoare.pdf
  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). http://dl.acm.org/citation.cfm?id=2594315
  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). http://doi.acm.org/10.1145/1390841.1390847, http://www.cs.umd.edu/pugh/ISSTA08/padtad2008/papers/a8-jannesari.pdf
  8. 8.
    Lamport, L.: Time, clocks, and the ordering of events in a distributed system. Communications of the ACM 21(7), 558–565 (1978). http://dl.acm.org/citation.cfm?id=359563
  9. 9.
    Nethercote, N., Seward, J.: Valgrind: a framework for heavyweight dynamicbinary instrumentation. ACM Sigplan Notices, 89–100 (2007). http://dl.acm.org/citation.cfm?id=1250746
  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). http://onlinelibrary.wiley.com/doi/10.1002/cpe.1064/abstract
  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). http://doi.acm.org/10.1145/265924.265927, http://portal.acm.org/citation.cfm?doid=265924.265927
  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). http://dl.acm.org/citation.cfm?id=1791203
  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). http://dl.acm.org/citation.cfm?doid=2103656.2103702
  15. 15.
    Valgrind: Helgrind: a data-race detector (2007). http://valgrind.org/docs/manual/hg-manual.html

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