[go: up one dir, main page]
More Web Proxy on the site http://driver.im/ skip to main content
10.1145/2884781.2884819acmconferencesArticle/Chapter ViewAbstractPublication PagesicseConference Proceedingsconference-collections
research-article

Fixing deadlocks via lock pre-acquisitions

Published: 14 May 2016 Publication History

Abstract

Manual deadlock fixing is error-prone and time-consuming. Existing generic approach (GA) simply inserts gate locks to fix deadlocks by serializing executions, which could introduce various new deadlocks and incur high runtime overhead. We propose a novel approach DFixer to fix deadlocks without introducing any new deadlocks by design. DFixer only selects one thread of a deadlock to pre-acquire a lock w together with another lock h, where before fixing, the deadlock occurs when the thread holds lock h and waits for lock w. As such, DFixer eliminates a hold-and-wait necessary condition, preventing the deadlock from occurring. The thread performing pre-acquisition is carefully selected such that no other synchronization exists in between the two original acquisitions. Otherwise, DFixer further introduces a context-aware conditional protected by above lock w to guarantee the correctness of DFixer. The evaluation is on 20 deadlocks, including 17 from widely-used real-world C/C++ programs. It shows that DFixer successfully fixed all deadlocks. Whereas GA introduced 9 new deadlocks; a latest work Grail failed to fix 8 deadlocks and introduced 3 new deadlocks on others. On average, DFixer incurred only 2.1% overhead, where GA and Grail incurred 15.8% and 11.5% overhead, respectively.

References

