skip to main content
10.1145/2983990.2984011acmconferencesArticle/Chapter ViewAbstractPublication PagessplashConference Proceedingsconference-collections
research-article

Finding resume and restart errors in Android applications

Published: 19 October 2016 Publication History

Abstract

Smartphone apps create and handle a large variety of ``instance'' data that has to persist across runs, such as the current navigation route, workout results, antivirus settings, or game state. Due to the nature of the smartphone platform, an app can be paused, sent into background, or killed at any time. If the instance data is not saved and restored between runs, in addition to data loss, partially-saved or corrupted data can crash the app upon resume or restart. While smartphone platforms offer API support for data-saving and data-retrieving operations, the use of this API is ad-hoc: left to the programmer, rather than enforced by the compiler. We have observed that several categories of bugs---including data loss, failure to resume/restart or resuming/restarting in the wrong state---are due to incorrect handling of instance data and are easily triggered by just pressing the `Home' or `Back' buttons. To help address this problem, we have constructed a tool chain for Android (the KREfinder static analysis and the KREreproducer input generator) that helps find and reproduce such incorrect handling. We have evaluated our approach by running the static analysis on 324 apps, of which 49 were further analyzed manually. Results indicate that our approach is (i) effective, as it has discovered 49 bugs, including in popular Android apps, and (ii) efficient, completing on average in 61 seconds per app. More generally, our approach helps determine whether an app saves too much or too little state.

References

