Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
research-article
Open access

Automated Classification of Data Races Under Both Strong and Weak Memory Models

Published: 22 May 2015 Publication History

Abstract

Data races are one of the main causes of concurrency problems in multithreaded programs. Whether all data races are bad, or some are harmful and others are harmless, is still the subject of vigorous scientific debate [Narayanasamy et al. 2007; Boehm 2012]. What is clear, however, is that today's code has many data races [Kasikci et al. 2012; Jin et al. 2012; Erickson et al. 2010], and fixing data races without introducing bugs is time consuming [Godefroid and Nagappan 2008]. Therefore, it is important to efficiently identify data races in code and understand their consequences to prioritize their resolution.
We present Portend+, a tool that not only detects races but also automatically classifies them based on their potential consequences: Could they lead to crashes or hangs? Could their effects be visible outside the program? Do they appear to be harmless? How do their effects change under weak memory models? Our proposed technique achieves high accuracy by efficiently analyzing multiple paths and multiple thread schedules in combination, and by performing symbolic comparison between program outputs.
We ran Portend+ on seven real-world applications: it detected 93 true data races and correctly classified 92 of them, with no human effort. Six of them were harmful races. Portend+'s classification accuracy is up to 89% higher than that of existing tools, and it produces easy-to-understand evidence of the consequences of “harmful” races, thus both proving their harmfulness and making debugging easier. We envision Portend+ being used for testing and debugging, as well as for automatically triaging bug reports.

References

