Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/2635868.2635881acmconferencesArticle/Chapter ViewAbstractPublication PagesfseConference Proceedingsconference-collections
research-article

Grail: context-aware fixing of concurrency bugs

Published: 11 November 2014 Publication History

Abstract

Writing efficient synchronization for multithreaded programs is notoriously hard. The resulting code often contains subtle concurrency bugs. Even worse, many bug fixes introduce new bugs. A classic example, seen widely in practice, is deadlocks resulting from fixing of an atomicity violation. These complexities have motivated the development of automated fixing techniques. Current techniques generate fixes that are typically conservative, giving up on available parallelism. Moreover, some of the techniques cannot guarantee the correctness of a fix, and may introduce deadlocks similarly to manual fix, whereas techniques that ensure correctness do so at the expense of even greater performance loss. We present Grail, a novel fixing algorithm that departs from previous techniques by simultaneously providing both correctness and optimality guarantees. Grail synthesizes bug-free yet optimal lock-based synchronization. To achieve this, Grail builds an analysis model of the buggy code that is both contextual, distinguishing different aliasing contexts to ensure efficiency, and global, accounting for the entire synchronization behavior of the involved threads to ensure correctness. Evaluation of Grail on 12 bugs from popular codebases confirms its practical advantages, especially compared with existing techniques: Grail patches are, in general, >=40% more efficient than the patches produced by other techniques, and incur only 2% overhead.

References