[1]
Uiapplicationdelegate protocol reference, March 2016.
[2]
https://developer.apple.com/ library/ios/documentation/UIKit/Reference/ UIApplicationDelegate_Protocol/index.html#// apple_ref/doc/uid/TP40006786.
[3]
android-apktool: A tool for reverse engineering android apk files, March 2016.
[4]
https://code.google.com/p/ android-apktool/.
[5]
C. Q. Adamsen, G. Mezzetti, and A. Møller. Systematic execution of android test suites in adverse conditions. In Proceedings of the 2015 International Symposium on Software Testing and Analysis, ISSTA 2015, pages 83–93, New York, NY, USA, 2015. ACM. ISBN 978-1-4503-3620-8.
[6]
A. V. Aho, M. S. Lam, R. Sethi, and J. D. Ullman. Compilers: Principles, Techniques, and Tools (2Nd Edition). Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA, 2006. ISBN 0321486811.
[7]
L. O. Andersen. Program Analysis and Specialization for the C Programming Language. PhD thesis, DIKU, University of Copenhagen, May 1994. (DIKU report 94/19).
[8]
Android Open Source Project. Activities, March 2016.
[9]
https://developer.android.com/guide/ components/activities.html.
[10]
Android Open Source Project. Managing the activity lifecycle, July 2016. http://developer.android.com/ training/basics/activity-lifecycle/.
[11]
Android Open Source Project. Platform versions, July 2016.
[12]
https://developer.android.com/about/ dashboards/index.html.
[13]
Android Open Source Project. Pausing and resuming an activity, March 2016. https://developer.android.com/ training/basics/activity-lifecycle/pausing. html.
[14]
Android Open Source Project. Processes and application life cycle, March 2016. https://developer.android.com/ guide/topics/processes/process-lifecycle.html.
[15]
Android Open Source Project. Saving data, March 2016.
[16]
https://developer.android.com/training/ basics/data-storage/index.html.
[17]
S. Arzt, S. Rasthofer, C. Fritz, E. Bodden, A. Bartel, J. Klein, Y. Le Traon, D. Octeau, and P. McDaniel. Flowdroid: Precise context, flow, field, object-sensitive and lifecycle-aware taint analysis for android apps. In Proceedings of the 35th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI ’14, pages 259–269, New York, NY, USA, 2014. ACM. ISBN 978-1-4503-2784-8.
[18]
T. Azim and I. Neamtiu. Targeted and depth-first exploration for systematic testing of android apps. In Proceedings of the 2013 ACM SIGPLAN International Conference on Object Oriented Programming Systems Languages & Applications, OOPSLA ’13, pages 641–660, New York, NY, USA, 2013. ACM. ISBN 978-1-4503-2374-1. 1145/2509136.2509549.
[19]
P. Bohannon, R. Rastogi, S. Seshadri, A. Silberschatz, and S. Sudarshan. Detection and recovery techniques for database corruption. Knowledge and Data Engineering, IEEE Transactions on, 15(5):1120–1136, Sept 2003.
[20]
Google Code. Dex2jar. https://code.google.com/p/ dex2jar/.
[21]
Google Code. Scramblednet issue 54: Scramblednet loses game state, March 2016. https://code.google.com/p/ moonblink/issues/detail?id=54.
[22]
Google Code. Ssh tunnel issue 165: Auto connect and auto reconnect not working, March 2016. https://code.google. com/p/sshtunnel/issues/detail?id=165.
[23]
Google Play reviewers. Brightness profiles, March 2016.
[24]
https://play.google.com/store/apps/details?id= com.angrydoughnuts.android.brightprof.
[25]
Google Play reviewers. Souvey musical pro, March 2016. https://play.google.com/store/apps/details?id= com.angrydoughnuts.android.brightprof.
[26]
H. S. Gunawi, A. Rajimwale, A. C. Arpaci-Dusseau, and R. H. Arpaci-Dusseau. Sqck: A declarative file system checker. In Proceedings of the 8th USENIX Conference on Operating Systems Design and Implementation, OSDI’08, pages 131–146, Berkeley, CA, USA, 2008. USENIX Association.
[27]
C.-H. Hsiao, J. Yu, S. Narayanasamy, Z. Kong, C. L. Pereira, G. A. Pokam, P. M. Chen, and J. Flinn. Race detection for event-driven mobile applications. In Proceedings of the 35th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI ’14, pages 326–336, New York, NY, USA, 2014. ACM. ISBN 978-1-4503-2784-8.
[28]
C. Hu and I. Neamtiu. Automating gui testing for android applications. In Proceedings of the 6th International Workshop on Automation of Software Test, AST ’11, pages 77– 83, New York, NY, USA, 2011. ACM. ISBN 978-1-4503- 0592-1.
[29]
G. Hu, X. Yuan, Y. Tang, and J. Yang. Efficiently, effectively detecting mobile app bugs with appdoctor. In Proceedings of the Ninth European Conference on Computer Systems, EuroSys ’14, pages 18:1–18:15, 2014.
[30]
C. S. Jensen, M. R. Prasad, and A. Møller. Automated testing with targeted event sequence generation. In Proceedings of the 2013 International Symposium on Software Testing and Analysis, ISSTA 2013, pages 67–77, 2013.
[31]
Jinseong Jeon and Kristopher Micinski and Jeffrey S. Foster. Redexer. http://www.cs.umd.edu/projects/PL/ redexer/index.html.
[32]
J. B. Kam and J. D. Ullman. Monotone data flow analysis frameworks. Acta Informatica, 7(3):305–317, 1977. ISSN 1432-0525.
[33]
C.-J. M. Liang, N. D. Lane, N. Brouwers, L. Zhang, B. F. Karlsson, H. Liu, Y. Liu, J. Tang, X. Shan, R. Chandra, and F. Zhao. Caiipa: Automated large-scale mobile app testing through contextual fuzzing. In Proceedings of the 20th Annual International Conference on Mobile Computing and Networking, MobiCom ’14, pages 519–530, 2014.
[34]
P. Maiya, A. Kanade, and R. Majumdar. Race detection for android applications. In Proceedings of the 35th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI ’14, pages 316–325, New York, NY, USA, 2014. ACM. ISBN 978-1-4503-2784-8. 1145/2594291.2594311.
[35]
D. S. Milo´iˇci´c, F. Douglis, Y. Paindaveine, R. Wheeler, and S. Zhou. Process migration. ACM Comput. Surv., 32(3):241– 299, Sept. 2000. ISSN 0360-0300.
[36]
[37]
[38]
D. Octeau, S. Jha, and P. McDaniel. Retargeting android applications to java bytecode. In Proceedings of the 20th ACM SIGSOFT International Symposium on the Foundations of Software Engineering, FSE ’12, pages 6:1–6:11, 2012. ISBN 978-1-4503-1614-9.
[39]
A. Pathak, A. Jindal, Y. C. Hu, and S. P. Midkiff. What is keeping my phone awake?: Characterizing and detecting nosleep energy bugs in smartphone apps. In Proceedings of the 10th International Conference on Mobile Systems, Applications, and Services, MobiSys ’12, pages 267–280, New York, NY, USA, 2012. ACM. ISBN 978-1-4503-1301-8.
[40]
L. Ravindranath, S. Nath, J. Padhye, and H. Balakrishnan. Automatic and scalable fault detection for mobile applications. In Proceedings of the 12th Annual International Conference on Mobile Systems, Applications, and Services, MobiSys ’14, pages 190–203, 2014.
[41]
A. Rountev and D. Yan. Static reference analysis for gui objects in android software. In Proceedings of Annual IEEE/ACM International Symposium on Code Generation and Optimization, CGO ’14, 2014.
[42]
Stack Overflow. Android activity life cycle - what are all these methods for?, March 2016. http://stackoverflow.com/questions/8515936/ android-activity-life-cycle-what-are-all-these\ -methods-for.
[43]
S. Subramanian, Y. Zhang, R. Vaidyanathan, H. Gunawi, A. Arpaci-Dusseau, R. Arpaci-Dusseau, and J. Naughton. Impact of disk corruption on open-source dbms. In Data Engineering (ICDE), 2010 IEEE 26th International Conference on, pages 509–520, March 2010.
[44]
[45]
J. Yang, P. Twohey, D. Engler, and M. Musuvathi. Using model checking to find serious file system errors. ACM Trans. Comput. Syst., 24(4):393–423, Nov. 2006. ISSN 0734-2071.