[1]
Sarita V. Adve and Mark D. Hill. 1990. Weak ordering-a new definition. Computer Architecture News 18, 2, 2--14.
[2]
Associated Press. 2004. GE Acknowledges Blackout Bug. Retrieved April 2, 2015, from http://www.securityfocus.com/news/8032.
[3]
Mohamed Faouzi Atig, Ahmed Bouajjani, Sebastian Burckhardt, and Madanlal Musuvathi. 2010. On the verification problem for weak memory models. In Proceeedings of the Symposium on Principles of Programming Languages.
[4]
Amittai Aviram, Shu-Chun Weng, Sen Hu, and Bryan Ford. 2010. Efficient system-enforced deterministic parallelism. In Proceedings of the Symposium on Operating Systems Design and Implementation.
[5]
Domagoj Babic and Alan J. Hu. 2008. Calysto: Scalable and precise extended static checking. In Proceedings of the 30th International Conference on Software Engineering.
[6]
Tom Bergan, Joseph Devietti and Luis Ceze. 2011. The deterministic execution hammer: How well does it actually pound nails? In Proceedings of the Workshop on Determinism and Correctness in Parallel Programming.
[7]
Tom Bergan, Owen Anderson, Joseph Devietti, Luis Ceze, and Dan Grossman. 2010. CoreDet: A compiler and runtime system for deterministic multithreaded execution. In Proceedings of the International Conference on Architectural Support for Programming Languages and Operating Systems.
[8]
Robert L. Bocchino Jr., Vikram S. Adve, Danny Dig, Sarita V. Adve, Stephen Heumann, Rakesh Komuravelli, Jeffrey Overbey, Patrick Simmons, Hyojin Sung, and Mohsen Vakilian. 2009. A type and effect system for deterministic parallel Java. In Proceedings of the 24th ACM SIGPLAN Conference on Object Oriented Programming Systems Languages and Applications (OOPSLA’09).
[9]
Hans-J. Boehm. 2007. Reordering constraints for pthread-style locks. In Proceedings of the 12th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming (PPoPP’07).
[10]
Hans-J. Boehm. 2011. How to miscompile programs with “benign” data races. In Proceedings of the USENIX Workshop on Hot Topics in Parallelism.
[11]
Hans-J. Boehm. 2012. Position paper: Nondeterminism is unavoidable, but data races are pure evil. In Proceedings of the ACM Workshop on Relaxing Synchronization for Multicore and Manycore Scalability (RACES’12).
[12]
Hans-J. Boehm and Sarita V. Adve. 2012. You don’t know jack about shared variables or memory models. Communications of the ACM 55, 2, 48--54.
[13]
Michael D. Bond, Katherine E. Coons, and Kathryn S. McKinley. 2010. PACER: Proportional detection of data races. In Proceedings of the International Conference on Programming Language Design and Implementation.
[14]
Stefan Bucur, Vlad Ureche, Cristian Zamfir, and George Candea. 2011. Parallel symbolic execution for automated real-world software testing. In Proceedings of the ACM EuroSys European Conference on Computer Systems.
[15]
Sebastian Burckhardt, Rajeev Alur, and Milo M. K. Martin. 2006. Bounded model checking of concurrent data types on relaxed memory models: A case study. In Proceedings of the International Conference on Computer Aided Verification.
[16]
Cristian Cadar, Daniel Dunbar, and Dawson R. Engler. 2008. KLEE: Unassisted and automatic generation of high-coverage tests for complex systems programs. In Proceedings of the Symposium on Operating Systems Design and Implementation.
[17]
George Candea, Stefan Bucur, Vitaly Chipounov, Vova Kuznetsov, and Cristian Zamfir. 2010. Automated software reliability services: Using reliability tools should be as easy as Webmail. In Proceedings of the Symposium on Operating Systems Design and Implementation.
[18]
Luis Ceze, James Tuck, Pablo Montesinos, and Josep Torrellas. 2007. BulkSC: Bulk enforcement of sequential consistency. In Proceedings of the International Symposium on Computer Architecture.
[19]
Vitaly Chipounov and George Candea. 2011. Enabling sophisticated analyses of x86 binaries with RevGen. In Proceedings of the IEEE/IFIP 41st International Conference on Dependable Systems and Networks.
[20]
Heming Cui, Jingyue Wu, Chia Che Tsai, and Junfeng Yang. 2010. Stable deterministic multithreading through schedule memoization. In Proceedings of the Symposium on Operating Systems Design and Implementation.
[21]
Joseph Devietti, Brandon Lucia, Luis Ceze, and Mark Oskin. 2009. DMP: Deterministic shared memory multiprocessing. In Proceedings of the International Conference on Architectural Support for Programming Languages and Operating Systems.
[22]
Michel Dubois, Christoph Scheurich, and Faye Briggs. 1986. Memory access buffering in multiprocessors. In Proceedings of the 13th Annual International Symposium on Computer Architecture.
[23]
Dawson Engler and Ken Ashcraft. 2003. RacerX: Effective, static detection of race conditions and deadlocks. In Proceedings of the Symposium on Operating Systems Principles.
[24]
John Erickson, Madanlal Musuvathi, Sebastian Burckhardt, and Kirk Olynyk. 2010. Effective data-race detection for the kernel. In Proceedings of the Symposium on Operating System Design and Implementation (OSDI’10).
[25]
Brad Fitzpatrick. 2013. Memcached Home Page. Retrieved April 2, 2015, from http://memcached.org.
[26]
Cormac Flanagan and Stephen N. Freund. 2009. FastTrack: Efficient and precise dynamic race detection. In Proceedings of the International Conference on Programming Language Design and Implementation.
[27]
Cormac Flanagan and Stephen N. Freund. 2010. Adversarial memory for detecting destructive races. In Proceedings of the International Conference on Programming Language Design and Implementation.
[28]
Pedro Fonseca, Cheng Li, and Rodrigo Rodrigues. 2011. Finding complex concurrency bugs in large multi-threaded applications. In Proceedings of the ACM EuroSys European Conference on Computer Systems.
[29]
Vijay Ganesh and David L. Dill. 2007. A decision procedure for bit-vectors and arrays. In Proceedings of the International Conference on Computer Aided Verification.
[30]
Jeff Gilchrist. 2013. Parallel BZIP2 (PBZIP2). Retrieved April 2, 2015, from http://compression.ca/pbzip2.
[31]
Kirk Glerum, Kinshuman Kinshumann, Steve Greenberg, Gabriel Aul, Vince Orgovan, Greg Nichols, David Grant, Gretchen Loihle, and Galen Hunt. 2009. Debugging in the (very) large: Ten years of implementation and experience. In Proceedings of the Symposium on Operating Systems Principles.
[32]
Patrice Godefroid, Nils Klarlund, and Koushik Sen. 2005. DART: Directed automated random testing. In Proceedings of the International Conference on Programming Language Design and Implementation.
[33]
Patrice Godefroid, Michael Y. Levin, and David Molnar. 2008. Automated whitebox fuzz testing. In Proceedings of the Network and Distributed System Security Symposium.
[34]
Patrice Godefroid and Nachiappan Nagappan. 2008. Concurrency at Microsoft—an exploratory survey. In Proceedings of the International Conference on Computer Aided Verification.
[35]
Steven Hand. 2012. An experiment in determinism. Communications of the ACM 55, 5, 110.
[36]
Helgrind. 2012. Helgrind Home Page. Retrieved April 2, 2015, from http://valgrind.org/docs/manual/hg-manual.html.
[37]
Intel Corp. 2012. Parallel Inspector. Retrieved April 2, 2015, from https://software.intel.com/en-us/intel-inspector-xe.
[38]
ISO14882. 2011. ISO/IEC 14882:2011: Information Technology—Programming languages—C++. International Organization for Standardization, London, UK.
[39]
ISO9899. 2011. ISO/IEC 9899:2011: Information Technology—Programming Languages—C. International Organization for Standardization, London, UK.
[40]
Ali Jannesari and Walter F. Tichy. 2010. Identifying ad-hoc synchronization for enhanced race detection. In Proceedings of the International Parallel and Distributed Processing Symposium.
[41]
Guoliang Jin, Wei Zhang, Dongdong Deng, Ben Liblit, and Shan Lu. 2012. Automated concurrency-bug fixing. In Proceedings of the Symposium on Operating Systems Design and Implementation.
[42]
Vineet Kahlon, Franjo Ivančić, and Aarti Gupta. 2005. Reasoning about threads communicating via locks. In Proceedings of the International Conference on Computer Aided Verification.
[43]
Baris Kasikci, Cristian Zamfir, and George Candea. 2012. Data races vs. data race bugs: Telling the difference with Portend. In Proceedings of the International Conference on Architectural Support for Programming Languages and Operating Systems.
[44]
Leslie Lamport. 1978. Time, clocks, and the ordering of events in a distributed system. Communications of the ACM 21, 7, 558--565.
[45]
Chris Lattner. 2012. “libc++” C++ Standard Library. Retrieved April 2, 2015, from http://libcxx.llvm.org/.
[46]
Chris Lattner and Vikram Adve. 2004. LLVM: A compilation framework for lifelong program analysis and transformation. In Proceedings of the International Symposium on Code Generation and Optimization.
[47]
Henry Ledgard. 1983. Reference Manual for the ADA Programming Language. Springer-Verlag, New York, NY.
[48]
Nancy G. Leveson and Clark S. Turner. 1993. An investigation of the Therac-25 accidents. IEEE Computer 26, 7, 18--41.
[49]
Tongping Liu, Charlie Curtsinger, and Emery D. Berger. 2011. Dthreads: Efficient deterministic multithreading. In Proceedings of the Symposium on Operating Systems Principles.
[50]
Shan Lu, Joseph Tucek, Feng Qin, and Yuanyuan Zhou. 2006. AVIO: Detecting atomicity violations via access interleaving invariants. In Proceedings of the International Conference on Architectural Support for Programming Languages and Operating Systems.
[51]
Jeremy Manson, William Pugh, and Sarita V. Adve. 2005. The Java memory model. In Proceedings of the Symposium on Principles of Programming Languages.
[52]
Daniel Marino, Madanlal Musuvathi, and Satish Narayanasamy. 2009. LiteRace: Effective sampling for lightweight data-race detection. In Proceedings of the International Conference on Programming Language Design and Implementation.
[53]
Cal McPherson. 2012. Ctrace Home Page. Retrieved April 2, 2015, from http://ctrace.sourceforge.net.
[54]
John Mellor-Crummey. 1991. On-the-fly detection of data races for programs with nested fork-join parallelism. In Proceedings of the ACM/IEEE Conference on Supercomputing (Supercomputing’91).
[55]
Memcached. 2009. Issue 127: INCR/DECR Operations Are Not Thread Safe. Retrieved April 2, 2015, from http://code.google.com/p/memcached/issues/detail?id_127.
[56]
Sang L. Min and Jong-Deok Choi. 1991. An efficient cache-based access anomaly detection scheme. In Proceedings of the International Conference on Architectural Support for Programming Languages and Operating Systems.
[57]
Madanlal Musuvathi, Sebastian Burckhardt, Pravesh Kothari, and Santosh Nagarakatte. 2010. A randomized scheduler with probabilistic guarantees of finding bugs. In Proceedings of the International Conference on Architectural Support for Programming Languages and Operating Systems.
[58]
Madanlal Musuvathi, Shaz Qadeer, Thomas Ball, Gérard Basler, Piramanayagam Arumuga Nainar, and Iulian Neamtiu. 2008. Finding and reproducing heisenbugs in concurrent programs. In Proceedings of the Symposium on Operating Systems Design and Implementation.
[59]
Satish Narayanasamy, Zhenghao Wang, Jordan Tigani, Andrew Edwards, and Brad Calder. 2007. Automatically classifying benign and harmful data races using replay analysis. In Proceedings of the International Conference on Programming Language Design and Implementation.
[60]
Adrian Nistor, Darko Marinov, and Josep Torrellas. 2009. Light64: Lightweight hardware support for data race detection during systematic testing of parallel programs. In Proceedings of the IEEE/ACM International Symposium on Microarchitecture (MICRO-42).
[61]
Robert O’Callahan and Jong-Deok Choi. 2003. Hybrid dynamic data race detection. In Proceedings of the Symposium on Principles and Practice of Parallel Computing.
[62]
Milos Prvulovic and Josep Torrellas. 2003. ReEnact: Using thread-level speculation mechanisms to debug data races in multithreaded codes. In Proceedings of the 30th Annual International Symposium on Computer Architecture (ISCA’03).
[63]
Stefan Savage, Michael Burrows, Greg Nelson, Patrick Sobalvarro, and Thomas Anderson. 1997. Eraser: A dynamic data race detector for multithreaded programs. ACM Transactions on Computer Systems 15, 4, 391--411.
[64]
Edith Schonberg. 2004. On-the-fly detection of access anomalies (with retrospective). ACM SIGPLAN Notices 39, 4, 313--327.
[65]
Koushik Sen. 2008. Race directed random testing of concurrent programs. In Proceedings of the International Conference on Programming Language Design and Implementation.
[66]
Koushik Sen, Darko Marinov, and Gul Agha. 2005. CUTE: A concolic unit testing engine for C. In Proceedings of the Symposium on the Foundations of Software Engineering.
[67]
Konstantin Serebryany and Timur Iskhodzhanov. 2009. ThreadSanitizer—data race detection in practice. In Proceedings of the Workshop on Binary Instrumentation and Applications.
[68]
Richard L. Sites (Ed.). 1992. Alpha Architecture Reference Manual. Digital Press.
[69]
Yannis Smaragdakis, Jacob Evans, Caitlin Sadowski, Jaeheon Yi, and Cormac Flanagan. 2012. Sound predictive race detection in polynomial time. ACM SIGPLAN Notices 47, 1, 387--400.
[70]
SQLite. 2013. SQLite Home Page. Retrieved April 2, 2015, from http://www.sqlite.org/.
[71]
William Thies, Michal Karczmarek, and Saman P. Amarasinghe. 2002. StreamIt: A language for streaming applications. In Proceedings of the 11th International Conference on Compiler Construction (CC’02).
[72]
Chen Tian, Vijay Nagarajan, Rajiv Gupta, and Sriraman Tallam. 2008. Dynamic recognition of synchronization operations for improved data race detection. In Proceedings of the International Symposium on Software Testing and Analysis.
[73]
Kaushik Veeraraghavan, Peter M. Chen, Jason Flinn, and Satish Narayanasamy. 2011. Detecting and surviving data races using complementary schedules. In Proceedings of the Symposium on Operating Systems Principles.
[74]
Jan Wen Voung, Ranjit Jhala, and Sorin Lerner. 2007. RELAY: Static race detection on millions of lines of code. In Proceedings of the Symposium on the Foundations of Software Engineering.
[75]
David L. Weaver and Tom Germond (Eds.). 1994. The SPARC Architecture Manual, Version 9. Prentice Hall.
[76]
Steven Cameron Woo, Moriyoshi Ohara, Evan Torrie, Jaswinder Pal Singh, and Anoop Gupta. 1995. The SPLASH-2 programs: Characterization and methodological considerations. In Proceedings of the International Symposium on Computer Architecture.
[77]
Jingyue Wu, Heming Cui, and Junfeng Yang. 2010. Bypassing races in live applications with execution filters. In Proceedings of the Symposium on Operating Systems Design and Implementation.
[78]
Weiwei Xiong, Soyeon Park, Jiaqi Zhang, Yuanyuan Zhou, and Zhiqiang Ma. 2010. Ad-hoc synchronization considered harmful. In Proceedings of the Symposium on Operating Systems Design and Implementation.
[79]
Yu Yang, Xiaofang Chen, Ganesh Gopalakrishnan, and Robert M. Kirby. 2007. Distributed dynamic partial order reduction based verification of threaded software. In Proceedings of the International SPIN Workshop.
[80]
Yuan Yu, Tom Rodeheffer, and Wei Chen. 2005. RaceTrack: Efficient detection of data race conditions via adaptive tracking. In Proceedings of the Symposium on Operating Systems Principles.
[81]
Cristian Zamfir and George Candea. 2010. Execution synthesis: A technique for automated debugging. In Proceedings of the ACM EuroSys European Conference on Computer Systems.
[82]
Jiaqi Zhang, Weiwei Xiong, Yang Liu, Soyeon Park, Yuanyuan Zhou, and Zhiqiang Ma. 2011. ATDetector: Improving the accuracy of a commercial data race detector by identifying address transfer. In Proceedings of the IEEE/ACM International Symposium on Microarchitecture.

