Inference of Resource Management Specifications

Author:

Shadab Narges1ORCID,Gharat Pritam2ORCID,Tiwari Shrey2ORCID,Ernst Michael D.3ORCID,Kellogg Martin4ORCID,Lahiri Shuvendu K.5ORCID,Lal Akash2ORCID,Sridharan Manu1ORCID

Affiliation:

1. University of California, Riverside, Riverside, USA

2. Microsoft Research, Bengaluru, India

3. University of Washington, Seattle, USA

4. New Jersey Institute of Technology, Newark, USA

5. Microsoft Research, Redmond, USA

Abstract

A resource leak occurs when a program fails to free some finite resource after it is no longer needed. Such leaks are a significant cause of real-world crashes and performance problems. Recent work proposed an approach to prevent resource leaks based on checking resource management specifications. A resource management specification expresses how the program allocates resources, passes them around, and releases them; it also tracks the ownership relationship between objects and resources, and aliasing relationships between objects. While this specify-and-verify approach has several advantages compared to prior techniques, the need to manually write annotations presents a significant barrier to its practical adoption. This paper presents a novel technique to automatically infer a resource management specification for a program, broadening the applicability of specify-and-check verification for resource leaks. Inference in this domain is challenging because resource management specifications differ significantly in nature from the types that most inference techniques target. Further, for practical effectiveness, we desire a technique that can infer the resource management specification intended by the developer, even in cases when the code does not fully adhere to that specification. We address these challenges through a set of inference rules carefully designed to capture real-world coding patterns, yielding an effective fixed-point-based inference algorithm. We have implemented our inference algorithm in two different systems, targeting programs written in Java and C#. In an experimental evaluation, our technique inferred 85.5% of the annotations that programmers had written manually for the benchmarks. Further, the verifier issued nearly the same rate of false alarms with the manually-written and automatically-inferred annotations.

Funder

National Science Foundation

Publisher

Association for Computing Machinery (ACM)

Subject

Safety, Risk, Reliability and Quality,Software

Reference35 articles.

1. Moving fast with software verification

2. Migrating gradual types

3. 2023. Resource Leak Checker for must-call obligations. https://checkerframework.org/manual/#resource-leak-checker Accessed 29 July 2023 2023. Resource Leak Checker for must-call obligations. https://checkerframework.org/manual/#resource-leak-checker Accessed 29 July 2023

4. 2023. Checker Framework Whole-Program Inference. https://checkerframework.org/manual/#whole-program-inference Accessed 28 March 2023 2023. Checker Framework Whole-Program Inference. https://checkerframework.org/manual/#whole-program-inference Accessed 28 March 2023

5. David G. Clarke , John M. Potter , and James Noble . 1998. Ownership types for flexible alias protection . In OOPSLA ’98: Object-Oriented Programming Systems, Languages, and Applications. Vancouver, BC , Canada . 48–64. David G. Clarke, John M. Potter, and James Noble. 1998. Ownership types for flexible alias protection. In OOPSLA ’98: Object-Oriented Programming Systems, Languages, and Applications. Vancouver, BC, Canada. 48–64.

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

"同舟云学术"是以全球学者为主线,采集、加工和组织学术论文而形成的新型学术文献查询和分析系统,可以对全球学者进行文献检索和人才价值评估。用户可以通过关注某些学科领域的顶尖人物而持续追踪该领域的学科进展和研究前沿。经过近期的数据扩容,当前同舟云学术共收录了国内外主流学术期刊6万余种,收集的期刊论文及会议论文总量共计约1.5亿篇,并以每天添加12000余篇中外论文的速度递增。我们也可以为用户提供个性化、定制化的学者数据。欢迎来电咨询!咨询电话:010-8811{复制后删除}0370

www.globalauthorid.com

TOP

Copyright © 2019-2024 北京同舟云网络信息技术有限公司
京公网安备11010802033243号  京ICP备18003416号-3