skip to main content
10.1145/3650212.3652109acmconferencesArticle/Chapter ViewAbstractPublication PagesisstaConference Proceedingsconference-collections
research-article
Open access

Unimocg: Modular Call-Graph Algorithms for Consistent Handling of Language Features

Published: 11 September 2024 Publication History

Abstract

Traditional call-graph construction algorithms conflate the computation of possible runtime types with the actual resolution of (virtual) calls. This tangled design impedes supporting complex language features and APIs and making systematic trade-offs between precision, soundness, and scalability. It also impedes implementation of precise downstream analyses that rely on type information. To address the problem, we propose Unimocg, a modular architecture for call-graph construction that decouples the computation of type information from resolving calls. Due to its modular design, Unimocg can combine a wide range of different call-graph algorithms with algorithm-agnostic modules to support individual language features. Moreover, these modules operate at the same precision as the chosen call-graph algorithm with no further effort. Additionally, Unimocg allows other analyses to easily reuse type information from the call-graph construction at full precision. We demonstrate how Unimocg enables a framework of call-graph algorithms with different precision, soundness, and scalability trade-offs from reusable modules. Unimocg currently supports ten call-graph algorithms from vastly different families, such as CHA, RTA, XTA, and k-l-CFA. These algorithms show consistent soundness without sacrificing precision or performance. We also show how an immutability analysis is improved using Unimocg.

References

