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.
Similar content being viewed by others
Notes
For example by mutual exclusion using locks or by enforcement of a specific order through signal/wait.
An operation \(op_1\) has a true data dependency on an operation \(op_2\), if \(op_1\) reads a value that was last written by \(op_2\).
Helgrind\(^+\)is available at https://svn.ipd.kit.edu/trac/helgrindplus/wiki.
References
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
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
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)
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
Dinning, A., Schonberg, E.: Detecting access anomalies in programs with critical sections. SIGPLAN Not. 26(12), 85–96 (1991). doi:10.1145/127695.122767
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
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
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
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
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
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
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
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
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
Bernstein, P.A., Hadzilacos, V., Goodman, N.: Concurrency Control and Recovery in Database Systems. Addison-Wesley, Reading (1987)
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
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
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
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
Nethercote, N., Seward, J.: Valgrind: a framework for heavyweight dynamic binary instrumentation. SIGPLAN Not. 42(6), 89–100 (2007). doi:10.1145/1273442.1250746
Nethercote, N., Seward, J.: Valgrind: a program supervision framework. http://valgrind.org/
Butenhof, D.R.: Programming with POSIX Threads. Professional Computing Series. Addison-Wesley, Reading (1997)
Apache http server project, http://www.apache.org/
Data-race-test: a test suite for data race detectors. http://code.google.com/p/data-race-test/
Butler, N.: Petridish: Multi-threading for performance in c#. http://www.codeproject.com/Articles/26453/PetriDish-Multi-threading-for-performance-in-C
Reichl, D.: Keepass password safe. http://keepass.info/
Smart thread pool. http://smartthreadpool.codeplex.com/
Microsoft, Code gallery for parallel programs. http://code.msdn.microsoft.com/Samples-for-Parallel-b4b76364
Intel inspector xe 2013. http://software.intel.com/en-us/intel-inspector-xe
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
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)
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
About this article
Cite this article
Jannesari, A. Detection of High-Level Synchronization Anomalies in Parallel Programs. Int J Parallel Prog 43, 656–678 (2015). https://doi.org/10.1007/s10766-014-0313-x
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10766-014-0313-x