[1]
HawkNL, http://hawksoft.com/hawknl.
[2]
LLVM Compiler Infrastructure, version 3.6, http://llvm.org.
[3]
MySQL, http://www.mysql.com.
[4]
MySQL Bugzilla, http://bugs.mysql.com.
[5]
SLOCCount 2.26. http://www.dwheeler.com/sloccount.
[6]
SQLite, http://www.sqlite.org.
[7]
R. Agarwal, S. Bensalem, E. Farchi, K. Havelund, Y. Nir-Buchbinder, S. D. Stoller, S. Ur, and L. Wang. Detection of deadlock potentials in multithreaded programs. IBM Journal of Research and Development, Vol. 54 (5), 520--534, 2010.
[8]
S. Bensalem and K. Havelund. Scalable dynamic deadlock analysis of multi-threaded programs. In PADTAD, 2005.
[9]
S. Bensalem, J. C. Fernandez, K. Havelund, and L. Mounier. Confirmation of deadlock potential detected by runtime analysis. In Proc. PADTAD, 41--50, 2006.
[10]
Y. Cai, C. Jia, K. Zhai, and W. K. Chan. ASN: A Dynamic barrier-based approach to confirmation of deadlocks from warnings for large-scale multithreaded programs. IEEE Transactions on Parallel and Distributed Systems, 26(01), 13--23, 2015.
[11]
Y. Cai and W. K. Chan. Magiclock: scalable detection of potential deadlocks in large-scale multithreaded programs. IEEE Transactions on Software Engineering (TSE), 40(3), 266--281, 2014.
[12]
Y. Cai and W. K. Chan. MagicFuzzer: scalable deadlock detection for large-scale applications. In Proc. ICSE, 606--616, 2012.
[13]
Y. Cai, S. Wu, and W. K. Chan. ConLock: A constraint-based approach to dynamic checking on deadlocks in multithreaded programs. In Proc. ICSE, 491--502, 2014.
[14]
X. Chang, Z. Zhang, P. Zhang, J. Xue, and J. Zhao. BIFER: a biphasic trace filter approach to scalable prediction of concurrency errors. Frontiers of Computer Science (FCS), 9(6), 944--955, 2015.
[15]
J. Deshmukh, E. A. Emerson, and S. Sankaranarayanan. Symbolic deadlock analysis in concurrent libraries and their clients. In Proc. ASE, 480--491, 2009.
[16]
M. Eslamimehr and J. Palsberg. Sherlock: scalable deadlock detection for concurrent programs. In Proc. FSE, 353--365, 2014.
[17]
P. Gerakios, N. Papaspyrou, and K. Sagonas. A type and effect system for deadlock avoidance in low-level languages. In Proc. TLDI, 15--28, 2011.
[18]
P. Gerakios, N. Papaspyrou, K. Sagonas, and P. Vekris. Dynamic deadlock avoidance in systems code using statically inferred effects. In Proc. PLOS, Article No. 5, 2011.
[19]
C. L. Goues, S. Forrest, and W. Weimer. Current challenges in automatic software repair. Software Quality Journal, 21(3): 421--443, 2013.
[20]
C. L. Goues, M. Dewey-Vogt, S. Forrest, and W. Weimer. A systematic study of automated program repair: fixing 55 out of 105 bugs for $8 each. In Proc. ICSE, 3--13, 2012.
[21]
C. L. Goues, T. Nguyen, S. Forrest and W. Weimer. GenProg: A generic method for automated software repair. IEEE Transactions on Software Engineering (TSE), 38(1): 54--72, 2012.
[22]
M. Grechanik, B. M. M. Hossain, U. Buy, and H. Wang. Preventing database deadlocks in applications. In Proc. ESEC/FSE, 356--366, 2013.
[23]
M. Grechanik, B. M. M. Hossain, and U. Buy. Testing database-centric applications for causes of database deadlocks. In Proc. ICST, 174--183, 2013.
[24]
K. Havelund, Using runtime analysis to guide model checking of java programs. In Proc. SPIN, 245--264, 2000.
[25]
G. Jin, L. Song, X. Shi, J. Scherpelz, and S. Lu. Understanding and detecting real-world performance bugs. In Proc. PLDI, 77--88, 2012.
[26]
G. Jin, L. H, Song, W. Zhang, S. Lu, B. Liblit. Automated atomicity-violation fixing. In Proc. PLDI, 389--400, 2011.
[27]
G. Jin, W. Zhang, D. Deng, B. Liblit, S. Lu. Automated concurrency-bug fixing. In Proc. OSDI, 221--236, 2012.
[28]
P. Joshi, M. Naik, K, Sen, and D. Gay. An effective dynamic analysis for detecting generalized deadlocks. In Proc. FSE, 327--336, 2010.
[29]
P. Joshi, C. S. Park, K. Sen, and M. Naik. A randomized dynamic program analysis technique for detecting real deadlocks. In Proc. PLDI, 110--120, 2009.
[30]
H. Jula, D. Tralamazza, C. Zamfir, and G.e Candea. Deadlock immunity: enabling systems to defend against deadlocks. In Proc. OSDI, 295--308, 2008.
[31]
V. Kahlon, F. Ivančić, and A. Gupta. Reasoning about threads communicating via locks. In Proc. CAV, 505--518, 2005.
[32]
T. Kelly, Y. Wang, S. Lafortune, and S. Mahlke. Eliminating concurrency bugs with control engineering. Computer, 42(12), 52--60, 2009.
[33]
S. Khoshnood, M. Kusano, and C. Wang. ConcBugAssist: Constraint solving for diagnosis and repair of concurrency bugs. In Proc. ISSTA, 165--176, 2015.
[34]
E. Knapp. Deadlock detection in distributed database systems. ACM Computing Surveys, 19(4):303--328, 1987.
[35]
Y. Lin and S. S. Kulkarni. Automatic repair for multithreaded programs with Deadlock/Livelock using maximum satisfiability. In Proc. ISSTA, 237--247, 2014.
[36]
P. Liu and C. Zhang. Axis: automatically fixing atomicity violations through solving control constraints. In Proc. ICSE, 299--309, 2012.
[37]
P. Liu, O. Tripp, and C. Zhang. Grail: context-aware fixing of concurrency bugs. In Proc. FSE, 318--329, 2014.
[38]
C. Lattner and B. Adve. LLVM: a compilation framework for lifelong program analysis & transformation. In Proc. CGO, 75--86, 2004.
[39]
S. Lu, S. Park, E. Seo, Y. Y. Zhou. Learning from mistakes: a comprehensive study on real world concurrency bug characteristics. In Proc. ASPLOS, 329--339, 2008.
[40]
Z. D. Luo, R. Das, and Y. Qi,. MulticoreSDK: a practical and efficient deadlock detector for real-world applications. In Proc. ICST, 309--318, 2011.
[41]
M. Naik, C. S. Park, K. Sen, and D. Gay. Effective static deadlock detection. In Proc. ICSE, 386--396, 2009.
[42]
Y. Nir-Buchbinder, R. Tzoref, and S. Ur. Deadlocks: from exhibiting to healing. In Proc. RV, 104--118, 2008.
[43]
S. Park. Debugging non-deadlock concurrency bugs. In Proc. ISSTA, 358--361, 2013.
[44]
Y. Pei, C. A. Furia, M. Nordio, and B. Meyer. Automatic program repair by fixing contracts. In Proc. FASE, 8411:246--260, 2014.
[45]
M. Pradel and T. R. Gross. Fully automatic and precise detection of thread safety violations. In Proc. PLDI, 521--530, 2012.
[46]
H. K. Pyla and S. Varadarajan. Avoiding deadlock avoidance. In Proc. PACT, 75--86, 2010.
[47]
F. Qin, J. Tucek, J. Sundaresan, and Y. Zhou. Rx: treating bugs as allergies---a safe method to survive software failures. In Proc. SOSP, 235--248, 2005.
[48]
R. Raman, J. S. Zhao, V. Sarkar, M. Vechev, and E. Yahav. Scalable and precise dynamic datarace detection for structured parallelism. In Proc. PLDI, 531--542, 2012.
[49]
M. Samak and M. K. Ramanthan. Trace driven dynamic deadlock detection and reproduction. In Proc. PPoPP, 29--42, 2014.
[50]
M. Samak and M. K. Ramanathan. Multithreaded test synthesis for deadlock detection. In Proc. OOPSLA, 473--489, 2014.
[51]
K. Sen and G. Agha. CUTE and jCUTE: concolic unit testing and explicit path model-checking tools. In Proc. CAV, 419--423, 2006.
[52]
V. K. Shanbhag. Deadlock-detection in java-library using static-analysis. In Proc. APSEC, 361--368, 2008.
[53]
F. Sorrentino, A. Farzan, and P. Madhusudan. PENELOPE: weaving threads to expose atomicity violations. In Proc. FSE, 37--46, 2010.
[54]
R. Surendran, R. Raman, S. Chaudhuri, J. Mellor-Crummey, and V. Sarkar. Test-driven repair of data races in structured parallel programs. In Proc. PLDI, 15--25, 2014.
[55]
Y. Wang, T. Kelly, M. Kudlur, S. Lafortune, and S. Mahlke. Gadara: dynamic deadlock avoidance for multithreaded programs. In Proc. OSDI, 281--294, 2008.
[56]
D. Weeratunge, X. Zhang, and S. Jaganathan. Accentuating the positive: Atomicity inference and enforcement using correct executions. In Proc. OOPSLA, 19--34, 2011.
[57]
W. Weimer, S. Forrest, C. L. Goues, and T. Nguyen. Automatic program repair with evolutionary computation. Communications of the ACM (CACM), 53(5): 109--116, 2010.
[58]
A. Williams, W. Thies, and M. D. Ernst. Static deadlock detection for java libraries. In Proc. ECOOP, 602--629, 2005.
[59]
W. Xiong, S. Park, J. Zhang, Y. Zhou, and Z. Ma. Ad hoc synchronization considered harmful. In Proc. OSDI, article No. 1--8, 2010.
[60]
Z. Yin, D. Yuan, Y. Zhou, S. Pasupathy, and L. Bairavasundaram. How do fixes become bugs? In Proc. FSE, 26--36, 2011.
[61]
C. Zamfir and G. Candea. Execution synthesis: a technique for automated software debugging. In Proc. EuroSys, 321--334, 2010.
[62]
W. Zhang, M. de Kruijf, A. Li, S. Lu, and K. Sankaralingam. ConAir: featherweight concurrency bug recovery via single-threaded idempotent execution. In Proc. ASPLOS, 113--126, 2013.
[63]
L. Zheng, X. Liao, S. Wu, X. Fan, and H. Jin. Understanding and identifying latent data races cross-thread interleaving. Frontiers of Computer Science (FCS), 9(4), 524--539, 2015.
[64]
J. Zhou, H. Zhang, and D. Lo. where should the bugs be fixed? - more accurate information-retrieval-based bug localization based on bug reports. In Proc. ICSE, 14--24, 2012.

