Skip to main content

Goldilocks: Efficiently Computing the Happens-Before Relation Using Locksets

  • Conference paper
Formal Approaches to Software Testing and Runtime Verification (FATES 2006, RV 2006)

Abstract

We present a new lockset-based algorithm, Goldilocks, for precisely computing the happens-before relation and thereby detecting data-races at runtime. Dynamic race detection algorithms in the literature are based on vector clocks or locksets. Vector-clock-based algorithms precisely compute the happens-before relation but have significantly more overhead. Previous lockset-based race detection algorithms, on the other hand, are imprecise. They check adherence to a particular synchronization discipline, i.e., a sufficient condition for race freedom and may generate false race warnings. Our algorithm, like vector clocks, is precise, yet it is efficient since it is purely lockset based.

We have implemented our algorithm inside the Kaffe Java Virtual Machine. Our implementation incorporates lazy evaluation of locksets and certain “short-circuit checks” which contribute significantly to its efficiency. Experimental results indicate that our algorithm’s overhead is much less than that of the vector-clock algorithm and is very close to our implementation of the Eraser lockset algorithm.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Boyapati, C., Lee, R., Rinard, M.: A type system for preventing data races and deadlocks in Java programs. In: OOPSLA 2002: Object-Oriented Programming, Systems, Languages and Applications, pp. 211–230. ACM, New York (2002)

    Google Scholar 

  2. Cheng, G.I., Feng, M., Leiserson, C.E., Randall, K.H., Stark, A.F.: Detecting data races in cilk programs that use locks. In: Proceedings of the ACM Symposium on Parallel Algorithms and Architectures (SPAA 1998), Puerto Vallarta, Mexico, June 28–July 2, pp. 298–309 (1998)

    Google Scholar 

  3. Choi, J.D., Loginov, A., Sarkar, V.: Static datarace analysis for multithreaded object-oriented programs. Technical Report RC22146, IBM Research (2001)

    Google Scholar 

  4. Choi, J.-D., Lee, K., Loginov, A., O’Callahan, R., Sarkar, V., Sridharan, M.: Efficient and precise datarace detection for multithreaded object-oriented programs. In: PLDI 2002: Programming Language Design and Implementation, pp. 258–269. ACM, New York (2002)

    Chapter  Google Scholar 

  5. Christiaens, M., De Bosschere, K.: Trade, a topological approach to on-the-fly race detection in Java programs. In: JVM 2001: Java Virtual Machine Research and Technology Symposium, USENIX, pp. 105–116 (2001)

    Google Scholar 

  6. Elmas, T., Qadeer, S., Tasiran, S.: Goldilocks: Efficiently Computing the Happens-Before Relation Using Locksets (2006), Full version available at: http://www.research.microsoft.com/~qadeer/fatesrv06-fullversion.ps

  7. Flanagan, C., Freund, S.N.: Type-based race detection for Java. In: PLDI 2000: Programming Language Design and Implementation, pp. 219–232. ACM, New York (2000)

    Chapter  Google Scholar 

  8. Flanagan, C., Godefroid, P.: Dynamic partial-order reduction for model checking software. In: POPL 2005: Principles of Programming Languages, pp. 110–121. ACM Press, New York (2005)

    Google Scholar 

  9. Harrow, J.J.: Runtime checking of multithreaded applications with visual threads. In: Havelund, K., Penix, J., Visser, W. (eds.) SPIN 2000. LNCS, vol. 1885, pp. 331–342. Springer, Heidelberg (2000)

    Chapter  Google Scholar 

  10. Manson, J., Pugh, W., Adve, S.: The Java memory model. In: POPL 2005: Principles of Programming Languages, pp. 378–391. ACM Press, New York (2005)

    Google Scholar 

  11. Mattern, F.: Virtual time and global states of distributed systems. In: International Workshop on Parallel and Distributed Algorithms, pp. 215–226. North-Holland, Amsterdam (1989)

    Google Scholar 

  12. Netzer, R.H.B., Miller, B.P.: What are race conditions?: Some issues and formalizations. ACM Lett. Program. Lang. Syst. 1(1), 74–88 (1992)

    Article  Google Scholar 

  13. Pozniansky, E., Schuster, A.: Efficient on-the-fly race detection in multithreaded c++ programs. In: PPoPP 2003: Principles and Practice of Parallel Programming, pp. 179–190. ACM, New York (2003)

    Chapter  Google Scholar 

  14. Ronsse, M., De Bosschere, K.: Recplay: A fully integrated practical record/replay system. ACM Transactions on Computer Systems 17(2), 133–152 (1999)

    Article  Google Scholar 

  15. Savage, S., Burrows, M., Nelson, G., Sobalvarro, P., Anderson, T.: Eraser: A dynamic data race detector for multithreaded programs. ACM Transactions on Computer Systems 15(4), 391–411 (1997)

    Article  Google Scholar 

  16. Schonberg, E.: On-the-fly detection of access anomalies. In: PLDI 1989: Programming Language Design and Implementation, pp. 313–327 (1989)

    Google Scholar 

  17. von Praun, C., Gross, T.R.: Object race detection. In: OOPSLA 2001: Object-Oriented Programming, Systems, Languages and Applications, pp. 70–82. ACM, New York (2001)

    Google Scholar 

  18. Wilkinson, T.: Kaffe: A JIT and interpreting virtual machine to run Java code (1998), http://www.transvirtual.com/

  19. Yu, Y., Rodeheffer, T., Chen, W.: Racetrack: efficient detection of data race conditions via adaptive tracking. In: SOSP 2005: Symposium on Operating Systems Principles, pp. 221–234. ACM, New York (2005)

    Chapter  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2006 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Elmas, T., Qadeer, S., Tasiran, S. (2006). Goldilocks: Efficiently Computing the Happens-Before Relation Using Locksets. In: Havelund, K., Núñez, M., Roşu, G., Wolff, B. (eds) Formal Approaches to Software Testing and Runtime Verification. FATES RV 2006 2006. Lecture Notes in Computer Science, vol 4262. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11940197_13

Download citation

  • DOI: https://doi.org/10.1007/11940197_13

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-49699-1

  • Online ISBN: 978-3-540-49703-5

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics