Taming and dissecting recursions through interprocedural weak topological ordering

Jiawei Yang, Xiao Cheng, Bor-Yuh Evan Chang, Xiapu Luo, Yulei Sui

Research output: Chapter in Book/Report/Conference proceedingConference proceeding contributionpeer-review

6 Downloads (Pure)

Abstract

Abstract interpretation provides a foundational framework for approximating program semantics by interpreting code through abstract domains using semantic functions over ordered sets along a program’s control flow graph (CFG). To facilitate fixpoint computation in abstract interpretation, weak topological ordering (WTO) is an effective strategy for handling loops, as it identifies strategic control points in the CFG where widening and narrowing operations should be applied. However, existing abstract interpreters still face challenges when extending WTO computation in the presence of recursive programs. Computing a precise whole-program WTO requires full context-sensitive analysis which is not scalable for large programs, while context-insensitive analysis introduces spurious cycles that compromise precision. Current approaches either ignore recursion (resulting in unsoundness) or rely on conservative approximations, sacrificing precision by adopting the greatest elements of abstract domains and applying widening at function boundaries without subsequent narrowing refinements. These can lead to undesired results for downstream tasks, such as bug detection.

To address the above limitations, we present RecTopo, a new technique to boost the efficiency of precise abstract interpretation in the presence of recursive programs through interprocedural weak topological ordering (IWTO). Rather than pursuing an expensive whole-program WTO analysis, RecTopo employs an on-demand approach that strategically decomposes programs at recursion boundaries and constructs targeted IWTOs for each recursive component. RecTopo dissects and analyzes (nested) recursions through interleaved widening and narrowing operations. This approach enables precise control over interpretation ordering within recursive structures while eliminating spurious recursions through systematic correlation of control flow and call graphs.

We implemented RecTopo and evaluated its effectiveness using an assertion-based checking client focused on buffer overflow detection, comparing it against three popular open-source abstract interpreters (IKOS, Clam, CSA). The experiments on 8312 programs from the NIST dataset demonstrate that, on average, RecTopo is 31.99% more precise and achieves a 17.49% higher recall rate compared to three other tools. Moreover, RecTopo exhibits an average precision improvement of 46.51% and a higher recall rate of 32.98% compared to our baselines across ten large open-source projects. Further ablation studies reveal that IWTO reduces spurious widening operations compared to whole-program WTO, resulting in a 12.83% reduction in analysis time.

Original languageEnglish
Title of host publication39th European Conference on Object-Oriented Programming (ECOOP 2025)
EditorsJonathan Aldrich, Alexandra Silva
Place of PublicationGermany
PublisherDagstuhl Publishing
Pages1-31
Number of pages31
ISBN (Electronic)9783959773737
DOIs
Publication statusPublished - Jun 2025
Externally publishedYes
Event39th European Conference on Object-Oriented Programming, ECOOP 2025 - Bergen, Norway
Duration: 30 Jun 20252 Jul 2025

Publication series

NameLIPIcs - Leibniz International Proceedings in Informatics
PublisherDagstuhl Publishing
Volume333
ISSN (Electronic)1868-8969

Conference

Conference39th European Conference on Object-Oriented Programming, ECOOP 2025
Country/TerritoryNorway
CityBergen
Period30/06/252/07/25

Bibliographical note

Copyright the Author(s). Version archived for private and non-commercial use with the permission of the author/s and according to publisher conditions. For further rights please contact the publisher.

Keywords

  • Abstract interpretation
  • recursion
  • weak topological ordering

Fingerprint

Dive into the research topics of 'Taming and dissecting recursions through interprocedural weak topological ordering'. Together they form a unique fingerprint.

Cite this