Cited By

View all
  • (2023)DDLDroid: A Static Analyzer for Automatically Detecting Data Loss Issues in Android ApplicationsProceedings of the 32nd ACM SIGSOFT International Symposium on Software Testing and Analysis10.1145/3597926.3604916(1471-1474)Online publication date: 12-Jul-2023
  • (2023)DDLDroid: Efficiently Detecting Data Loss Issues in Android AppsProceedings of the 32nd ACM SIGSOFT International Symposium on Software Testing and Analysis10.1145/3597926.3598089(703-714)Online publication date: 12-Jul-2023
  • (2023)Transparent Runtime Change Handling for Android AppsProceedings of the 28th ACM International Conference on Architectural Support for Programming Languages and Operating Systems, Volume 310.1145/3582016.3582060(756-770)Online publication date: 25-Mar-2023
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
OOPSLA 2016: Proceedings of the 2016 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications
October 2016
915 pages
ISBN:9781450344449
DOI:10.1145/2983990
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Sponsors

In-Cooperation

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 19 October 2016

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. App testing
  2. Data loss
  3. Google Android
  4. Mobile applications
  5. Software restart
  6. Static analysis

Qualifiers

  • Research-article

Funding Sources

Conference

SPLASH '16
Sponsor:

Acceptance Rates

Overall Acceptance Rate 268 of 1,244 submissions, 22%

Upcoming Conference

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)10
  • Downloads (Last 6 weeks)2
Reflects downloads up to 05 Jan 2025

Other Metrics

Citations

Cited By

View all
  • (2023)DDLDroid: A Static Analyzer for Automatically Detecting Data Loss Issues in Android ApplicationsProceedings of the 32nd ACM SIGSOFT International Symposium on Software Testing and Analysis10.1145/3597926.3604916(1471-1474)Online publication date: 12-Jul-2023
  • (2023)DDLDroid: Efficiently Detecting Data Loss Issues in Android AppsProceedings of the 32nd ACM SIGSOFT International Symposium on Software Testing and Analysis10.1145/3597926.3598089(703-714)Online publication date: 12-Jul-2023
  • (2023)Transparent Runtime Change Handling for Android AppsProceedings of the 28th ACM International Conference on Architectural Support for Programming Languages and Operating Systems, Volume 310.1145/3582016.3582060(756-770)Online publication date: 25-Mar-2023
  • (2023)Android Fuzzing: Balancing User-Inputs and Intents2023 IEEE Conference on Software Testing, Verification and Validation (ICST)10.1109/ICST57152.2023.00013(37-48)Online publication date: Apr-2023
  • (2023)Detecting Potential User-data Save & Export Losses due to Android App Termination2023 IEEE/ACM International Conference on Automation of Software Test (AST)10.1109/AST58925.2023.00019(152-162)Online publication date: May-2023
  • (2022)iFixDataloss: a tool for detecting and fixing data loss issues in Android appsProceedings of the 31st ACM SIGSOFT International Symposium on Software Testing and Analysis10.1145/3533767.3543297(785-788)Online publication date: 18-Jul-2022
  • (2022)Detecting and fixing data loss issues in Android appsProceedings of the 31st ACM SIGSOFT International Symposium on Software Testing and Analysis10.1145/3533767.3534402(605-616)Online publication date: 18-Jul-2022
  • (2022)Why My App Crashes? Understanding and Benchmarking Framework-Specific Exceptions of Android AppsIEEE Transactions on Software Engineering10.1109/TSE.2020.301343848:4(1115-1137)Online publication date: 1-Apr-2022
  • (2022)Proactive Libraries: Enforcing Correct Behaviors in Android Apps2022 IEEE/ACM 44th International Conference on Software Engineering: Companion Proceedings (ICSE-Companion)10.1109/ICSE-Companion55297.2022.9793763(159-163)Online publication date: May-2022
  • (2021)Fully automated functional fuzzing of Android apps for detecting non-crashing logic bugsProceedings of the ACM on Programming Languages10.1145/34855335:OOPSLA(1-31)Online publication date: 15-Oct-2021
  • Show More Cited By

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media