skip to main content
article
Free Access

Interprocedural slicing of multithreaded programs with applications to Java

Published:01 November 2006Publication History
Skip Abstract Section

Abstract

Slicing is a well-known program reduction technique where for a given program P and a variable of interest v at some statement P in the program, a program slice contains those set of statements belonging to P that affect v. This article presents two algorithms for interprocedural slicing of concurrent programs--a context-insensitive algorithm and a context-sensitive algorithm. The context-insensitive algorithm is efficient and correct (it includes every statement that may affect the slicing criterion) but is imprecise since it may include certain extra statements that are unnecessary. Precise slicing has been shown to be undecidable for concurrent programs. However, the context-sensitive algorithm computes correct and reasonably precise slices, but has a worst-case exponential-time complexity. Our context-sensitive algorithm computes a closure of dependencies while ensuring that statements sliced in each thread belong to a realizable path in that thread.A realizable path in a thread with procedure calls is one that reflects the fact that when a procedure finishes, execution returns to the site of the most recently executed call in that thread. One of the novelties of this article is a practical solution to determine whether a given set of statements in a thread may belong to a realizable path. This solution is precise even in the presence of recursion and long call chains in the flow graph.The slicing algorithms are applicable to concurrent programs with shared memory, interleaving semantics, explicit wait/notify synchronization and monitors. We first give a solution for a simple model of concurrency and later show how to extend the solution to the Java concurrency model. We have implemented the algorithms for Java bytecode and give experimental results.

