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

Static conflict analysis for multi-threaded object-oriented programs

Published: 09 May 2003 Publication History

Abstract

A compiler for multi-threaded object-oriented programs needs information about the sharing of objects for a variety of reasons: to implement optimizations, to issue warnings, to add instrumentation to detect access violations that occur at runtime. An Object Use Graph (OUG) statically captures accesses from different threads to objects. An OUG extends the Heap Shape Graph (HSG), which is a compile-time abstraction for runtime objects (nodes) and their reference relations (edges). An OUG specifies for a specific node in the HSG a partial order of events relevant to the corresponding runtime object(s). Relevant events include read and write access, object escape, thread start and join.OUGs have been implemented in a Java compiler. Initial experience shows that OUGs are effective to identify object accesses that potentially conflict at runtime and isolate accesses that never cause a problem at runtime. The capabilities of OUGs are compared with an advanced program analysis that has been used for lock elimination. For the set of benchmarks investigated here, OUGs report only a fraction of shared objects as conflicting and reduce the number of compile-time reports in terms of allocation sites of conflicting objects by 28--92% (average 64%). For benchmarks of up to 30 KLOC, the time taken to construct OUGs is, with one exception, in the order of seconds.The information collected in the OUG has been used to instrument Java programs with checks for object races. OUGs provide precise information about object sharing and static protection, so runtime instrumentation that checks those cases that cannot be disambiguated at compile-time is sparse, and the total runtime overhead of checking for object races is only 3--86% (average 47%).

References

[1]
D. Bacon, R. Strom, and A. Tarafdar. Guava: A dialect of Java without data races. In Proc. Conf. Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA'00), pages 382--400, Oct. 2000.]]
[2]
B. Blanchet. Escape analysis for object-oriented languages - Application to Java. In Proc. Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA'99), pages 20--34, Nov. 1999.]]
[3]
J. Bogda and U. Hölzle. Removing unnecessary synchronization in Java. In Proc. Conf. Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA'99), pages 35--46, Nov. 1999.]]
[4]
C. Boyapati, R. Lee, and M. Rinard. Ownership types for safe programming: preventing data races and deadlocks. In Proc. Conf. Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA'02), pages 211--230, Nov. 2002.]]
[5]
G. Bristow, C. Dreay, B. Edwards, and W. Riddle. Anomaly detection in concurrent programs. In Proc. Intl. Conf. on Software Engineering (ICSE'79), pages 265--273, 1979.]]
[6]
J. Choi, M. Gupta, M. Serrano, V. Sreedhar, and S. Midkiff. Escape analysis for Java. In Proc. Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA'99), pages 1--19. ACM Press, Nov. 1999.]]
[7]
J.-D. Choi, K. Lee, A. Loginov, R. O'Callahan, V. Sarkar, and M. Sridharan. Efficient and precise datarace detection for multithreaded object-oriented programs. In Conf. Programming Language Design and Implementation (PLDI'02), pages 258--269, June 2002.]]
[8]
P. Diniz and M. Rinard. Synchronization transformation for parallel computing. In Proc. Symp. Principles of Programming Languages (POPL'97), pages 187--200, Jan. 1997.]]
[9]
E. Duesterwald and M. Soffa. Concurrency analysis in the presence of procedures using a data-flow framework. In Proc. Symp. Testing, Analysis and Verification (TAV4), pages 36--48, 1993.]]
[10]
C. Flanagan and S. Freund. Type-based race detection for Java. In Proc. Conf. Programming Language Design and Implementation (PLDI'00), pages 219--229, June 2000.]]
[11]
C. Flanagan and S. Freund. Detecting race conditions in large programs. In Proc. Workshop Program Analysis for Software Tools and Engineering (PASTE'01), pages 90--96, June 18--19 2001.]]
[12]
GNU Software. gcj - The GNU compiler for the Java programming language. http://gcc.gnu.org/java, 2000.]]
[13]
A. Heydon, R. Levin, and Y. Yu. Caching function calls using precise dependencies. In Proc. Conf. Programming Language Design and Implementation (PLDI'00), pages 311--320, June 18--21 2000.]]
[14]
C. Hoare. Monitors: An operating system structuring concept. Communications of the ACM, 17(10):549--557, Oct. 1974.]]
[15]
Java Grande Forum. Multi-threaded benchmark suite. http://www.epcc.ed.ac.uk/javagrande/, 1999.]]
[16]
L. Lamport. How to make a correct multiprocess program execute correctly on a multiprocessor. IEEE Trans. on Computers, 46(7):779--782, July 1997.]]
[17]
S. Masticola and B. Ryder. Non-concurrency analysis. In Proc. Symp. Principles and Practice of Parallel Programming (PPoPP'93), pages 129--138, 1993.]]
[18]
S. Midkiff, J. Lee, and D. Padua. A compiler for multiple memory models. In Rec. 9th Workshop Compilers for Parallel Computers (CPC'01), June 2001.]]
[19]
G. Naumovich, G. Avrunin, and L. Clarke. An efficient algorithm for computing MHP information for concurrent Java programs. In Proc. 7th European Software Engineering Conf. and 7th Symp. Foundations of Software Engineering, pages 338--354, Sept. 1999.]]
[20]
M. Rinard. Analysis of multithreaded programs. In Proc. Static Analysis Symp. (SAS'01), July 2001.]]
[21]
E. Ruf. Effective synchronization removal for Java. In Proc. Conf. Programming Language Design and Implementation (PLDI'00), pages 208--218, June 2000.]]
[22]
R. Rugina and M. Rinard. Pointer analysis for multithreaded programs. In Proc. Conf. Programming Language Design and Implementation (PLDI'99), pages 77--90, May 1--4, 1999.]]
[23]
D. Schmidt and T. Harrison. Double-checked locking: An optimization pattern for efficiently initializing and accessing thread-safe objects. In F. Buschmann, R. Martin, and D. Riehle, editors, Pattern Languages of Program Design (PLoP) 3, pages 363--375, 1998.]]
[24]
D. Shasha and M. Snir. Efficient and correct execution of parallel programs that share memory. ACM Trans. on Programming Languages and Systems, 10(2):282--312, Apr. 1988.]]
[25]
E. Stolte, C. von Praun, G. Alonso, and T. Gross. Scientific data repositories -- designing for a moving target. In Proc. Conf. ACM SIGMOD/PODS, June 2003.]]
[26]
V. Sundaresan, L. J. Hendren, C. Razafimahefa, R. Vallée-Rai, P. Lam, E. Gagnon, and C. Godin. Practical virtual method call resolution for java. In Proc. Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA'00), pages 264--280, Oct. 15--19 2000.]]
[27]
R. Taylor. A general purpose algorithm for analyzing concurrent programs. Communications of the ACM, 26(5):362--376, May 1983.]]
[28]
The Standard Performance Evaluation Corporation. SPEC JVM98 Benchmarks. http://www.spec.org/osg/jvm98, 1996.]]
[29]
C. von Praun and T. Gross. Object race detection. In Proc. Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA'01), pages 70--82, Oct. 2001.]]
[30]
J. Whaley and M. Rinard. Compositional pointer and escape analysis for Java programs. In Proc. Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA'99), pages 187--206, Nov. 1999.]]

