skip to main content
10.1145/2048066.2048090acmconferencesArticle/Chapter ViewAbstractPublication PagessplashConference Proceedingsconference-collections
research-article

Asynchronous assertions

Published:22 October 2011Publication History

ABSTRACT

Assertions are a familiar and widely used bug detection technique. Traditional assertion checking, however, is performed synchronously, imposing its full cost on the runtime of the program. As a result, many useful kinds of checks, such as data structure invariants and heap analyses, are impractical because they lead to extreme slowdowns. We present a solution that decouples assertion evaluation from program execution: assertions are checked asynchronously by separate checking threads while the program continues to execute. Our technique guarantees that asynchronous evaluation always produces the same result as synchronous evaluation, even if the program concurrently modifies the program state. The checking threads evaluate each assertion on a consistent snapshot of the program state as it existed at the moment the assertion started.

We implemented our technique in a system called Strobe, which supports asynchronous assertion checking in both single-and multi-threaded Java applications. Strobe runs inside the Java virtual machine and uses copy-on-write to construct snapshots incrementally, on-the-fly. Our system includes all necessary synchronization to support multiple concurrent checking threads, and to prevent data races with the main program threads. We find that asynchronous checking significantly outperforms synchronous checking, incurring tolerable overheads -- in the range of 10% to 50% over no checking at all -- even for heavy-weight assertions that would otherwise result in crushing slowdowns.

References

  1. E. Aftandilian and S. Z. Guyer. GC Assertions: Using the Garbage Collector to Check Heap Properties. In ACM Conference on Programming Languages Design and Implementation, pages 235--244, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. M. Arnold, M. Vechev, and E. Yahav. QVM: An Efficient Runtime for Detecting Defects in Deployed Systems. In ACM Conference on Object-Oriented Programming Systems, Languages, and Applications, pages 143--162, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. A. Aviram, S.-C. Weng, S. Hu, and B. Ford. Efficient System-Enforced Deterministic Parallelism. In Proceedings of the 9th USENIX Conference on Operating Systems Design and Implementation, pages 1--16, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. H. Azatchi, Y. Levanoni, H. Paz, and E. Petrank. An On-the-fly Mark and Sweep Garbage Collector Based on Sliding Views. In ACM Conference on Object-Oriented Programming Systems, Languages, and Applications, pages 269--281, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. D. F. Bacon, P. Cheng, and V. T. Rajan. A Real-time Garbage Collector with Low Overhead and Consistent Utilization. In ACM Symposium on the Principles of Programming Languages, pages 285--298, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. S. Burckhardt, A. Baldassin, and D. Leijen. Concurrent Programming with Revisions and Isolation Types. In ACM Conference on Object-Oriented Programming Systems, Languages, and Applications, pages 691--707, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. C. Dimoulas, R. Pucella, and M. Felleisen. Future Contracts. In Proceedings of the 11th ACM SIGPLAN Conference on Principles and Practice of Declarative Programming, pages 195--206, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. T. Harris, J. Larus, and R. Rajwar. Transactional Memory, 2nd edition. Morgan and Claypool Publishers, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. R. Jones and R. Lins. Garbage Collection. John Wiley and Sons, 1996.Google ScholarGoogle Scholar
  10. K. Kelsey, T. Bai, C. Ding, and C. Zhang. Fast Track: A Software System for Speculative Program Optimization. In International Symposium on Code Generation and Optimization, pages 157--168, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. E. B. Nightingale, D. Peek, P. M. Chen, and J. Flinn. Parallelizing security checks on commodity hardware. In ACM Conference on Architectural Support for Programming Languages and Operating Systems, pages 308--318, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. C. Reichenbach, N. Immerman, Y. Smaragdakis, E. E. Aftandilian, and S. Z. Guyer. What Can the GC Compute Efficiently?: A Language for Heap Assertions at GC Time. In ACM Conference on Object-Oriented Programming Systems, Languages, and Applications, pages 256--269, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. 2007)}shankar07dittoA. Shankar and R. Bodık. DITTO: Automatic Incrementalization of Data Structure Invariant Checks (in Java). In ACM Conference on Programming Languages Design and Implementation, pages 310--319, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. 2000 Documentation. Standard Performance Evaluation Corporation, release 1.01 edition, 2001.Google ScholarGoogle Scholar
  15. M. Süsskraut, S. Weigert, U. Schiffel, T. Knauth, M. Nowack, D. B. Brum, and C. Fetzer. Speculation for Parallelizing Runtime Checks. In Proceedings of the 11th International Symposium on Stabilization, Safety, and Security of Distributed Systems, pages 698--710, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. M. T. Vechev, E. Yahav, and D. F. Bacon. Correctness-Preserving Derivation of Concurrent Garbage Collection Algorithms. In ACM Conference on Programming Languages Design and Implementation, pages 341--353, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. S. Wallace and K. Hazelwood. SuperPin: Parallelizing Dynamic Instrumentation for Real-Time Performance. In International Symposium on Code Generation and Optimization, pages 209--220, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. A. Welc, S. Jagannathan, and A. Hosking. Safe futures for Java. In ACM Conference on Object-Oriented Programming Systems, Languages, and Applications, pages 439--453, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. T. Yuasa. Real-time garbage collection on general-purpose machines. Journal of Systems and Software, 11 (3): 181--198, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Asynchronous assertions

        Recommendations

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in
        • Published in

          cover image ACM Conferences
          OOPSLA '11: Proceedings of the 2011 ACM international conference on Object oriented programming systems languages and applications
          October 2011
          1104 pages
          ISBN:9781450309400
          DOI:10.1145/2048066
          • cover image ACM SIGPLAN Notices
            ACM SIGPLAN Notices  Volume 46, Issue 10
            OOPSLA '11
            October 2011
            1063 pages
            ISSN:0362-1340
            EISSN:1558-1160
            DOI:10.1145/2076021
            Issue’s Table of Contents

          Copyright © 2011 ACM

          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]

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 22 October 2011

          Permissions

          Request permissions about this article.

          Request Permissions

          Check for updates

          Qualifiers

          • research-article

          Acceptance Rates

          Overall Acceptance Rate268of1,244submissions,22%

          Upcoming Conference

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader