skip to main content
research-article

Sound and precise analysis of parallel programs through schedule specialization

Published:11 June 2012Publication History
Skip Abstract Section

Abstract

Parallel programs are known to be difficult to analyze. A key reason is that they typically have an enormous number of execution interleavings, or schedules. Static analysis over all schedules requires over-approximations, resulting in poor precision; dynamic analysis rarely covers more than a tiny fraction of all schedules. We propose an approach called schedule specialization to analyze a parallel program over only a small set of schedules for precision, and then enforce these schedules at runtime for soundness of the static analysis results. We build a schedule specialization framework for C/C++ multithreaded programs that use Pthreads. Our framework avoids the need to modify every analysis to be schedule-aware by specializing a program into a simpler program based on a schedule, so that the resultant program can be analyzed with stock analyses for improved precision. Moreover, our framework provides a precise schedule-aware def-use analysis on memory locations, enabling us to build three highly precise analyses: an alias analyzer, a data-race detector, and a path slicer. Evaluation on 17 programs, including 2 real-world programs and 15 popular benchmarks, shows that analyses using our framework reduced may-aliases by 61.9%, false race reports by 69%, and path slices by 48.7%; and detected 7 unknown bugs in well-checked programs.

References

  1. The LLVM compiler framework. http://llvm.org.Google ScholarGoogle Scholar
  2. The Princeton application repository for shared-memory computers (PARSEC). http://parsec.cs.princeton.edu/.Google ScholarGoogle Scholar
  3. Parallel BZIP2 (PBZIP2). http://compression.ca/pbzip2/.Google ScholarGoogle Scholar
  4. Stanford parallel applications for shared memory (SPLASH). http://www-flash.stanford.edu/apps/SPLASH/.Google ScholarGoogle Scholar
  5. STP Constraint Solver. https://sites.google.com/site/stpfastprover/.Google ScholarGoogle Scholar
  6. H. Agrawal and J. R. Horgan. Dynamic program slicing. In Proceedings of the ACM SIGPLAN '90 Conference on Programming Language Design and Implementation (PLDI '90), pages 246--256, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Apache Web Server. http://www.apache.org.Google ScholarGoogle Scholar
  8. A. Aviram, S.-C. Weng, S. Hu, and B. Ford. Efficient system-enforced deterministic parallelism. In Proceedings of the Ninth Symposium on Operating Systems Design and Implementation (OSDI '10), Oct. 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. D. Avots, M. Dalton, V. B. Livshits, and M. S. Lam. Improving software security with a C pointer analysis. In Proceedings of the 27th International Conference on Software Engineering (ICSE '05), pages 332--341, May 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. T. Bergan, O. Anderson, J. Devietti, L. Ceze, and D. Grossman. CoreDet: a compiler and runtime system for deterministic multithreaded execution. In Fifteenth International Conference on Architecture Support for Programming Languages and Operating Systems (ASPLOS '10), pages 53--64, Mar. 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. T. Bergan, N. Hunt, L. Ceze, and S. D. Gribble. Deterministic process groups in dOS. In Proceedings of the Ninth Symposium on Operating Systems Design and Implementation (OSDI '10), pages 1--16, Oct. 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. E. Berger, T. Yang, T. Liu, D. Krishnan, and A. Novark. Grace: safe and efficient concurrent programming. In Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA '09), pages 81--96, Oct. 2009.Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. O. A. R. Board. OpenMP application program interface version 3.0, May 2008.Google ScholarGoogle Scholar
  14. C. Consel and O. Danvy. Tutorial notes on partial evaluation. In Proceedings of the 20th Annual Symposium on Principles of Programming Languages (POPL '93), pages 493--501, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. M. Costa, M. Castro, L. Zhou, L. Zhang, and M. Peinado. Bouncer: securing software by blocking bad input. In Proceedings of the 21st ACM Symposium on Operating Systems Principles (SOSP '07), pages 117--130, Oct. 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. H. Cui, J. Wu, C.-C. Tsai, and J. Yang. Stable deterministic multithreading through schedule memoization. In Proceedings of the Ninth Symposium on Operating Systems Design and Implementation (OSDI '10), Oct. 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. H. Cui, J. Wu, J. Gallagher, H. Guo, and J. Yang. Efficient deterministic multithreading through schedule relaxation. In Proceedings of the 23rd ACM Symposium on Operating Systems Principles (SOSP '11), Oct. 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. J. Devietti, B. Lucia, L. Ceze, and M. Oskin. DMP: deterministic shared memory multiprocessing. In Fourteenth International Conference on Architecture Support for Programming Languages and Operating Systems (ASPLOS '09), pages 85--96, Mar. 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Q. Gao, W. Zhang, Z. Chen, M. Zheng, and F. Qin. 2ndStrike: towards manifesting hidden concurrency typestate bugs. In Sixteenth International Conference on Architecture Support for Programming Languages and Operating Systems (ASPLOS '11), pages 239--250, Mar. 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. R. Glück and J. Jørgensen. Efficient multi-level generating extensions for program specialization. In Proceedings of the 7th International Symposium on Programming Languages: Implementations, Logics and Programs, pages 259--278, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. R. Jhala and R. Majumdar. Path slicing. In Proceedings of the ACM SIGPLAN 2005 Conference on Programming Language Design and Implementation (PLDI '05), pages 38--47, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. J. Jørgensen. Generating a compiler for a lazy language by partial evaluation. In Proceedings of the 19th Annual Symposium on Principles of Programming Languages (POPL '92), pages 258--268, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. N. G. Leveson and C. S. Turner. An investigation of the therac-25 accidents. Computer, 26 (7): 18--41, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. T. Liu, C. Curtsinger, and E. D. Berger. DTHREADS: efficient deterministic multithreading. In Proceedings of the 23rd ACM Symposium on Operating Systems Principles (SOSP '11), Oct. 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. S. Lu, S. Park, E. Seo, and Y. Zhou. Learning from mistakes: a comprehensive study on real world concurrency bug characteristics. In Thirteenth International Conference on Architecture Support for Programming Languages and Operating Systems (ASPLOS '08), pages 329--339, Mar. 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. G. C. Necula, S. McPeak, and W. Weimer. CCured: type-safe retrofitting of legacy code. In Proceedings of the 29th Annual Symposium on Principles of Programming Languages(POPL '02), pages 128--139, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. V. Nirkhe and W. Pugh. Partial evaluation of high-level imperative programming languages with applications in hard real-time systems. In Proceedings of the 19th Annual Symposium on Principles of Programming Languages (POPL '92), pages 269--280, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. M. Olszewski, J. Ansel, and S. Amarasinghe. Kendo: efficient deterministic multithreading in software. In Fourteenth International Conference on Architecture Support for Programming Languages and Operating Systems (ASPLOS '09), pages 97--108, Mar. 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. S. Park, S. Lu, and Y. Zhou. CTrigger: exposing atomicity violation bugs from their hiding places. In Fourteenth International Conference on Architecture Support for Programming Languages and Operating Systems (ASPLOS '09), pages 25--36, Mar. 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. K. Poulsen. Software bug contributed to blackout. http://www.securityfocus.com/news/8016, Feb. 2004.Google ScholarGoogle Scholar
  31. T. Reps and T. Turnidge. Program specialization via program slicing. In Proceedings of the Dagstuhl Seminar on Partial Evaluation, volume 1101, pages 409--429. Springer-Verlag, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. M. Ronsse and K. De Bosschere. Recplay: a fully integrated practical record/replay system. ACM Trans. Comput. Syst., 17 (2): 133--152, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. R. Rugina and M. Rinard. Symbolic bounds analysis of pointers, array indices, and accessed memory regions. In Proceedings of the ACM SIGPLAN 2000 Conference on Programming Language Design and Implementation (PLDI '00), pages 182--195, June 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. The Open Group and the IEEE. POSIX.1-2008. http://pubs.opengroup.org/onlinepubs/9699919799/, 2008.Google ScholarGoogle Scholar
  35. M. D. Weiser. Program slices: formal, psychological, and practical investigations of an automatic program abstraction method. PhD thesis, 1979. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. J. Whaley and M. S. Lam. Cloning-based context-sensitive pointer alias analysis using binary decision diagrams. In Proceedings of the ACM SIGPLAN 2004 Conference on Programming Language Design and Implementation (PLDI '04), pages 131--144, June 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. J. Yang, A. Cui, J. Gallagher, S. Stolfo, and S. Sethumadhavan. Concurrency attacks. Technical Report CUCS-028-11, Columbia University.Google ScholarGoogle Scholar
  38. W. Zhang, C. Sun, and S. Lu. ConMem: detecting severe concurrency bugs through an effect-oriented approach. In Fifteenth International Conference on Architecture Support for Programming Languages and Operating Systems (ASPLOS '10), pages 179--192, Mar. 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. W. Zhang, J. Lim, R. Olichandran, J. Scherpelz, G. Jin, S. Lu, and T. Reps. ConSeq: detecting concurrency bugs through sequential errors. In Sixteenth International Conference on Architecture Support for Programming Languages and Operating Systems (ASPLOS '11), pages 251--264, Mar. 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. X. Zhang and R. Gupta. Cost effective dynamic program slicing. In Proceedings of the ACM SIGPLAN 2004 Conference on Programming Language Design and Implementation (PLDI '04), pages 94--106, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Sound and precise analysis of parallel programs through schedule specialization

                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

                Full Access

                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!