Skip to main content
Log in

A dynamic predictive race detector for C/C++ programs

  • Published:
The Journal of Supercomputing Aims and scope Submit manuscript

Abstract

Concurrent techniques have been widely adopted in software systems, and data race has become a great threat to stability and security of concurrent systems. Previous precise race detection techniques either may miss many races, or are only suitable for some specific programs, such as the programs executed in a virtual machine rather than in actual hardware. To solves these problems, this paper introduces a dynamic predictive race detector, called LayDetect, which detects predictable races in C/C++ programs. LayDetect applies an innovative layering technique, which can detect more races than other detectors, such as FastTrack. We have implemented and evaluated LayDetect with well-known benchmarks and real-world applications. LayDetect has detected 3.7 M races at run-time which is more than that of FastTrack by two orders of magnitude, while the average slowdown (3.0\(\times \)) and space overhead (34.1 MB) of LayDetect are similar to that of FastTrack.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Institutional subscriptions

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9

Similar content being viewed by others

References

  1. Pozniansky E, Schuster A (2003) Efficient on-the-fly data race detection in multithreaded c++ programs. In: Proceedings of PPoPP, ACM

  2. Bo Z, Shuang X, Yang A, TAO W, (2016) Dptsv: a dynamic priority task scheduling strategy for tss deadlock based on value evaluation. China Commun 13(1):161–175

  3. Savage S, Burrows M, Nelson G, Sobalvarro P, Anderson T (1997) Eraser: a dynamic data race detector for multi-threaded programs. In: Proceedings of SOSP, ACM

  4. Lamport L (1978) Time, clocks, and the ordering of events in a distributed system. Commun ACM 21(7):558–565

    Article  MATH  Google Scholar 

  5. Smaragdakis Y, Evans J, Sadowski C, Yi J, Flanagan C (2012) Sound predictive race detection in polynomial time. In: Proceedings of POPL, ACM

  6. Adve SV, Hill MD, Miller BP, Netzer RHB (1991) Detecting data races on weak memory systems. In: Proceedings of ISCA, ACM

  7. Netzer RHB, Miller BP (1991) Improving the accuracy of data race detection. In: Proceedings of PPoPP, ACM

  8. Banerjee U, Bliss B, Ma Z, Petersen P (2006) A theory of data race detection. In: Proceedings of PADTAD, ACM

  9. Netzer RHB, Miller BP (1992) What are race conditions?: some issues and formalizations. ACM Lett Program Lang Syst 1(1):74–88

    Article  Google Scholar 

  10. Yang Y, Gopalakrishnan G, Lindstrom G (2004) Memory-model-sensitive data race analysis. In: Formal methods and software engineering, vol 3308. Springer, Berlin, pp 30–45

  11. Kahlon V, Yang Y, Sankaranarayanan S, Gupta A (2007) Fast and accurate static data-race detection for concurrent programs. In: Proceedings of International Conference on CAV 2007 Computer Aided Verification. Springer, Berlin

  12. Prvulovic M (2006) Cord: cost-effective (and nearly overhead-free) order-recording and data race detection. In: Proceedings of HPCA, IEEE Computer Society

  13. Jiang Y, Yang Y, Xiao T, Sheng T, Chen W (2016) Drddr: a lightweight method to detect data races in linux kernel. J Supercomput 72(4):1645–1659

    Article  Google Scholar 

  14. Dimitrov D, Raychev V, Vechev M, Koskinen E (2014) Commutativity race detection. In: Proceedings of PLDI, ACM

  15. O’Callahan R, Choi J-D (2003) Hybrid dynamic data race detection. In: Proceedings of PPoPP, ACM

  16. Tian C, Nagarajan V, Gupta R, Tallam S (2008) Dynamic recognition of synchronization operations for improved data race detection. In: Proceedings of ISSTA, ACM

  17. Wu Z, Lu K, Wang X, Zhou X, Chen C (2015) Detecting harmful data races through parallel verification. J Supercomput 71(8):2922–2943

    Article  Google Scholar 

  18. Flanagan C, Freund SN (2009) Fasttrack: efficient and precise dynamic race detection. In: Proceedings of PLDI, ACM

  19. Bond MD, Coons KE, McKinley KS (2010) Pacer: proportional detection of data races. In: Proceedings of PLDI, ACM

  20. Mattern F (1989) Virtual time and global states of distributed systems. In: Proceedings of Workshop on Parallel and Distributed Algorithms

  21. Itzkovitz A, Schuster A, Zeev-Ben-Mordehai O (1999) Toward integration of data race detection in dsm systems. J Parallel Distrib Comput 59(2):180–203

    Article  Google Scholar 

  22. Huang J, Meredith PO, Rosu G (2014) Maximal sound predictive race detection with control flow abstraction. In: Proceedings of PLDI, ACM

  23. Serbanuta T-F, Chen F, Rosu G (2012) Maximal causal models for sequentially consistent systems. In: Proceedings of RV. Springer, Berlin

  24. Li D, Srisa-an W, Dwyer MB (2011) Sos: saving time in dynamic race detection with stationary analysis. In: Proceedings of OOPSLA, ACM

  25. Wester B, Devecsery D, Chen PM, Flinn J, Narayanasamy S (2013) Parallelizing data race detection. In: Proceedings of ASPLOS, ACM

  26. Raman R, Zhao J, Sarkar V, Vechev M, Yahav E (2012) Scalable and precise dynamic datarace detection for structured parallelism. In: Proceedings of PLDI, ACM

  27. Burckhardt S, Kothari P, Musuvathi M, Nagarakatte S (2010) A randomized scheduler with probabilistic guarantees of finding bugs. In: Proceedings of ASPLOS, ACM

  28. He Y, Wu W, Chen Y (2012) An efficient method for detecting concurrency errors in object-oriented programs. Sci China Inf Sci 55(12):2774–2784

    Article  MathSciNet  Google Scholar 

  29. Nagarakatte S, Burckhardt S, Martin MM, Musuvathi M (2012) Multicore acceleration of priority-based schedulers for concurrency bug detection. In: Proceedings of PLDI, ACM

  30. Yu J, Narayanasamy S, Pereira C, Pokam G (2012) Maple: a coverage-driven testing tool for multithreaded programs. In: Proceedings of OOPSLA, ACM

  31. Veeraraghavan K, Chen PM, Flinn J, Narayanasamy S (2011) Detecting and surviving data races using complementary schedules. In: Proceedings of SOSP, ACM

  32. Wu Z, Lu K, Wang X, Zhou X (2015) Collaborative technique for concurrency bug detection. Int J Parallel Program 43(2):260–285

    Article  Google Scholar 

  33. Luk C-K, Cohn R, Muth R, Patil H, Klauser A, Lowney G, Wallace S, Reddi VJ, Hazelwood K (2005) Pin: building customized program analysis tools with dynamic instrumentation. In: Proceedings of PLDI, ACM

  34. Woo SC, Ohara M, Torrie E, Singh JP, Gupta A (1995) The splash-2 programs: characterization and methodological considerations. In: Proceedings of ISCA, ACM

  35. Bienia C, Kumar S, Singh JP, Li K (2008) The parsec benchmark suite: characterization and architectural implications. In: Proceedings of PACT, ACM

  36. Elmas T, Burnim J, Necula G, Sen K (2013) Concurrit: a domain specific language for reproducing concurrency bugs. In: Proceedings of PLDI, ACM

  37. Aget http://www.enderunix.org/aget/

  38. Apache. http://www.apache.org/

  39. cherokee. http://cherokee-project.com/

  40. Lwa. https://lwan.ws/

  41. nxweb. http://nxweb.org/

  42. pbzip2. http://compression.ca/pbzip2/

  43. pigz. http://www.zlib.net/pigz/

Download references

Acknowledgements

This work is supported by National Science Foundation of China under Grant No. 61672249 and National 973 Fundamental Basic Research Program under Grant No. 2014CB340600.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Deqing Zou.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Luo, P., Zou, D., Jin, H. et al. A dynamic predictive race detector for C/C++ programs. J Supercomput 73, 3999–4019 (2017). https://doi.org/10.1007/s11227-017-1996-8

Download citation

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s11227-017-1996-8

Keywords

Navigation