[1]
Y. Cai and W. K. Chan. Magicfuzzer: Scalable deadlock detection for large-scale applications. In ICSE, 2012.
[2]
Y. Cai, W. Chan, and Y. Yu. Taming deadlocks in multithreaded programs. In QSIC, 2013.
[3]
S. Cherem, T. M. Chilimbi, and S. Gulwani. Inferring locks for atomic sections. In PLDI, 2008.
[4]
L. Chew and D. Lie. Kivati: Fast detection and prevention of atomicity violations. In EuroSys, 2010.
[5]
N. D’Ippolito, V. Braberman, N. Piterman, and S. Uchitel. Synthesising non-anomalous event-based controllers for liveness goals. TOSEM, 22(1), 2013.
[6]
A. Farzan and P. Madhusudan. Causal atomicity. In CAV, 2006.
[7]
D. Gopinath, M. Z. Malik, and S. Khurshid. Specification-based program repair using sat. In TACAS, 2011.
[8]
M. Herlihy and E. Koskinen. Transactional boosting: a methodology for highly-concurrent transactional objects. In PPoPP, 2008.
[9]
J. Huang and C. Zhang. Persuasive prediction of concurrency access anomalies. In ISSTA, 2011.
[10]
J. Huang, P. Liu, and C. Zhang. Leap: Lightweight deterministic multi-processor replay of concurrent java programs. In FSE, 2010.
[11]
G. Jin, L. Song, W. Zhang, S. Lu, and B. Liblit. Automated atomicity-violation fixing. In PLDI, 2011.
[12]
G. Jin, W. Zhang, D. Deng, B. Liblit, and S. Lu. Automated concurrency-bug fixing. In OSDI, 2012.
[13]
P. Joshi, C. seo Park, K. Sen, and M. Naik. A randomized dynamic program analysis technique for detecting real deadlocks. In PLDI, pages 110–120, 2009.
[14]
P. Joshi, M. Naik, K. Sen, and D. Gay. An effective dynamic analysis for detecting generalized deadlocks. In FSE, 2010.
[15]
H. Jula, D. M. Tralamazza, C. Zamfir, and G. Candea. Deadlock immunity: Enabling systems to defend against deadlocks. In OSDI, 2008.
[16]
V. Kahlon and C. Wang. Universal causality graphs: A precise happens-before model for detecting bugs in concurrent programs. In CAV, 2010.
[17]
M. Kulkarni, D. Nguyen, D. Prountzos, X. Sui, and K. Pingali. Exploiting the commutativity lattice. In PLDI, 2011.
[18]
D. Li, W. Srisa-an, and M. B. Dwyer. Sos: Saving time in dynamic race detection with stationary analysis. In OOPSLA, 2011.
[19]
P. Liu and C. Zhang. Axis: Automatically fixing atomicity violations through solving control constraints. In ICSE, 2012.
[20]
P. Liu, J. Dolby, and C. Zhang. Finding incorrect compositions of atomicity. In ESEC/FSE, 2013.
[21]
S. Lu, S. Park, E. Seo, and Y. Zhou. Learning from mistakes: a comprehensive study on real world concurrency bug characteristics. In ASPLOS, 2008.
[22]
B. Lucia, B. P. Wood, and L. Ceze. Isolating and understanding concurrency errors using reconstructed execution fragments. In PLDI, 2011.
[23]
Q. Luo and G. Ro¸su. Enforcemop: A runtime property enforcement system for multithreaded programs. In ISSTA, 2013.
[24]
B. McCloskey, F. Zhou, D. Gay, and E. Brewer. Autolocker: Synchronization inference for atomic sections. In POPL, 2006.
[25]
T. Murata. Petri nets: Properties, analysis and applications. Proceedings of the IEEE, 77(4):541–580, Apr. 1989.
[26]
M. Naik, A. Aiken, and J. Whaley. Effective static race detection for Java. In PLDI, 2006.
[27]
A. Nazeem et al. Designing compact and maximally permissive deadlock avoidance policies for complex resource allocation systems through classification theory. IEEE Trans. Automatic Control, 56(8), 2011.
[28]
H. D. T. Nguyen, D. Qi, A. Roychoudhury, and S. Chandra. Semfix: Program repair via semantic analysis. In ICSE, 2013.
[29]
C.-S. Park and K. Sen. Randomized active atomicity violation detection in concurrent programs. In FSE, 2008.
[30]
S. Rajamani, G. Ramalingam, V. P. Ranganath, and K. Vaswani. Isolator: dynamically ensuring isolation in concurrent programs. In ASPLOS, 2009.
[31]
G. Ramalingam. The undecidability of aliasing. ACM Trans. Program. Lang. Syst., 16(5):1467–1471, 1994.
[32]
P. Ratanaworabhan, M. Burtscher, D. Kirovski, B. G. Zorn, R. Nagpal, and K. Pattabiraman. Detecting and tolerating asymmetric races. In PPOPP, 2009.
[33]
K. Sen. Race directed random testing of concurrent programs. In PLDI, 2008.
[34]
Y. Smaragdakis, J. Evans, C. Sadowski, J. Yi, and C. Flanagan. Sound predictive race detection in polynomial time. In POPL, 2012.
[35]
F. Sorrentino, A. Farzan, and P. Madhusudan. PENELOPE: Weaving threads to expose atomicity violations. In FSE, 2010.
[36]
M. Vaziri, F. Tip, and J. Dolby. Associating synchronization constraints with data in an object-oriented language. In POPL, 2006.
[37]
M. T. Vechev, E. Yahav, and G. Yorsh. Inferring synchronization under limited observability. In S. Kowalewski and A. Philippou, editors, TACAS, Lecture Notes in Computer Science, pages 139–154. Springer, 2009.
[38]
Y. Wang, S. Lafortune, T. Kelly, M. Kudlur, and S. Mahlke. The theory of deadlock avoidance via discrete control. In POPL, 2009.
[39]
D. Weeratunge, X. Zhang, and S. Jaganathan. Accentuating the positive: Atomicity inference and enforcement using correct executions. In OOPSLA, 2011.
[40]
W. Weimer, S. Forrest, C. Le Goues, and T. Nguyen. Automatic program repair with evolutionary computation. CACM, 53(5), 2010.
[41]
W. Xiong, S. Park, J. Zhang, Y. Zhou, and Z. Ma. Ad hoc synchronization considered harmful. In OSDI, 2010.
[42]
T. Yavuz-Kahveci and T. Bultan. Specification, verification, and synthesis of concurrency control components. In ISSTA, 2002.
[43]
Z. Yin, D. Yuan, Y. Zhou, S. Pasupathy, and L. Bairavasundaram. How do fixes become bugs? In ESEC/FSE, 2011.
[44]
L. Zhang and C. Wang. Runtime prevention of concurrency related type-state violations in multithreaded applications. In ISSTA, 2014.

