Parallel Assertions for Architectures with Weak Memory Models

  • Daniel Schwartz-Narbonne
  • Georg Weissenbacher
  • Sharad Malik
Part of the Lecture Notes in Computer Science book series (LNCS, volume 7561)

Abstract

Assertions are a powerful and widely used debugging tool in sequential programs, but are ineffective at detecting concurrency bugs. We recently introduced parallel assertions which solve this problem by providing programmers with a simple and powerful tool to find bugs in parallel programs. However, while modern computer hardware implements weak memory models, the sequentially consistent semantics of parallel assertions prevents these assertions from detecting some feasible bugs. We present a formal semantics for parallel assertions that accounts for the effects of weak memory models. This new formal semantics allows us to prove the correctness of two key optimizations which significantly increase the speed of a runtime assertion checker on a set of PARSEC benchmarks. We discuss the probe effect caused by checking these assertions at runtime, and show how our new semantics allows the detection of bugs that were undetectable in the previous semantics.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Intel 64 and IA-32 architectures software developer’s manual (March 2012)Google Scholar
  2. 2.
    Alglave, J., Maranget, L., Sarkar, S., Sewell, P.: Fences in weak memory models (extended version). Formal Methods in System Design 40(2) (2012)Google Scholar
  3. 3.
    Anderson, Z., Gay, D., Ennals, R., Brewer, E.: SharC: checking data sharing strategies for multithreaded C. In: PLDI. ACM (2008)Google Scholar
  4. 4.
    Boehm, H.-J., Adve, S.V.: Foundations of the C++ concurrency memory model. In: PLDI. ACM (2008)Google Scholar
  5. 5.
    Burnim, J., Sen, K., Stergiou, C.: Testing concurrent programs on relaxed memory models. In: ISSTA. ACM (2011)Google Scholar
  6. 6.
    Chong, N., Ishtiaq, S.: Reasoning about the ARM weakly consistent memory model. In: MSPC. ACM (2008)Google Scholar
  7. 7.
    International Standard 14882 (Programming Languages) C++, Final Committee Draft N3092 (March 2010), ISO/IECGoogle Scholar
  8. 8.
    Jonsson, B.: State-space exploration for concurrent algorithms under weak memory orderings (preliminary version). SIGARCH Comput. Archit. News 36(5) (2009)Google Scholar
  9. 9.
    Lattner, C., Adve, V.: LLVM: A compilation framework for lifelong program analysis & transformation. In: Code Generation and Optimization. IEEE (2004)Google Scholar
  10. 10.
    Liu, F., Nedev, N., Prisadnikov, N., Vechev, M., Yahav, E.: Dynamic synthesis for relaxed memory models. In: PLDI. ACM (2012)Google Scholar
  11. 11.
    Lu, S., Park, S., Seo, E., Zhou, Y.: Learning from mistakes: a comprehensive study on real world concurrency bug characteristics. In: ASPLOS. ACM (2008)Google Scholar
  12. 12.
    Schwartz-Narbonne, D., Liu, F., August, D., Malik, S.: passert: A Tool for Debugging Parallel Programs. In: Madhusudan, P., Seshia, S.A. (eds.) CAV 2012. LNCS, vol. 7358, pp. 751–757. Springer, Heidelberg (2012)CrossRefGoogle Scholar
  13. 13.
    Schwartz-Narbonne, D., Liu, F., Pondicherry, T., August, D.I., Malik, S.: Parallel assertions for debugging parallel programs. In: MEMOCODE. IEEE (2011)Google Scholar
  14. 14.
    Sen, K., Rosu, G., Agha, G.: Runtime safety analysis of multithreaded programs. In: ESEC/FSE. ACM (2003)Google Scholar
  15. 15.
    Vechev, M., Yahav, E., Yorsh, G.: Phalanx: parallel checking of expressive heap assertions. In: ISMM. ACM (2010)Google Scholar
  16. 16.
    Xu, M., Bodik, R., Hill, M.D.: A hardware memory race recorder for deterministic replay. IEEE Micro 27(1) (2007)Google Scholar
  17. 17.
    Yu, J., Narayanasamy, S.: A case for an interleaving constrained shared-memory multi-processor. In: ISCA. ACM (2009)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2012

Authors and Affiliations

  • Daniel Schwartz-Narbonne
    • 1
  • Georg Weissenbacher
    • 1
    • 2
  • Sharad Malik
    • 1
  1. 1.Princeton UniversityUSA
  2. 2.Vienna University of TechnologyAustria

Personalised recommendations