skip to main content
10.1145/2610384.2610405acmconferencesArticle/Chapter ViewAbstractPublication PagesisstaConference Proceedingsconference-collections
research-article

Runtime prevention of concurrency related type-state violations in multithreaded applications

Published: 21 July 2014 Publication History

Abstract

We propose a new method for runtime prevention of type state violations in multithreaded applications due to erroneous thread interleavings. The new method employs a combination of static and dynamic program analysis techniques to control the execution order of the method calls to suppress illegal call sequences. The legal behavior of a shared object is specified by a type-state automaton, which serves as the guidance for our method to delay certain method calls at run time. Our main contribution is a new theoretical framework for ensuring that the runtime prevention strategy is always safe, i.e., they do not introduce new erroneous interleavings. Furthermore, whenever the static program analysis is precise enough, our method guarantees to steer the program to a failurefree interleaving as long as such interleaving exists. We have implemented the new method in a tool based on the LLVM compiler framework. Our experiments on a set of multithreaded C/C++ applications show that the method is both efficient and effective in suppressing concurrency related type-state violations.

References

[1]
Matthew Arnold, Martin T. Vechev, and Eran Yahav. QVM: An efficient runtime for detecting defects in deployed systems. ACM Trans. Softw. Eng. Methodol., 21(1):2, 2011.
[2]
Pavel Avgustinov, Julian Tibble, and Oege de Moor. Making trace monitors feasible. In ACM SIGPLAN Conference on Object Oriented Programming, Systems, Languages, and Applications, pages 589–608, 2007.
[3]
E. Clarke, O. Grumberg, S. Jha, Y. Lu, and H. Veith. Counterexample-guided abstraction refinement. In Computer Aided Verification (CAV’00), pages 154–169. Springer, 2000. LNCS 1855.
[4]
Manuvir Das, Sorin Lerner, and Mark Seigle. ESP: Path-sensitive program verification in polynomial time. In ACM SIGPLAN Conference on Programming Language Design and Implementation, pages 57–68, 2002.
[5]
Robert DeLine and Manuel Fähndrich. Typestates for objects. In European Conference on Object-Oriented Programming, pages 465–490, 2004.
[6]
Xianghua Deng, Matthew B. Dwyer, John Hatcliff, and Masaaki Mizuno. Invariant-based specification, synthesis, and verification of synchronization in concurrent programs. In International Conference on Software Engineering, pages 442–452, 2002.
[7]
Jyotirmoy V. Deshmukh, G. Ramalingam, Venkatesh Prasad Ranganath, and Kapil Vaswani. Logical concurrency control from sequential proofs. In European Symposium on Programming, pages 226–245, 2010.
[8]
E. A. Emerson and E. M. Clarke. Using branching time temporal logic to synthesize synchronization skeletons. Science of Computer Programming, 2:241–266, 1982.
[9]
Jeffrey S. Foster, Robert Johnson, John Kodumal, and Alex Aiken. Flow-insensitive type qualifiers. ACM Trans. Program. Lang. Syst., 28(6):1035–1087, 2006.
[10]
Qi Gao, Wenbin Zhang, Zhezhe Chen, Mai Zheng, and Feng Qin. 2ndStrike: toward manifesting hidden concurrency typestate bugs. In International Conference on Architectural Support for Programming Languages and Operating Systems, pages 239–250, 2011.
[11]
Maurice Herlihy and Nir Shavit. The art of multiprocessor programming. Morgan Kaufmann, 2008.
[12]
G. J. Holzmann. The Spin model checker. IEEE Transactions on Software Engineering, 23:279–295, 1997.
[13]
Guoliang Jin, Linhai Song, Wei Zhang, Shan Lu, and Ben Liblit. Automated atomicity-violation fixing. In ACM SIGPLAN Conference on Programming Language Design and Implementation, pages 389–400, 2011.
[14]
Pallavi Joshi and Koushik Sen. Predictive typestate checking of multithreaded java programs. In IEEE/ACM International Conference On Automated Software Engineering, pages 288–296, 2008.
[15]
Horatiu Jula, Daniel M. Tralamazza, Cristian Zamfir, and George Candea. Deadlock immunity: Enabling systems to defend against deadlocks. In USENIX Symposium on Operating Systems Design and Implementation, pages 295–308, 2008.
[16]
Michael Kuperstein, Martin T. Vechev, and Eran Yahav. Automatic inference of memory fences. In International Conference on Formal Methods in Computer-Aided Design, pages 111–119, 2010.
[17]
Zdenek Letko, Tomás Vojnar, and Bohuslav Krena. AtomRace: data race and atomicity violation detector and healer. In Workshop on Parallel and Distributed Systems: Testing, Analysis, and Debugging, page 7. ACM, 2008.
[18]
Peng Liu and Charles Zhang. Axis: Automatically fixing atomicity violations through solving control constraints. In International Conference on Software Engineering, pages 299–309, 2012.
[19]
Shan Lu, Joseph Tucek, Feng Qin, and Yuanyuan Zhou. AVIO: detecting atomicity violations via access interleaving invariants. In Architectural Support for Programming Languages and Operating Systems, pages 37–48, 2006.
[20]
Brandon Lucia, Joseph Devietti, Luis Ceze, and Karin Strauss. Atom-Aid: Detecting and surviving atomicity violations. IEEE Micro, 29(1):73–83, 2009.
[21]
Qingzhou Luo and Grigore Rosu. EnforceMOP: a runtime property enforcement system for multithreaded programs. In International Symposium on Software Testing and Analysis, pages 156–166, 2013.
[22]
Zohar Manna and Pierre Wolper. Synthesis of communicating processes from temporal logic specifications. ACM Trans. Program. Lang. Syst., 6(1):68–93, 1984.
[23]
M. Musuvathi and S. Qadeer. CHESS: Systematic stress testing of concurrent software. In Logic-Based Program Synthesis and Transformation, pages 15–16. Springer, 2006.
[24]
Madanlal Musuvathi, Shaz Qadeer, Thomas Ball, Gérard Basler, Piramanayagam Arumuga Nainar, and Iulian Neamtiu. Finding and reproducing heisenbugs in concurrent programs. In USENIX Symposium on Operating Systems Design and Implementation, pages 267–280, 2008.
[25]
Amir Pnueli and Roni Rosner. On the synthesis of a reactive module. In ACM SIGACT-SIGPLAN Symposium on Principles of Programming Languages, pages 179–190, 1989.
[26]
Sriram K. Rajamani, G. Ramalingam, Venkatesh Prasad Ranganath, and Kapil Vaswani. ISOLATOR: dynamically ensuring isolation in comcurrent programs. In International Conference on Architectural Support for Programming Languages and Operating Systems, pages 181–192, 2009.
[27]
R. J. Ramadge and W. M. Wonham. Supervisory control of a class of discrete event processes. SIAM J. Control and Optimization, 25(1):206–230, 1987.
[28]
R. J. Ramadge and W. M. Wonham. The control of discrete event systems. Proc. of the IEEE, pages 81–98, 1989.
[29]
Paruj Ratanaworabhan, Martin Burtscher, Darko Kirovski, Benjamin G. Zorn, Rahul Nagpal, and Karthik Pattabiraman. Detecting and tolerating asymmetric races. In ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, pages 173–184, 2009.
[30]
Mahmoud Said, Chao Wang, Zijiang Yang, and Karem Sakallah. Generating data race witnesses by an SMT-based analysis. In NASA Formal Methods, pages 313–327, 2011.
[31]
Robert E. Strom and Shaula Yemini. Typestate: A programming language concept for enhancing software reliability. IEEE Trans. Software Eng., 12(1):157–171, 1986.
[32]
Martin T. Vechev, Eran Yahav, and Greta Yorsh. Inferring synchronization under limited observability. In International Conference on Tools and Algorithms for Construction and Analysis of Systems, pages 139–154, 2009.
[33]
Chao Wang and Malay Ganai. Predicting concurrency failures in generalized traces of x86 executables. In International Conference on Runtime Verification, pages 4–18, September 2011.
[34]
Chao Wang and Kevin Hoang. Precisely deciding control state reachability in concurrent traces with limited observability. In International Conference on Verification, Model Checking, and Abstract Interpretation, pages 376–394, 2014.
[35]
Chao Wang, Mahmoud Said, and Aarti Gupta. Coverage guided systematic concurrency testing. In International Conference on Software Engineering, pages 221–230, 2011.
[36]
Yin Wang, Terence Kelly, Manjunath Kudlur, Stéphane Lafortune, and Scott A. Mahlke. Gadara: Dynamic deadlock avoidance for multithreaded programs. In USENIX Symposium on Operating Systems Design and Implementation, pages 281–294, 2008.
[37]
Yin Wang, Stéphane Lafortune, Terence Kelly, Manjunath Kudlur, and Scott A. Mahlke. The theory of deadlock avoidance via discrete control. In ACM SIGACT-SIGPLAN Symposium on Principles of Programming Languages, pages 252–263, 2009.
[38]
Yin Wang, Peng Liu, Terence Kelly, Stéphane Lafortune, Spyros A. Reveliotis, and Charles Zhang. On atomicity enforcement in concurrent software via discrete event systems theory. In IEEE Conference on Decision and Control, pages 7230–7237, 2012.
[39]
Andrzej Wasylkowski and Andreas Zeller. Mining temporal specifications from object usage. In IEEE/ACM International Conference On Automated Software Engineering, pages 295–306, 2009.
[40]
Dasarath Weeratunge, Xiangyu Zhang, and Suresh Jagannathan. Accentuating the positive: atomicity inference and enforcement using correct executions. In ACM SIGPLAN Conference on Object Oriented Programming, Systems, Languages, and Applications, pages 19–34, 2011.
[41]
Jingyue Wu, Yang Tang, Gang Hu, Heming Cui, and Junfeng Yang. Sound and precise analysis of parallel programs through schedule specialization. In ACM SIGPLAN Conference on Programming Language Design and Implementation, pages 205–216, 2012.
[42]
Tuba Yavuz-Kahveci and Tevfik Bultan. Specification, verification, and synthesis of concurrency control components. In International Symposium on Software Testing and Analysis, pages 169–179, 2002.
[43]
Jie Yu and Satish Narayanasamy. A case for an interleaving constrained shared-memory multi-processor. In International Symposium on Computer Architecture, pages 325–336, 2009.
[44]
Lu Zhang, Arijit Chattopadhyay, and Chao Wang. Round-Up: Runtime checking quasi linearizability of concurrent data structures. In IEEE/ACM International Conference on Automated Software Engineering, pages 4–14, 2013.

