skip to main content
10.1145/1168857.1168864acmconferencesArticle/Chapter ViewAbstractPublication PagesasplosConference Proceedingsconference-collections
Article

AVIO: detecting atomicity violations via access interleaving invariants

Published:20 October 2006Publication History

ABSTRACT

Concurrency bugs are among the most difficult to test and diagnose of all software bugs. The multicore technology trend worsens this problem. Most previous concurrency bug detection work focuses on one bug subclass, data races, and neglects many other important ones such as atomicity violations, which will soon become increasingly important due to the emerging trend of transactional memory models.This paper proposes an innovative, comprehensive, invariantbased approach called AVIO to detect atomicity violations. Our idea is based on a novel observation called access interleaving invariant, which is a good indication of programmers' assumptions about the atomicity of certain code regions. By automatically extracting such invariants and detecting violations of these invariants at run time, AVIO can detect a variety of atomicity violations.Based on this idea, we have designed and built two implementations of AVIO and evaluated the trade-offs between them. The first implementation, AVIO-S, is purely in software, while the second, AVIO-H, requires some simple extensions to the cache coherence hardware. AVIO-S is cheaper and more accurate but incurs much higher overhead and thus more run-time perturbation than AVIOH. Therefore, AVIO-S is more suitable for in-house bug detection and postmortem bug diagnosis, while AVIO-H can be used for bug detection during production runs.We evaluate both implementations of AVIO using large realworld server applications (Apache and MySQL) with six representative real atomicity violation bugs, and SPLASH-2 benchmarks. Our results show that AVIO detects more tested atomicity violations of various types and has 25 times fewer false positives than previous solutions on average.

