Advertisement

International Journal of Parallel Programming

, Volume 43, Issue 4, pp 656–678 | Cite as

Detection of High-Level Synchronization Anomalies in Parallel Programs

  • Ali JannesariEmail author
Article

Abstract

In parallel programs concurrency bugs are often caused by unsynchronized accesses to shared memory locations, which are called data races. In order to support programmers in writing correct parallel programs, it is therefore highly desired to have tools on hand that automatically detect such data races. Today, most of these tools only consider unsynchronized read and write operations on a single memory location. Concurrency bugs that involve multiple accesses on a set of correlated variables may be completely missed. Tools may overwhelm programmers with data races on various memory locations, without noticing that the locations are correlated. In this paper, we propose a novel approach to data race detection that automatically infers sets of correlated variables and logical operations by analyzing data and control dependencies. We develop an algorithm that is inspired by lockset analysis and combine it with happens-before analysis to provide the first hybrid, dynamic race detector for correlated variables. We implemented our approach on top of the Valgrind, a framework for dynamic binary instrumentation. Our evaluation confirmed that we can catch data races missed by existing detectors and provide additional information for effective bug fixing.

Keywords

Data race detection Parallel programs Dynamic analysis Correlated variables High-level data races 

References

  1. 1.
    Lu, S., Park, S., Seo, E., Zhou, Y.: Learning from mistakes: a comprehensive study on real world concurrency bug characteristics. In: ASPLOS XIII: Proceedings of the 13th International Conference on Architectural Support for Programming Languages and Operating Systems. ACM, New York, NY, USA, pp. 329–339 (2008). doi: 10.1145/1346281.1346323
  2. 2.
    Netzer, R.H.B., Miller, B.P.: What are race conditions? Some issues and formalizations. ACM Lett. Program. Lang. Syst. 1(1), 74–88 (1992). doi: 10.1145/130616.130623 CrossRefGoogle Scholar
  3. 3.
    Raza, A.: A review of race detection mechanisms. In: Grigoriev, D., Harrison, J., Hirsch, E.A. (eds.) CSR, Vol. 3967 of Lecture Notes in Computer Science. Springer, Berlin, pp. 534–543 (2006)Google Scholar
  4. 4.
    Savage, S., Burrows, M., Nelson, G., Sobalvarro, P., Anderson, T.: Eraser : a dynamic data race detector for multithreaded programs. ACM Trans. Comput. Syst. 15(4), 391–411 (1997). doi: 10.1145/265924.265927 CrossRefGoogle Scholar
  5. 5.
    Dinning, A., Schonberg, E.: Detecting access anomalies in programs with critical sections. SIGPLAN Not. 26(12), 85–96 (1991). doi: 10.1145/127695.122767 CrossRefGoogle Scholar
  6. 6.
    Jannesari, A., Tichy, W.F.: Library-independent data race detection. IEEE Trans. Parallel Distrib. Syst. PP(99), 1–13 (2013). doi: 10.1109/TPDS.2013.209 Google Scholar
  7. 7.
    Jannesari, A., Tichy, W.: Identifying ad-hoc synchronization for enhanced race detection. In: 2010 IEEE International Symposium on Parallel Distributed Processing (IPDPS), pp. 1–10 (2010). doi: 10.1109/IPDPS.2010.5470343
  8. 8.
    Jannesari, A., Bao, K., Pankratius, V., Tichy, W. F., Helgrind+: an efficient dynamic race detector. In: Parallel and Distributed Processing Symposium, International 0, pp. 1–13 (2009). doi: 10.1109/IPDPS.2009.5160998
  9. 9.
    Jannesari, A., Tichy, W.F.: On-the-fly race detection in multi-threaded programs. In: PADTAD ’08: Proceedings of the 6th Workshop on Parallel and Distributed Systems, ACM, New York, NY, USA, pp. 1–10 (2008). doi: 10.1145/1390841.1390847
  10. 10.
    Harrow, J.J.: Runtime checking of multithreaded applications with visual threads. In: Proceedings of the 7th International SPIN Workshop on SPIN Model Checking and Software Verification, pp. 331–342. Springer, London (2000). http://citeseer.ist.psu.edu/harrow00runtime.html
  11. 11.
    Pozniansky, E., Schuster, A.: Multirace: efficient on-the-fly data race detection in multithreaded c++ programs: research articles. Concurr. Comput. Pract. Exp. 19(3), 327–340 (2007). doi: 10.1002/cpe.v19:3 CrossRefGoogle Scholar
  12. 12.
    Yu, Y., Rodeheffer, T., Chen, W.: Racetrack: efficient detection of data race conditions via adaptive tracking. SIGOPS Oper. Syst. Rev. 39(5), 221–234 (2005). doi: 10.1145/1095809.1095832 CrossRefGoogle Scholar
  13. 13.
    Hammer, C., Dolby, J., Vaziri, M., Tip, F.: Dynamic detection of atomic-set-serializability violations. In: ICSE ’08: Proceedings of the 30th International Conference on Software Engineering, ACM, New York, NY, USA, pp. 231–240 (2008) doi: 10.1145/1368088.1368120
  14. 14.
    Vaziri, M., Tip, F., Dolby, J.: Associating synchronization constraints with data in an object-oriented language. In: POPL ’06: Conference Record of the 33rd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, ACM, New York, NY, USA, pp. 334–345 (2006). doi: 10.1145/1111037.1111067
  15. 15.
    Bernstein, P.A., Hadzilacos, V., Goodman, N.: Concurrency Control and Recovery in Database Systems. Addison-Wesley, Reading (1987)Google Scholar
  16. 16.
    Lu, S., Park, S., Hu, C., Ma, X., Jiang, W., Li, Z., Popa, R.A., Zhou, Y.: Muvi: automatically inferring multi-variable access correlations and detecting related semantic and concurrency bugs. In: SOSP ’07: Proceedings of Twenty-first ACM SIGOPS Symposium on Operating Systems Principles, ACM, New York, NY, USA, pp. 103–116 (2007). doi: 10.1145/1294261.1294272
  17. 17.
    Xu, M., Bodík, R., Hill, M.D.: A serializability violation detector for shared-memory server programs. SIGPLAN Not. 40(6), 1–14 (2005). doi: 10.1145/1064978.1065013 CrossRefGoogle Scholar
  18. 18.
    Collins, J.D.,Tullsen, D.M., Wang, H.: Control flow optimization via dynamic reconvergence prediction. In: MICRO 37: Proceedings of the 37th Annual IEEE/ACM International Symposium on Microarchitecture, IEEE Computer Society, Washington, DC, USA, pp. 129–140 (2004). doi: 10.1109/MICRO.2004.13
  19. 19.
    Lamport, L.: Time, clocks, and the ordering of events in a distributed system. Commun. ACM 21(7), 558–565 (1978). doi: 10.1145/359545.359563 CrossRefzbMATHGoogle Scholar
  20. 20.
    Nethercote, N., Seward, J.: Valgrind: a framework for heavyweight dynamic binary instrumentation. SIGPLAN Not. 42(6), 89–100 (2007). doi: 10.1145/1273442.1250746 CrossRefGoogle Scholar
  21. 21.
    Nethercote, N., Seward, J.: Valgrind: a program supervision framework. http://valgrind.org/
  22. 22.
    Butenhof, D.R.: Programming with POSIX Threads. Professional Computing Series. Addison-Wesley, Reading (1997)Google Scholar
  23. 23.
    Apache http server project, http://www.apache.org/
  24. 24.
    Data-race-test: a test suite for data race detectors. http://code.google.com/p/data-race-test/
  25. 25.
    Butler, N.: Petridish: Multi-threading for performance in c#. http://www.codeproject.com/Articles/26453/PetriDish-Multi-threading-for-performance-in-C
  26. 26.
    Reichl, D.: Keepass password safe. http://keepass.info/
  27. 27.
  28. 28.
    Microsoft, Code gallery for parallel programs. http://code.msdn.microsoft.com/Samples-for-Parallel-b4b76364
  29. 29.
  30. 30.
    Kim, M., Kim, H., Luk, C.-K.: Sd3: A scalable approach to dynamic data-dependence profiling. In: Proceedings of the 2010 43rd Annual IEEE/ACM International Symposium on Microarchitecture, MICRO ’43, IEEE Computer Society, Washington, DC, USA, pp. 535–546 (2010). doi: 10.1109/MICRO.2010.49
  31. 31.
    Li, Z., Jannesari, A., Wolf, F.: Discovery of potential parallelism in sequential programs. In: Proceedings of the 42nd International Conference on Parallel Processing. PSTI ’13, Washington, DC, USA, IEEE Computer Society, pp. 1004–1013 (2013)Google Scholar

Copyright information

© Springer Science+Business Media New York 2014

Authors and Affiliations

  1. 1.German Research School for Simulation SciencesAachenGermany
  2. 2.RWTH Aachen UniversityAachenGermany

Personalised recommendations