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

SharC: checking data sharing strategies for multithreaded c

Published: 07 June 2008 Publication History

Abstract

Unintended or unmediated data sharing is a frequent cause of insidious bugs in multithreaded programs. We present a tool called SharC (short for Sharing Checker) that allows a user to write lightweight annotations to declare how they believe objects are being shared between threads in their program. SharC uses a combination of static and dynamic analyses to check that the program conforms to this specification.
SharC allows any type to have one of five "sharing modes" -- private to the current thread, read-only, shared under the control of a specified lock, intentionally racy, or checked dynamically. The dynamic mode uses run-time checking to verify that objects are either read-only, or only accessed by one thread. This allows us to check programs that would be difficult to check with a purely static system. If the user does not give a type an explicit annotation, then SharC uses a static type-qualifier analysis to infer that it is either private or should be checked dynamically.
SharC allows objects to move between different sharing modes at runtime by using reference counting to check that there are no other references to the objects when they change mode.
SharC's baseline dynamic analysis can check any C program, but is slow, and will generate false warnings about intentional data sharing. As the user adds more annotations, false warnings are reduced, and performance improves.We have found in practice that very few annotations are needed to describe all sharing and give reasonable performance. We ran SharC on 6 legacy C programs, summing to over 600k lines of code, and found that a total of only 60 simple annotations were needed to remove all false positives and to reduce performance overhead to only 2-14%.

References

[1]
Agarwal, R., Sasturkar, A.,Wang, L., and Stoller, S. D. Optimized run-time race detection and atomicity checking using partial discovered types. In ASE?05.
[2]
Anderson, Z. R., Gay, D., Ennals, R., and Brewer, E. SharC: Checking data sharing strategies for multithreaded C. Tech. Rep. UCB/EECS-2008-25, EECS Department, University of California, Berkeley, Mar 2008.
[3]
Boyapati, C., Lee, R., and Rinard, M. Ownership types for safe programming: preventing data races and deadlocks. In OOPSLA?02, pp. 211--230.
[4]
Cheng, G.-I., Feng, M., Leiserson, C. E.,Randall, K. H., and Stark, A. F. Detecting data races in Cilk programs that use locks. In SPAA?98, pp. 298--309.
[5]
Choi, J.-D., Lee, K., Loginov, A., O?Callahan, R., Sarkar, V., and Sridharan, M. Efficient and precise datarace detection for multithreaded object-oriented programs. In PLDI?02, pp. 258--269.
[6]
Condit, J., Harren, M., Anderson, Z., Gay, D., and Necula, G. Dependent types for low-level programming. In ESOP?07.
[7]
Elmas, T., Qadeer, S., and Tasiran, S. Goldilocks: a race and transaction-aware Java runtime. In PLDI?07, pp. 245--255.
[8]
Engler, D., and Ashcraft, K. RacerX: effective, static detection of race conditions and deadlocks. In SOSP?03, pp. 237--252.
[9]
Flanagan, C., and Freund, S. N. Atomizer: a dynamic atomicity checker for multithreaded programs. In POPL?04, pp. 256--267.
[10]
Foster, J. S., Fahndrich, M., and Aiken, A. A theory of type qualifiers. In PLDI?99, pp. 192--203.
[11]
freedesktop.org. Gstreamer: Open source multimedia framework. http://gstreamer.freedesktop.org/.
[12]
Frigo, M. A fast Fourier transform compiler. In PLDI?99, pp. 169--180.
[13]
Gay, D., Ennals, R., and Brewer, E. Safe manual memory management. In ISMM?07 (New York, NY, USA, 2007), ACM, pp. 2--14.
[14]
Grossman, D. Type-safe multithreading in Cyclone.
[15]
Henzinger, T. A., Jhala, R., and Majumdar, R. Race checking by context inference. In PLDI?04, pp. 1--13.
[16]
Levanoni, Y., and Petrank, E. An on-the-fly reference-counting garbage collector for Java. ACM Transactions on Programming Languages and Systems 28, 1 (2006), 1--69.
[17]
Naik, M., Aiken, A., and Whaley, J. Effective static race detection for Java. In PLDI?06, pp. 308--319.
[18]
Necula, G. C., Condit, J., Harren, M.,McPeak, S., and Weimer, W. CCured: Type-safe retrofitting of legacy software. ACM Transactions on Programming Languages and Systems 27, 3 (May 2005).
[19]
Pratikakis, P., Foster, J. S., and Hicks, M. Locksmith: contextsensitive correlation analysis for race detection. In PLDI?06, pp. 320--331.
[20]
Qadeer, S., and Wu, D. KISS: keep it simple and sequential. In PLDI?04, pp. 14--24.
[21]
Sasturkar, A.,Agarwal, R.,Wang, L., and Stoller, S. D. Automated type-based analysis of data races and atomicity. In PPoPP?05, pp. 83--94.
[22]
Savage, S., Burrows, M., Nelson, G., Sobalvarro, P., and Anderson, T. Eraser: a dynamic data race detector for multi-threaded programs. In SOSP?97, pp. 27--37.
[23]
Sen, K., and Agha, G. A race-detection and flipping algorithm for automated testing of multi-threaded programs. In Haifa Verification Conference (2006), pp. 166--182.
[24]
US-CERT. Technical cyber security alerts. http://www.us-cert.gov/cas/techalerts/index.html.
[25]
Voung, J. W., Jhala, R., and Lerner, S. RELAY: static race detection on millions of lines of code. In ESEC-FSE?07, pp. 205--214.
[26]
Yu, Y., Rodeheffer, T., and Chen,W. Racetrack: efficient detection of data race conditions via adaptive tracking. In SOSP?05, pp. 221--234.