Cited By

View all
  • (2019)Shield Synthesis for Real: Enforcing Safety in Cyber-Physical Systems2019 Formal Methods in Computer Aided Design (FMCAD)10.23919/FMCAD.2019.8894264(129-137)Online publication date: Oct-2019
  • (2016)ARROW: automated repair of races on client-side web pagesProceedings of the 25th International Symposium on Software Testing and Analysis10.1145/2931037.2931052(201-212)Online publication date: 18-Jul-2016
  • (2016)A Lightweight System for Detecting and Tolerating Concurrency BugsIEEE Transactions on Software Engineering10.1109/TSE.2016.253166642:10(899-917)Online publication date: 1-Oct-2016
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
ISSTA 2014: Proceedings of the 2014 International Symposium on Software Testing and Analysis
July 2014
460 pages
ISBN:9781450326452
DOI:10.1145/2610384
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 ACM 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]

Sponsors

In-Cooperation

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 21 July 2014

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Type state automaton
  2. failure mitigation
  3. model checking
  4. partial order reduction
  5. program repair
  6. race condition

Qualifiers

  • Research-article

Conference

ISSTA '14
Sponsor:

Acceptance Rates

Overall Acceptance Rate 58 of 213 submissions, 27%

Upcoming Conference

ISSTA '25

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)2
  • Downloads (Last 6 weeks)0