Cited By

View all
  • (2024)Versatile Binary-Level Concolic TestingHandbook of Computer Architecture10.1007/978-981-97-9314-3_40(1365-1388)Online publication date: 21-Dec-2024
  • (2022)Versatile Binary-Level Concolic TestingHandbook of Computer Architecture10.1007/978-981-15-6401-7_40-1(1-24)Online publication date: 19-May-2022
  • (2021)Execution reconstruction: harnessing failure reoccurrences for failure reproductionProceedings of the 42nd ACM SIGPLAN International Conference on Programming Language Design and Implementation10.1145/3453483.3454101(1155-1170)Online publication date: 19-Jun-2021
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Transactions on Programming Languages and Systems
ACM Transactions on Programming Languages and Systems  Volume 37, Issue 3
June 2015
134 pages
ISSN:0164-0925
EISSN:1558-4593
DOI:10.1145/2785583
Issue’s Table of Contents
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 22 May 2015
Accepted: 01 February 2015
Revised: 01 December 2014
Received: 01 February 2013
Published in TOPLAS Volume 37, Issue 3

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Data races
  2. concurrency
  3. symbolic execution
  4. triage

Qualifiers

  • Research-article
  • Research
  • Refereed

Funding Sources

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)92
  • Downloads (Last 6 weeks)16