Cited By

View all
  • (2022)Hybrid Static-Dynamic Analysis of Data Races Caused by Inconsistent Locking Discipline in Device DriversIEEE Transactions on Software Engineering10.1109/TSE.2021.3138735(1-1)Online publication date: 2022
  • (2020)Krace: Data Race Fuzzing for Kernel File Systems2020 IEEE Symposium on Security and Privacy (SP)10.1109/SP40000.2020.00078(1643-1660)Online publication date: May-2020
  • (2019)Razzer: Finding Kernel Race Bugs through Fuzzing2019 IEEE Symposium on Security and Privacy (SP)10.1109/SP.2019.00017(754-768)Online publication date: May-2019
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
PLDI '08: Proceedings of the 29th ACM SIGPLAN Conference on Programming Language Design and Implementation
June 2008
396 pages
ISBN:9781595938602
DOI:10.1145/1375581
  • General Chair:
  • Rajiv Gupta,
  • Program Chair:
  • Saman Amarasinghe
  • cover image ACM SIGPLAN Notices
    ACM SIGPLAN Notices  Volume 43, Issue 6
    PLDI '08
    June 2008
    382 pages
    ISSN:0362-1340
    EISSN:1558-1160
    DOI:10.1145/1379022
    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 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: 07 June 2008

Permissions

Request permissions for this article.

Check for updates

Author Tag

  1. data-race

Qualifiers

  • Research-article

Conference

PLDI '08
Sponsor:

Acceptance Rates

Overall Acceptance Rate 406 of 2,067 submissions, 20%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

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

Other Metrics

Citations

Cited By

View all
  • (2022)Hybrid Static-Dynamic Analysis of Data Races Caused by Inconsistent Locking Discipline in Device DriversIEEE Transactions on Software Engineering10.1109/TSE.2021.3138735(1-1)Online publication date: 2022
  • (2020)Krace: Data Race Fuzzing for Kernel File Systems2020 IEEE Symposium on Security and Privacy (SP)10.1109/SP40000.2020.00078(1643-1660)Online publication date: May-2020
  • (2019)Razzer: Finding Kernel Race Bugs through Fuzzing2019 IEEE Symposium on Security and Privacy (SP)10.1109/SP.2019.00017(754-768)Online publication date: May-2019
  • (2019)RangeLocker: Adaptive Range-Sensitive Lockset Analysis for Precise Dynamic Race Detection2019 IEEE 19th International Symposium on High Assurance Systems Engineering (HASE)10.1109/HASE.2019.00036(184-191)Online publication date: Jan-2019
  • (2019)Region and effect inference for safe parallelismAutomated Software Engineering10.1007/s10515-019-00257-326:2(463-509)Online publication date: 1-Jun-2019
  • (2018)A Survey of Recent Trends in Testing Concurrent Software SystemsIEEE Transactions on Software Engineering10.1109/TSE.2017.270708944:8(747-783)Online publication date: 1-Aug-2018
  • (2017)Flexible and efficient memory object metadataACM SIGPLAN Notices10.1145/3156685.309226852:9(36-46)Online publication date: 18-Jun-2017
  • (2017)Flexible and efficient memory object metadataProceedings of the 2017 ACM SIGPLAN International Symposium on Memory Management10.1145/3092255.3092268(36-46)Online publication date: 18-Jun-2017
  • (2015)What change history tells us about thread synchronizationProceedings of the 2015 10th Joint Meeting on Foundations of Software Engineering10.1145/2786805.2786815(426-438)Online publication date: 30-Aug-2015
  • (2015)Scalable Task Scheduling and Synchronization Using Hierarchical EffectsProceedings of the 2015 International Conference on Parallel Architecture and Compilation (PACT)10.1109/PACT.2015.25(125-137)Online publication date: 18-Oct-2015
  • 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