References

  1. Agrawal, H., Demillo, R., and Spafford, E. 1993. Debugging with dynamic slicing and backtracking. Softw.---Pract. Exper. 23, 6, 589--616.]] Google ScholarGoogle Scholar
  2. Aho, A., Sethi, R., and Ullman, J. 1986. Compilers: Principles, Techniques and Tools. Addison-Wesley, Reading, MA.]] Google ScholarGoogle Scholar
  3. Beck, J. and Eichmann, D. 1993. Program and interface slicing for reverse engineering. In Proceedings of the 15th International Conference on Software Engineering. IEEE Computer Society Press, Los Alamitos, CA, 509--518.]] Google ScholarGoogle Scholar
  4. Binkley, D. and Gallagher, K. 1996. Program slicing. Advances in Computers 43.]]Google ScholarGoogle Scholar
  5. Binkley, D., Horwitz, S., and Reps, T. 1995. Program integration for languages with procedure calls. ACM Trans. Softw. Eng. Meth. 4, 1 (Jan.), 3--35.]] Google ScholarGoogle Scholar
  6. Burke, M. 1990. An interval-based approach to exhaustive and incremental interprocedural data-flow analysis. ACM Trans. Prog. Lang. Syst. 12, 3 (July).]] Google ScholarGoogle Scholar
  7. Callahan, D. 1988. The program summary graph and flow-sensitive interprocedural data flow analysis. In Proceedings of the Conference on Programming Language Design and Implementation.]] Google ScholarGoogle Scholar
  8. Chen, Z. and Xu, B. 2001. Slicing concurrent Java programs. ACM SIGPLAN Notices 36, 4 (Apr.), 41--47.]] Google ScholarGoogle Scholar
  9. Cheng, J. 1993. Slicing concurrent programs. In Automated and Algorithmic Debugging 1st International Workshop. Lecture Notes in Computer Science, vol 749. Springer-Verlag, New York.]] Google ScholarGoogle Scholar
  10. Choi, J.-D., Gupta, M., Sreedhar, V. C., and Midkiff, S. 1999. Escape analysis for Java. In Proceedings of the Conference on Object-Oriented Programming Systems, Languages and Applications. ACM, New York.]] Google ScholarGoogle Scholar
  11. Cormen, T. H., Leiserson, C. E., and Rivest, R. L. 1990. Introduction to algorithms. MIT press, Cambridge MA.]] Google ScholarGoogle Scholar
  12. Dijkstra, E. W. 1968. Programming Languages. Academic Press, London, England.]]Google ScholarGoogle Scholar
  13. Gallagher, K. B. and Lyle, J. R. 1991. Using program slicing in software maintenance. IEEE Trans. Softw. Eng. 17, 8, 751--761.]] Google ScholarGoogle Scholar
  14. Harman, M., Binkley, D., and Danicic, S. 2003. Amorphous program slicing. J. Syst. Softw. 68, 1, 45--64.]] Google ScholarGoogle Scholar
  15. Harman, M. and Danicic, S. 1995. Using program slicing to simplify testing. Softw. Test. Verifi. Reliab., 143--162.]]Google ScholarGoogle Scholar
  16. Harrold, M. J., Rothermel, G., and Sinha, S. 1998. Computation of interprocedural control dependence. In Proceedings of ACM SIGSOFT International Symposium on Software Testing and Analysis. ACM, New York. 11--20.]] Google ScholarGoogle Scholar
  17. Hatcliff, J., Corbett, J., Dwyer, M., Sokolowski, S., and Zheng, H. 1999. A formal study of slicing for multi-threaded programs with JVM concurrency primitives. In Proceedings of the Conference on International Static Analysis Symposium.]] Google ScholarGoogle Scholar
  18. Horwitz, S., Prins, J., and Reps, T. 1989. Integrating noninterfering versions of programs. ACM Trans. Prog. Lang. Syst. 11, 3, 345--387.]] Google ScholarGoogle Scholar
  19. Horwitz, S., Reps, T., and Binkley, D. 1990. Interprocedural slicing using dependence graphs. ACM Trans. Prog. Lang. Syst. 12, 26--60.]] Google ScholarGoogle Scholar
  20. JavaGrand. Benchmark suite---thread version 1.0. URL http://www.epcc.ed.ac.uk/computing/research_activities/java_grande/.]]Google ScholarGoogle Scholar
  21. Johnson, R. and Pingali, K. 1993. Dependence based program analysis. In Proceedings of the Conference on Programming Language Design and Implementation. ACM, New York. 78--89.]] Google ScholarGoogle Scholar
  22. Krinke, J. 1998. Static slicing of threaded programs. In Proceedings of the Conference on Program Analysis for Software Tools and Engineering (PASTE 98). 35--42.]] Google ScholarGoogle Scholar
  23. Krinke, J. 2003. Context-sensitive slicing of concurrent programs. In Proceedings of the ACM Symposium on the Foundations of Software Engineering. ACM, New York.]] Google ScholarGoogle Scholar
  24. Krishnamurthy, A. and Yelick, K. 1995. Optimizing parallel programs with explicit synchronization. In Proceedings of the Conference on Programming Language Design and Implementation. ACM, New York. 196--204.]] Google ScholarGoogle Scholar
  25. Mü-Olm, M. and Seidl, H. 2001. On optimal slicing of concurrent programs. In Proceedings of the ACM Symposium on Theory of Computing (STOC 2001). ACM, New York. 647--656.]] Google ScholarGoogle Scholar
  26. Millet, L. and Teitelbaum, T. 1998. Slicing Promela and its application to model checking, simulation, and protocol understanding. In Proceedings of the 4th Workshop on Automata Theoretic Verification with the SPIN Model Checker.]]Google ScholarGoogle Scholar
  27. Millet, L. and Teitelbaum, T. 1999. A case for channel dependence analysis: Slicing Promela. In Proceedings of the 1999 International Symposium on Software Engineering for Parallel and Distributed Systems (PDSE'99).]] Google ScholarGoogle Scholar
  28. Nanda, M. G. 2001. Slicing concurrent Java programs: Issues and solutions. Ph.D. thesis, Department of Computer Science and Engineering, Indian Institute of Technology, Bombay. http://www.cse.iitb.ernet.in/~ramesh/gow-thesis.ps.gz; Examiners: Dr. Frank Tip, IBM T. J. Watson Research Center and Prof. R. Mall, Department of Computer Science and Engineering, Indian Institute of Technology, Kharagpur.]]Google ScholarGoogle Scholar
  29. Nanda, M. G., Bhaduri, P., Oberoi, S., and Sanyal, A. 1999. An application of compiler technology to the year 2000 problem. Softw.---Pract. Exper.]] Google ScholarGoogle Scholar
  30. Nanda, M. G. and Ramesh, S. 2000. Slicing concurrent programs. In Proceedings of the International Symposium on Software Testing and Analysis.]] Google ScholarGoogle Scholar
  31. Nanda, M. G. and Ramesh, S. 2003. Pointer analysis of multithreaded Java programs. In Proceedings of the ACM Symposium on Applied Computing. ACM, New York.]] Google ScholarGoogle Scholar
  32. Novillo, D., Unrau, R., and Schaeffer, J. 1998. Concurrent SSA form in the presence of mutual exclusion. In Proceedings of the International Conference on Parallel Processing.]] Google ScholarGoogle Scholar
  33. Ottenstein, K. and Ottenstein, L. 1984. The program dependence graph in a software development environment. In Proceedings of the ACM SIGSOFT/SIGPLAN Software Engineering Symposium on Practical Software Development Environments. ACM, New York. 177--184.]] Google ScholarGoogle Scholar
  34. Ramalingam, G. 2000. Context-sensitive synchronization-sensitive analysis is undecidable. ACM Trans. Program. Lang. Syst. 22, 2, 416--430.]] Google ScholarGoogle Scholar
  35. Ranganath, V. P. and Hatcliff, J. 2004. Pruning interference and ready dependence for slicing concurrent java. In Proceedings of the 13th International Conference on Compiler Construction (CC).]]Google ScholarGoogle Scholar
  36. Reps, T., Horwitz, S., Sagiv, M., and Rosay, G. 1994. Speeding up slicing. In Proceedings of the ACM Symposium on the Foundations of Software Engineering (New Orleans, LA). ACM, New York. 11--20.]] Google ScholarGoogle Scholar
  37. Ruf, E. 2000. Effective synchronization removal for Java. In Proceedings of the Conference on Programming Language Design and Implementation. ACM, New York. 208--218.]] Google ScholarGoogle Scholar
  38. Rugina, R. and Rinard, M. 1999. Pointer analysis for multithreaded programs. In Proceedings of the Conference on Programming Language Design and Implementation. ACM, New York.]] Google ScholarGoogle Scholar
  39. Salcianu, A. and Rinard, M. 2001. Pointer and escape analysis for multithreaded programs. In Proceedings of the ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming. ACM, New York.]] Google ScholarGoogle Scholar
  40. Sarkar, V. 1991. Automatic partitioning of a program dependence graph into parallel tasks. IBM J. Res. Devel. 35, 779--804.]] Google ScholarGoogle Scholar
  41. Sharir, M. and Pnueli, A. 1981. Two approaches to interprocedural data flow analysis. In Program Flow Analysis: Theory and Applications, S. S. Muchnick and N. D. Jones, Eds. Prentice-Hall, Englewood Cliffs, NJ, 189--233.]]Google ScholarGoogle Scholar
  42. Sinha, S., Harrold, M. J., and Rothermel, G. 1999. System-dependence-graph-based slicing of programs with arbitrary interprocedural control flow. In Proceedings of the International Conference on Software Engineering. 432--441.]] Google ScholarGoogle Scholar
  43. Tip, F. 1995. A survey of program slicing techniques. J. Prog. Lang. 3, 121--181.]]Google ScholarGoogle Scholar
  44. Venkatesh, R. 1991. The semantic approach to program slicing. In Proceedings of the Conference on Programming Language Design and Implementation. ACM, New York.]] Google ScholarGoogle Scholar
  45. Weiser, M. 1984. Program slicing. IEEE Trans. Softw. Eng. 10, 352--357.]]Google ScholarGoogle Scholar
  46. Whaley, J. and Rinard, M. 1999. Compositional pointer and escape analysis for Java programs. In Proceedings of the Conference on Object-Oriented Programming Systems, Languages and Applications. ACM, New York.]] Google ScholarGoogle Scholar
  47. Yang, W., Horwitz, S., and Reps, T. 1992. A program integration algorithm that accommodates semantics-preserving transformations. ACM Trans. Softw. Eng. Method. 1, 3 (July), 310--354.]] Google ScholarGoogle Scholar
  48. Zhao, J. 1999. Slicing concurrent Java programs. In Proceedings of the IEEE International Workshop on Program Comprehension. IEEE Computer Society Press, Los Alamitos, CA.]] Google ScholarGoogle Scholar

Index Terms

  1. Interprocedural slicing of multithreaded programs with applications to Java

      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!