References

  1. C.S. Ananian, K. Asanovic, B.C. Kuszmaul, C.E. Leiserson, and S. Lie. Unbounded transactional memory. In HPCA, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. L.A. Barroso, K. Gharachorloo, R. McNamara, A. Nowatzyk, S. Qadeer, B. Sano, S. Smith, R. Stets, and B. Verghese. Piranha: a scalable architecture based on single-chip multiprocessing. In ISCA, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. C. Boyapati, R. Lee, and M. Rinard. Ownership types for safe programming: Preventing data races and deadlocks. In OOPSLA, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. M. Burrows and K.R.M. Leino. Finding stale-value errors in concurrent programs. In Compaq SRC Technical Note 2002-04, 2002.Google ScholarGoogle Scholar
  5. S. Chandra and P.M. Chen. How fail-stop are faulty programs? In FTCS, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. J.-D. Choi et al. Efficient and precise datarace detection for multithreaded object-oriented programs. In PLDI, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. A. Dinning and E. Schonberg. An empirical comparison of monitoring algorithms for access anomaly detection. In PPoPP, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. D. Engler and K. Ashcraft. RacerX: Effective, static detection of race conditions and deadlocks. In SOSP, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. M. Ernst, A. Czeisler, W.G. Griswold, and D. Notkin. Quickly detecting relevant program invariants. In ICSE, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. C. Flanagan and S.N. Freund. Type-based race detection for java. In PLDI, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. C. Flanagan and S.N. Freund. Atomizer: a dynamic atomicity checker for multithreaded programs. In POPL, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. C. Flanagan and S. Qadeer. A type and effect system for atomicity. In PLDI, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. L. Hammond, V. Wong, M. Chen, B.D. Carlstrom, J.D. Davis, B. Hertzberg, M.K. Prabhu, H. Wijaya, C. Kozyrakis, and K. Olukotun. Transactional memory coherence and consistency. In ISCA, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. S. Hangal and M.S. Lam. Tracking down software bugs using automatic anomaly detection. In ICSE, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. N. Hardavellas, S. Somogyi, T.F. Wenisch, R.E. Wunderlich, S. Chen, J. Kim, B. Falsafi, J.C. Hoe, and A.G. Nowatzyk. Simflex: a fast, accurate, flexible full-system simulation framework for performance evaluation of server architecture. SIGMETRICS Perform. Eval. Rev., 31(4), 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. T. Harris and K. Fraser. Language support for lightweight transactions. In OOPSLA, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. T.A. Henzinger, R. Jhala, and R. Majumdar. Race checking by context inference. In PLDI, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. M. Herlihy and J.E.B. Moss. Transactional memory: architectural support for lock-free data structures. In ISCA, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. L. Lamport. Time, clocks, and the ordering of events in a distributed system. Communications of the ACM, 21(7):558--565, July 1978. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. B. Liblit, A. Aiken, A.X. Zheng, and M.I. Jordan. Bug isolation via remote program sampling. In PLDI, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. C.-K. Luk, R. Cohn, R. Muth, H. Patil, A. Klauser, G. Lowney, S. Wallace, V.J. Reddi, and K. Hazelwood. Pin: building customized program analysis tools with dynamic instrumentation. In PLDI, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. P.S. Magnusson, F. Dahlgren, H. Grahn, M. Karlsson, F. Larsson, F. Lundholm, A. Moestedt, J. Nilsson, P. Stenstrom, and B. Werner. Simics/sun4m: A virtual workstation. In Usenix Annual Technical Conference, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. S.L. Min and J.-D. Choi. An efficient cache-based access anomaly detection scheme. In ASPLOS, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. S. Narayanasamy, G. Pokam, and B. Calder. Bugnet: Continuously recording program execution for deterministic replay debugging. In ISCA, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. N. Nethercote and J. Seward. Valgrind: A program supervision framework. ENTCS, 2003.Google ScholarGoogle Scholar
  26. R.H.B. Netzer and B.P. Miller. Improving the accuracy of data race detection. In PPoPP, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. R. O'Callahan and J.-D. Choi. Hybrid dynamic data race detection. In PPoPP, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. D. Perkovic and P.J. Keleher. Online data-race detection via coherency guarantees. In OSDI, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. E. Pozniansky and A. Schuster. Efficient on-the-fly data race detection in multithreaded c++ programs. In PPoPP, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. M. Prvulovic. Cord:cost-effective (and nearly overhead-free) orderreordering and data race detection. In HPCA, 2006.Google ScholarGoogle Scholar
  31. M. Prvulovic and J. Torrellas. ReEnact: Using thread-level speculation mechanisms to debug data races in multithreaded codes. In ISCA, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. B. Richards and J.R. Larus. Protocol-based data-race detection. In SPDT, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. A. Sasturkar, R. Agarwal, L. Wang, and S.D. Stoller. Automated type-based analysis of data races and atomicity. In PPoPP, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. S. Savage, M. Burrows, G. Nelson, P. Sobalvarro, and T. Anderson. Eraser: A dynamic data race detector for multithreaded programs. ACM TOCS, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. SecurityFocus. Software bug contributed to blackout.Google ScholarGoogle Scholar
  36. N. Tuck, B. Calder, and G. Varghese. Hardware and binary modification support for code pointer protection from buffer overflow. In MICRO, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. M. Vaziri, F. Tip, and J. Dolby. Associating synchronization constraints with data in an object-oriented language. In POPL, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. C. von Praun and T.R. Gross. Object race detection. In OOPSLA, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. L. Wang and S.D. Stoller. Static analysis for programs with nonblocking synchronization. In PPoPP, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. S.C. Woo, M. Ohara, E. Torrie, J.P. Singh, and A. Gupta. The SPLASH-2 programs: Characterization and methodological considerations. In ISCA, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. M. Xu, R. Bodik, and M.D. Hill. A "flight data recorder" for enabling full-system multiprocessor deterministic replay. In ISCA, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. M. Xu, R. Bodík, and M.D. Hill. A serializability violation detector for shared-memory server programs. In PLDI, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. Y. Yu, T. Rodeheffer, and W. Chen. Racetrack: Efficient detection of data race conditions via adaptive tracking. In SOSP, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. P. Zhou, W. Liu, F. Long, S. Lu, F. Qin, Y. Zhou, S. Midkiff, and J. Torrellas. AccMon: Automatically Detecting Memory-Related Bugs via Program Counter-based Invariants. In MICRO, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. P. Zhou, F. Qin, W. Liu, Y. Zhou, and J. Torrellas. iWatcher: Efficient Architecture Support for Software Debugging. In ISCA, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. AVIO: detecting atomicity violations via access interleaving invariants

        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

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader
        About Cookies On This Site

        We use cookies to ensure that we give you the best experience on our website.

        Learn more

        Got it!