Cited By

View all
  • (2023)An Empirical Study on Concurrency Bugs in Interrupt-Driven Embedded SoftwareProceedings of the 32nd ACM SIGSOFT International Symposium on Software Testing and Analysis10.1145/3597926.3598140(1345-1356)Online publication date: 12-Jul-2023
  • (2023)Patching Locking Bugs Statically with CrayonsACM Transactions on Software Engineering and Methodology10.1145/354868432:3(1-28)Online publication date: 26-Apr-2023
  • (2023)Hippodrome: Data Race Repair Using Static Analysis SummariesACM Transactions on Software Engineering and Methodology10.1145/354694232:2(1-33)Online publication date: 31-Mar-2023
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
FSE 2014: Proceedings of the 22nd ACM SIGSOFT International Symposium on Foundations of Software Engineering
November 2014
856 pages
ISBN:9781450330565
DOI:10.1145/2635868
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

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 11 November 2014

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Context-Aware fixing
  2. concurrency bugs

Qualifiers

  • Research-article

Conference

SIGSOFT/FSE'14
Sponsor:

Acceptance Rates

Overall Acceptance Rate 17 of 128 submissions, 13%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)11
  • Downloads (Last 6 weeks)0
Reflects downloads up to 19 Feb 2025

Other Metrics

Citations

Cited By

View all
  • (2023)An Empirical Study on Concurrency Bugs in Interrupt-Driven Embedded SoftwareProceedings of the 32nd ACM SIGSOFT International Symposium on Software Testing and Analysis10.1145/3597926.3598140(1345-1356)Online publication date: 12-Jul-2023
  • (2023)Patching Locking Bugs Statically with CrayonsACM Transactions on Software Engineering and Methodology10.1145/354868432:3(1-28)Online publication date: 26-Apr-2023
  • (2023)Hippodrome: Data Race Repair Using Static Analysis SummariesACM Transactions on Software Engineering and Methodology10.1145/354694232:2(1-33)Online publication date: 31-Mar-2023
  • (2023)TemLock: A Lightweight Template-based Approach for Fixing Deadlocks Caused by ReentrantLock2023 IEEE International Conference on Software Analysis, Evolution and Reengineering (SANER)10.1109/SANER56733.2023.00079(723-727)Online publication date: Mar-2023
  • (2022)A deep study of the effects and fixes of server-side request races in web applicationsProceedings of the 19th International Conference on Mining Software Repositories10.1145/3524842.3528463(744-756)Online publication date: 23-May-2022
  • (2022)Quality of Automated Program Repair on Real-World DefectsIEEE Transactions on Software Engineering10.1109/TSE.2020.299878548:2(637-661)Online publication date: 1-Feb-2022
  • (2021)Understanding and detecting server-side request races in web applicationsProceedings of the 29th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering10.1145/3468264.3468594(842-854)Online publication date: 20-Aug-2021
  • (2020)Debugging Declarative Models in Alloy2020 IEEE International Conference on Software Maintenance and Evolution (ICSME)10.1109/ICSME46990.2020.00107(844-848)Online publication date: Sep-2020
  • (2020)IFIX: Fixing Concurrency Bugs While They Are Introduced2020 25th International Conference on Engineering of Complex Computer Systems (ICECCS)10.1109/ICECCS51672.2020.00025(155-164)Online publication date: Oct-2020
  • (2019)DFix: automatically fixing timing bugs in distributed systemsProceedings of the 40th ACM SIGPLAN Conference on Programming Language Design and Implementation10.1145/3314221.3314620(994-1009)Online publication date: 8-Jun-2019
  • Show More Cited By

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