[1]
David F. Bacon and Peter F. Sweeney. 1996. Fast Static Analysis of C++ Virtual Function Calls. In Proceedings of the 11th ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA’96). ACM, 324–341. https://doi.org/10.1145/236337.236371
[2]
Eric Bodden, Andreas Sewe, Jan Sinschek, Hela Oueslati, and Mira Mezini. 2011. Taming Reflection: Aiding Static Analysis in the Presence of Reflection and Custom Class Loaders. In Proceedings of the 33rd International Conference on Software Engineering (ICSE’11). IEEE, 241–250. https://doi.org/10.1145/1985793.1985827
[3]
Martin Bravenboer and Yannis Smaragdakis. 2009. Strictly Declarative Specification of Sophisticated Points-to Analyses. In Proceedings of the 24th ACM SIGPLAN Conference on Object Oriented Programming Systems Languages and Applications (OOPSLA’09). ACM, 243–262. https://doi.org/10.1145/1640089.1640108
[4]
Jeffrey Dean, David Grove, and Craig Chambers. 1995. Optimization of Object-Oriented Programs Using Static Class Hierarchy Analysis. In European Conference on Object-Oriented Programming (ECOOP’95). Springer, 77–101. https://doi.org/10.1007/3-540-49538-X_5
[5]
Jens Dietrich, Henrik Schole, Li Sui, and Ewan Tempero. 2017. XCorpus–An executable Corpus of Java Programs. Journal of Object Technology, 16, 4 (2017), 1:1–1:24. https://doi.org/10.5381/jot.2017.16.4.a1
[6]
Michael Eichberg, Florian Kübler, Dominik Helm, Michael Reif, Guido Salvaneschi, and Mira Mezini. 2018. Lattice Based Modularization of Static Analyses. In Companion Proceedings for the ISSTA/ECOOP 2018 Workshops (SOAP’18). ACM, 113–118. https://doi.org/10.1145/3236454.3236509
[7]
George Fourtounis, George Kastrinis, and Yannis Smaragdakis. 2018. Static Analysis of Java Dynamic Proxies. In Proceedings of the 27th ACM SIGSOFT International Symposium on Software Testing and Analysis (ISSTA’18). ACM, 209–220. https://doi.org/10.1145/3234988
[8]
Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides. 1995. Design Patterns: Elements of Reusable Object-Oriented Software. Addison Wesley.
[9]
David Grove and Craig Chambers. 2001. A Framework for Call Graph Construction Algorithms. ACM Transactions on Programming Languages and Systems, 23, 6 (2001), 685–746. https://doi.org/10.1145/506315.506316
[10]
Dominik Helm, Florian Kübler, Michael Reif, Michael Eichberg, and Mira Mezini. 2020. Modular Collaborative Program Analysis in OPAL. In Proceedings of the 28th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering (ESEC/FSE’20). ACM, 184–196. https://doi.org/10.1145/3368089.3409765
[11]
IBM. 2024. WALA - Static Analysis Framework for Java. http://wala.sourceforge.net/ [Online; accessed 11-March-2024]
[12]
Davy Landman, Alexander Serebrenik, and Jurgen J. Vinju. 2017. Challenges for Static Analysis of Java Reflection – Literature Review and Empirical Study. In Proceedings of the 39th International Conference on Software Engineering (ICSE’17). IEEE, 507–518. https://doi.org/10.1109/ICSE.2017.53
[13]
Ondřej Lhoták and Laurie Hendren. 2003. Scaling Java Points-to Analysis Using Spark. In Compiler Construction (CC’03). Springer, 153–169. https://doi.org/10.1007/3-540-36579-6_12
[14]
Ondřej Lhoták and Laurie Hendren. 2006. Context-Sensitive Points-to Analysis: Is It Worth It? In International Conference on Compiler Construction (CC’06). 47–64. https://doi.org/10.1007/11688839_5
[15]
Benjamin Livshits, John Whaley, and Monica S. Lam. 2005. Reflection Analysis for Java. In Asian Symposium on Programming Languages and Systems (APLAS’05). Springer, 139–160. https://doi.org/10.1007/11575467_11
[16]
Michael Reif, Florian Kübler, Michael Eichberg, Dominik Helm, and Mira Mezini. 2019. Judge: Identifying, Understanding, and Evaluating Sources of Unsoundness in Call Graphs. In Proceedings of the 28th ACM SIGSOFT International Symposium on Software Testing and Analysis (ISSTA’19). ACM, 251–261. https://doi.org/10.1145/3293882.3330555
[17]
Michael Reif, Florian Kübler, Michael Eichberg, and Mira Mezini. 2018. Systematic Evaluation of the Unsoundness of Call Graph Construction Algorithms for Java. In Companion Proceedings for the ISSTA/ECOOP 2018 Workshops (SOAP’18). ACM, 107–112. https://doi.org/10.1145/3236454.3236503
[18]
Michael Reif, Florian Kübler, Dominik Helm, Ben Hermann, Michael Eichberg, and Mira Mezini. 2020. TACAI: An Intermediate Representation Based on Abstract Interpretation. In Proceedings of the 9th ACM SIGPLAN International Workshop on the State Of the Art in Program Analysis (SOAP’20). ACM, 2–7. https://doi.org/10.1145/3394451.3397204
[19]
John R. Rose. 2009. Bytecodes meet Combinators: invokedynamic on the JVM. In Proceedings of the Third Workshop on Virtual Machines and Intermediate Languages (VMIL’09). ACM, 2:1–2:11. https://doi.org/10.1145/1711506.1711508
[20]
Tobias Roth, Dominik Helm, Michael Reif, and Mira Mezini. 2021. CiFi: Versatile Analysis of Class and Field Immutability. In 2021 36th IEEE/ACM International Conference on Automated Software Engineering (ASE’21). IEEE, 979–990. https://doi.org/10.1109/ASE51524.2021.9678903
[21]
Joanna C. S. Santos, Reese A. Jones, Chinomso Ashiogwu, and Mehdi Mirakhorli. 2021. Serialization-Aware Call Graph Construction. In Proceedings of the 10th ACM SIGPLAN International Workshop on the State Of the Art in Program Analysis (SOAP’21). ACM, 37–42. https://doi.org/10.1145/3460946.3464319
[22]
Joanna C. S. Santos, Reese A. Jones, and Mehdi Mirakhorli. 2020. Salsa: Static Analysis of Serialization Features. In Proceedings of the 22nd ACM SIGPLAN International Workshop on Formal Techniques for Java-Like Programs (FTfJP’20). ACM, 18–25. https://doi.org/10.1145/3427761.3428343
[23]
Olin Shivers. 1988. Control Flow Analysis in Scheme. In Proceedings of the ACM SIGPLAN 1988 Conference on Programming Language Design and Implementation (PLDI’88). ACM, 164–174. https://doi.org/10.1145/53990.54007
[24]
Olin Shivers. 1991. Control-Flow Analysis of Higher-Order Languages of Taming Lambda. Ph. D. Dissertation. USA.
[25]
Yannis Smaragdakis, Martin Bravenboer, and Ondřej Lhoták. 2011. Pick Your Contexts Well: Understanding Object-Sensitivity. In Proceedings of the 38th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL’11). ACM, 17–30. https://doi.org/10.1145/1926385.1926390
[26]
Li Sui, Jens Dietrich, Michael Emery, Shawn Rasheed, and Amjed Tahir. 2018. On the Soundness of Call Graph Construction in the Presence of Dynamic Language Features - A Benchmark and Tool Evaluation. In Programming Languages and Systems (APLAS’18). Springer, 69–88. https://doi.org/10.1007/978-3-030-02768-1_4
[27]
Li Sui, Jens Dietrich, Amjed Tahir, and George Fourtounis. 2020. On the Recall of Static Call Graph Construction in Practice. In Proceedings of the ACM/IEEE 42nd International Conference on Software Engineering (ICSE’20). ACM, 1049–1060. https://doi.org/10.1145/3377811.3380441
[28]
Vijay Sundaresan, Laurie Hendren, Chrislain Razafimahefa, Raja Vallée-Rai, Patrick Lam, Etienne Gagnon, and Charles Godin. 2000. Practical Virtual Method Call Resolution for Java. In Proceedings of the 15th ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA’00). ACM, 264–280. https://doi.org/10.1145/354222.353189
[29]
Frank Tip and Jens Palsberg. 2000. Scalable Propagation-Based Call Graph Construction Algorithms. In Proceedings of the 15th ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA’00). ACM, 281–293. https://doi.org/10.1145/353171.353190
[30]
Raja Vallée-Rai, Phong Co, Etienne Gagnon, Laurie Hendren, Patrick Lam, and Vijay Sundaresan. 1999. Soot - a Java Bytecode Optimization Framework. In Proceedings of the 1999 Conference of the Centre for Advanced Studies on Collaborative Research (CASCON’99). IBM Press, 13.
[31]
Raja Vallée-Rai and Laurie J. Hendren. 1998. Jimple: Simplifying Java Bytecode for Analyses and Transformations. Sable Research Group. McGill University.

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
ISSTA 2024: Proceedings of the 33rd ACM SIGSOFT International Symposium on Software Testing and Analysis
September 2024
1928 pages
ISBN:9798400706127
DOI:10.1145/3650212
This work is licensed under a Creative Commons Attribution International 4.0 License.

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 11 September 2024

Permissions

Request permissions for this article.

Check for updates

Badges

Author Tags

  1. Call Graph
  2. Modularization
  3. Static Analysis
  4. Type Analysis

Qualifiers

  • Research-article

Funding Sources

  • Deutsche Forschungsgemeinschaft

Conference

ISSTA '24
Sponsor:

Acceptance Rates

Overall Acceptance Rate 58 of 213 submissions, 27%

Upcoming Conference

ISSTA '25

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • 0
    Total Citations
  • 197
    Total Downloads
  • Downloads (Last 12 months)197
  • Downloads (Last 6 weeks)36
Reflects downloads up to 27 Feb 2025

Other Metrics

Citations

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Login options

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media