Conditional Correlation Analysis for Safe Region-based Memory Management

被引:5
|
作者
Wang, Xi [1 ]
Xu, Zhilei [1 ]
Liu, Xuezheng [2 ]
Guo, Zhenyu [2 ]
Wang, Xiaoge [1 ]
Zhang, Zheng [2 ]
机构
[1] Tsinghua Univ, Beijing, Peoples R China
[2] Microsoft Res Asia, Beijing, Peoples R China
关键词
region; conditional correlation; program analysis; error detection; memory management;
D O I
10.1145/1375581.1375588
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Region-based memory management is a popular scheme in systems software for better organization and performance. In the scheme, a developer constructs a hierarchy of regions of different lifetimes and allocates objects in regions. When the developer deletes a region, the runtime will recursively delete all its subregions and simultaneously reclaim objects in the regions. The developer must construct a consistent placement of objects in regions; otherwise, if a region that contains pointers to other regions is not always deleted before pointees, an inconsistency will surface and cause dangling pointers, which may lead to either crashes or leaks. This paper presents a static analysis tool RegionWiz that can find such lifetime inconsistencies in large C programs using regions. The tool is based on an analysis framework that generalizes the relations and constraints over regions and objects as conditional correlations. This framework allows a succinct formalization of consistency rules for region lifetimes, preserving memory safety and avoiding dangling pointers. RegionWiz uses these consistency rules to implement an efficient static analysis to compute the conditional correlation and reason about region lifetime consistency; the analysis is based on a context-sensitive, field-sensitive pointer analysis with heap cloning, Experiments with applying RegionWiz to six real-world software packages (including the RC compiler, Apache web server, and Subversion version control system) with two different region-based memory management interfaces show that RegionWiz can reason about region lifetime consistency in large C programs. The experiments also show that RegionWiz can find several previously unknown inconsistency bugs in these packages.
引用
收藏
页码:45 / +
页数:3
相关论文
共 50 条
  • [1] Conditional correlation analysis for safe region-based memory management
    Wang, Xi
    Xu, Zhilei
    Liu, Xuezheng
    Guo, Zhenyu
    Wang, Xiaoge
    Zhang, Zheng
    [J]. ACM SIGPLAN NOTICES, 2008, 43 (06) : 45 - 55
  • [2] Region-based memory management
    Tofte, M
    Talpin, JP
    [J]. INFORMATION AND COMPUTATION, 1997, 132 (02) : 109 - 176
  • [3] Fast Escape Analysis for Region-based Memory Management
    Salagnac, G.
    Yovine, S.
    Garbervetsky, D.
    [J]. ELECTRONIC NOTES IN THEORETICAL COMPUTER SCIENCE, 2005, 131 : 99 - 110
  • [4] Region-based memory management in cyclone
    Grossman, D
    Morrisett, G
    Jim, T
    Hicks, M
    Wang, YL
    Cheney, J
    [J]. ACM SIGPLAN NOTICES, 2002, 37 (05) : 282 - 293
  • [5] Region-based memory management for Mercury programs
    Phan, Quan
    Janssens, Gerda
    Somogyi, Zoltan
    [J]. THEORY AND PRACTICE OF LOGIC PROGRAMMING, 2013, 13 : 959 - 1024
  • [6] Ownership types for safe region-based memory management in real-time Java']Java
    Boyapati, C
    Salcianu, A
    Beebee, W
    Rinard, M
    [J]. ACM SIGPLAN NOTICES, 2003, 38 (05) : 324 - 337
  • [7] Region-Based RTSJ Memory Management: State of the art
    Hamza, H.
    Counsell, S.
    [J]. SCIENCE OF COMPUTER PROGRAMMING, 2012, 77 (05) : 644 - 659
  • [8] Runtime Support for Region-Based Memory Management in Mercury
    Phan, Quan
    Somogyi, Zoltan
    Janssens, Gerda
    [J]. ISMM'08: PROCEEDINGS OF THE 2008 INTERNATIONAL SYMPOSIUM ON MEMORY MANAGEMENT, 2008, : 61 - +
  • [9] Garbage collection safety for region-based memory management
    Elsman, M
    [J]. ACM SIGPLAN NOTICES, 2003, 38 (03) : 123 - 134
  • [10] Region-based memory management for a dynamically-typed language
    Nagata, A
    Kobayashi, N
    Yonezawa, A
    [J]. PROGRAMMING LANGUAGES AND SYSTEMS, PROCEEDINGS, 2004, 3302 : 229 - 245