Reflects downloads up to 08 Mar 2025

Other Metrics

Citations

Cited By

View all
  • (2019)Shield Synthesis for Real: Enforcing Safety in Cyber-Physical Systems2019 Formal Methods in Computer Aided Design (FMCAD)10.23919/FMCAD.2019.8894264(129-137)Online publication date: Oct-2019
  • (2016)ARROW: automated repair of races on client-side web pagesProceedings of the 25th International Symposium on Software Testing and Analysis10.1145/2931037.2931052(201-212)Online publication date: 18-Jul-2016
  • (2016)A Lightweight System for Detecting and Tolerating Concurrency BugsIEEE Transactions on Software Engineering10.1109/TSE.2016.253166642:10(899-917)Online publication date: 1-Oct-2016
  • (2016)Verifying a quantitative relaxation of linearizability via refinementInternational Journal on Software Tools for Technology Transfer (STTT)10.1007/s10009-015-0373-218:4(393-407)Online publication date: 1-Aug-2016
  • (2016)Robot-assisted 3D printing of biopolymer thin shellsThe International Journal of Advanced Manufacturing Technology10.1007/s00170-016-9134-y89:1-4(957-968)Online publication date: 15-Jul-2016
  • (2016)Synthesizing Runtime Enforcer of Safety Properties Under Burst ErrorProceedings of the 8th International Symposium on NASA Formal Methods - Volume 969010.1007/978-3-319-40648-0_6(65-81)Online publication date: 7-Jun-2016
  • (2015)ConcBugAssist: constraint solving for diagnosis and repair of concurrency bugsProceedings of the 2015 International Symposium on Software Testing and Analysis10.1145/2771783.2771798(165-176)Online publication date: 13-Jul-2015
  • (2014)Grail: context-aware fixing of concurrency bugsProceedings of the 22nd ACM SIGSOFT International Symposium on Foundations of Software Engineering10.1145/2635868.2635881(318-329)Online publication date: 11-Nov-2014

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media