Cited By

View all
  • (2023)Dynamic Race Detection with O(1) SamplesProceedings of the ACM on Programming Languages10.1145/35712387:POPL(1308-1337)Online publication date: 11-Jan-2023
  • (2023)Davida: A Decentralization Approach to Localizing Transaction Sequences for Debugging Transactional Atomicity ViolationsIEEE Transactions on Reliability10.1109/TR.2022.317668072:2(808-826)Online publication date: Jun-2023
  • (2022)Deadlock prediction via generalized dependencyProceedings of the 31st ACM SIGSOFT International Symposium on Software Testing and Analysis10.1145/3533767.3534377(455-466)Online publication date: 18-Jul-2022
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
PLDI '03: Proceedings of the ACM SIGPLAN 2003 conference on Programming language design and implementation
June 2003
360 pages
ISBN:1581136625
DOI:10.1145/781131
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: 09 May 2003

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. heap shape graph
  2. object use graph
  3. program analysis
  4. race detection
  5. representations for concurrent programs

Qualifiers

  • Article

Conference

PLDI03
Sponsor:

Acceptance Rates

PLDI '03 Paper Acceptance Rate 28 of 131 submissions, 21%;
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)2
Reflects downloads up to 10 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2023)Dynamic Race Detection with O(1) SamplesProceedings of the ACM on Programming Languages10.1145/35712387:POPL(1308-1337)Online publication date: 11-Jan-2023
  • (2023)Davida: A Decentralization Approach to Localizing Transaction Sequences for Debugging Transactional Atomicity ViolationsIEEE Transactions on Reliability10.1109/TR.2022.317668072:2(808-826)Online publication date: Jun-2023
  • (2022)Deadlock prediction via generalized dependencyProceedings of the 31st ACM SIGSOFT International Symposium on Software Testing and Analysis10.1145/3533767.3534377(455-466)Online publication date: 18-Jul-2022
  • (2022)Automatic Detection, Validation, and Repair of Race Conditions in Interrupt-Driven Embedded SoftwareIEEE Transactions on Software Engineering10.1109/TSE.2020.298917148:1(346-363)Online publication date: 1-Jan-2022
  • (2021)Statically driven generation of concurrent tests for thread‐safe classesSoftware Testing, Verification and Reliability10.1002/stvr.177431:4Online publication date: 4-May-2021
  • (2020) ConTesa : Directed Test Suite Augmentation for Concurrent Software IEEE Transactions on Software Engineering10.1109/TSE.2018.286139246:4(405-419)Online publication date: 1-Apr-2020
  • (2019)Coverage-Driven Test Generation for Thread-Safe Classes via Parallel and Conflict Dependencies2019 12th IEEE Conference on Software Testing, Validation and Verification (ICST)10.1109/ICST.2019.00034(264-275)Online publication date: Apr-2019
  • (2019)MAP-CoverageProceedings of the 34th IEEE/ACM International Conference on Automated Software Engineering10.1109/ASE.2019.00073(722-734)Online publication date: 10-Nov-2019
  • (2018)High-coverage, unbounded sound predictive race detectionACM SIGPLAN Notices10.1145/3296979.319238553:4(374-389)Online publication date: 11-Jun-2018
  • (2018)Is this class thread-safe? inferring documentation using graph-based learningProceedings of the 33rd ACM/IEEE International Conference on Automated Software Engineering10.1145/3238147.3238212(41-52)Online publication date: 3-Sep-2018
  • Show More Cited By

View Options

Get Access

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