Practical static analysis of context leaks in Android applications

被引:2
|
作者
Toffalini, Flavio [1 ]
Sun, Jun [1 ]
Ochoa, Martin [2 ]
机构
[1] Singapore Univ Technol & Design, Singapore 487372, Singapore
[2] Univ Rosario, Dept Appl Math & Comp Sci, Bogota, Colombia
来源
SOFTWARE-PRACTICE & EXPERIENCE | 2019年 / 49卷 / 02期
关键词
Android; memory leak; static analysis;
D O I
10.1002/spe.2659
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Android native applications, written in Java and distributed in APK format, are widely used in mobile devices. Their specific pattern of use lets the operating system control the creation and destruction of resources, such as activities and services (contexts). Programmers are not supposed to interfere with such life cycle events. Otherwise, contexts might be leaked, ie, they will never be deallocated from memory, or be deallocated late, leading to memory exhaustion and frozen applications. In practice, it is easy to write incorrect code, which hinders garbage collection of contexts and leads to context leakages. In this work, we present a novel static analysis method that finds context leaks in Android code. We apply this analysis to APKs translated into Java bytecode. We provide a formal analysis of our algorithms and suggest further research directions for improving precision by combining different approaches. We discuss the results of a large number of experiments with our analysis, which reveal context leaks in many widely used applications from the Android marketplace. This shows the practical usefulness of our technique and its superiority w.r.t. the well-known Lint and Infer static analysis tools. We estimate the amount of memory saved by the collection of the leaks found and explain, experimentally, where programmers often go wrong and limitations of our tool. Such lessons could be used for designing of a sound or more powerful static analysis tool. This work can be considered as a practical application of software analysis techniques to solve practical problems.
引用
收藏
页码:233 / 251
页数:19
相关论文
共 50 条
  • [1] Static Analysis of Context Leaks in Android Applications
    Toffalini, Flavio
    Sun, Jun
    Ochoa, Martin
    2018 IEEE/ACM 40TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING - SOFTWARE ENGINEERING IN PRACTICE TRACK (ICSE-SEIP 2018), 2018, : 215 - 224
  • [2] HornDroid: Practical and Sound Static Analysis of Android Applications by SMT Solving
    Calzavara, Stefano
    Grishchenko, Ilya
    Maffei, Matteo
    1ST IEEE EUROPEAN SYMPOSIUM ON SECURITY AND PRIVACY, 2016, : 47 - 62
  • [3] Static Analysis of Memory Leak in Android Applications
    Zhou, Di
    Fu, Zhengyu
    PROCEEDINGS OF THE 4TH INTERNATIONAL CONFERENCE ON MECHATRONICS, MATERIALS, CHEMISTRY AND COMPUTER ENGINEERING 2015 (ICMMCCE 2015), 2015, 39 : 1023 - 1027
  • [4] Characterizing and Detecting Resource Leaks in Android Applications
    Guo, Chaorong
    Zhang, Jian
    Yan, Jun
    Zhang, Zhiqiang
    Zhang, Yanli
    2013 28TH IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMATED SOFTWARE ENGINEERING (ASE), 2013, : 389 - 398
  • [5] DryJIN: Detecting Information Leaks in Android Applications
    Choi, Minseong
    Im, Yubin
    Ko, Steve
    Kwon, Yonghwi
    Jeon, Yuseok
    Cho, Haehyun
    ICT SYSTEMS SECURITY AND PRIVACY PROTECTION, SEC 2024, 2024, 710 : 76 - 90
  • [6] Automated repair of resource leaks in Android applications?
    Bhatt, Bhargav Nagaraja
    Furia, Carlo A.
    JOURNAL OF SYSTEMS AND SOFTWARE, 2022, 192
  • [7] Systematic Testing for Resource Leaks in Android Applications
    Yan, Dacong
    Yang, Shengqian
    Rountev, Atanas
    2013 IEEE 24TH INTERNATIONAL SYMPOSIUM ON SOFTWARE RELIABILITY ENGINEERING (ISSRE), 2013, : 411 - 420
  • [8] Static analysis of superfluous network transmissions in android applications
    Huang, Jianmeng
    Huang, Wenchao
    Meng, Zhaoyi
    Miao, Fuyou
    Xiong, Yan
    International Journal of Network Security, 2020, 22 (03) : 411 - 420
  • [9] Automated repair of resource leaks in Android applications
    Bhatt, Bhargav Nagaraja
    Furia, Carlo A.
    Journal of Systems and Software, 2022, 192
  • [10] HybriDroid: Static Analysis Framework for Android Hybrid Applications
    Lee, Sungho
    Dolby, Julian
    Ryu, Sukyoung
    2016 31ST IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMATED SOFTWARE ENGINEERING (ASE), 2016, : 250 - 261