Cited By

View all
  • (2024)Extending the range of bugs that automated program repair can handleJournal of Systems and Software10.1016/j.jss.2023.111918209(111918)Online publication date: Mar-2024
  • (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)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
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Conferences
ICSE '16: Proceedings of the 38th International Conference on Software Engineering
May 2016
1235 pages
ISBN:9781450339001
DOI:10.1145/2884781
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: 14 May 2016

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. deadlock
  2. fixing
  3. lock order
  4. multithreaded program

Qualifiers

  • Research-article

Funding Sources

Conference

ICSE '16
Sponsor:

Acceptance Rates

Overall Acceptance Rate 276 of 1,856 submissions, 15%

Upcoming Conference

ICSE 2025

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)11
  • Downloads (Last 6 weeks)1
Reflects downloads up to 01 Jan 2025

Other Metrics

Citations

Cited By

View all
  • (2024)Extending the range of bugs that automated program repair can handleJournal of Systems and Software10.1016/j.jss.2023.111918209(111918)Online publication date: Mar-2024
  • (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)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
  • (2023)TDFix: A Lightweight Tool for Fixing Deadlocks based on TemplatesScience of Computer Programming10.1016/j.scico.2023.103073(103073)Online publication date: Dec-2023
  • (2022)Peahen: fast and precise static deadlock detection via context reductionProceedings of the 30th ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering10.1145/3540250.3549110(784-796)Online publication date: 7-Nov-2022
  • (2022)Towards Extending the Range of Bugs That Automated Program Repair Can Handle2022 IEEE 22nd International Conference on Software Quality, Reliability and Security (QRS)10.1109/QRS57517.2022.00031(209-220)Online publication date: Dec-2022
  • (2021)Rupair: Towards Automatic Buffer Overflow Detection and Rectification for RustProceedings of the 37th Annual Computer Security Applications Conference10.1145/3485832.3485841(812-823)Online publication date: 6-Dec-2021
  • (2021)Beyond TestsACM Transactions on Software Engineering and Methodology10.1145/341846130:2(1-27)Online publication date: 10-Feb-2021
  • (2021)A Characteristic Study of Deadlocks in Database-Backed Web Applications2021 IEEE 32nd International Symposium on Software Reliability Engineering (ISSRE)10.1109/ISSRE52982.2021.00059(510-521)Online publication date: Oct-2021
  • (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
  • 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

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media