Reflects downloads up to 24 Dec 2024

Other Metrics

Citations

Cited By

View all
  • (2024)Versatile Binary-Level Concolic TestingHandbook of Computer Architecture10.1007/978-981-97-9314-3_40(1365-1388)Online publication date: 21-Dec-2024
  • (2022)Versatile Binary-Level Concolic TestingHandbook of Computer Architecture10.1007/978-981-15-6401-7_40-1(1-24)Online publication date: 19-May-2022
  • (2021)Execution reconstruction: harnessing failure reoccurrences for failure reproductionProceedings of the 42nd ACM SIGPLAN International Conference on Programming Language Design and Implementation10.1145/3453483.3454101(1155-1170)Online publication date: 19-Jun-2021
  • (2020)Approach to Data Race Detection Based on Petri Nets with Additional Semantic Relations2020 ELEKTRO10.1109/ELEKTRO49696.2020.9130252(1-5)Online publication date: May-2020
  • (2019)Empirical research on concurrent software testing: A systematic mapping studyInformation and Software Technology10.1016/j.infsof.2018.08.017105(226-251)Online publication date: Jan-2019
  • (2019)RaceTestService Oriented Computing and Applications10.1007/s11761-019-00261-113:2(141-154)Online publication date: 1-Jun-2019
  • (2018)High-coverage, unbounded sound predictive race detectionACM SIGPLAN Notices10.1145/3296979.319238553:4(374-389)Online publication date: 11-Jun-2018
  • (2018)High-coverage, unbounded sound predictive race detectionProceedings of the 39th ACM SIGPLAN Conference on Programming Language Design and Implementation10.1145/3192366.3192385(374-389)Online publication date: 11-Jun-2018
  • (2018)A systematic survey on automated concurrency bug detection, exposing, avoidance, and fixing techniquesSoftware Quality Journal10.1007/s11219-017-9385-326:3(855-889)Online publication date: 1-Sep-2018
  • (2017)Lazy Diagnosis of In-Production Concurrency BugsProceedings of the 26th Symposium on Operating Systems Principles10.1145/3132747.3132767(582-598)Online publication date: 14-Oct-2017
  • Show More Cited By

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Login options

Full Access

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media