skip to main content
research-article

Finding resume and restart errors in Android applications

Published:19 October 2016Publication History
Skip Abstract Section

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.Google ScholarGoogle Scholar
  2. https://developer.apple.com/ library/ios/documentation/UIKit/Reference/ UIApplicationDelegate_Protocol/index.html#// apple_ref/doc/uid/TP40006786.Google ScholarGoogle Scholar
  3. android-apktool: A tool for reverse engineering android apk files, March 2016.Google ScholarGoogle Scholar
  4. https://code.google.com/p/ android-apktool/.Google ScholarGoogle Scholar
  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. doi: 10.1145/2771783.2771786. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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).Google ScholarGoogle Scholar
  8. Android Open Source Project. Activities, March 2016.Google ScholarGoogle Scholar
  9. https://developer.android.com/guide/ components/activities.html.Google ScholarGoogle Scholar
  10. Android Open Source Project. Managing the activity lifecycle, July 2016. http://developer.android.com/ training/basics/activity-lifecycle/.Google ScholarGoogle Scholar
  11. Android Open Source Project. Platform versions, July 2016.Google ScholarGoogle Scholar
  12. https://developer.android.com/about/ dashboards/index.html.Google ScholarGoogle Scholar
  13. Android Open Source Project. Pausing and resuming an activity, March 2016. https://developer.android.com/ training/basics/activity-lifecycle/pausing. html.Google ScholarGoogle Scholar
  14. Android Open Source Project. Processes and application life cycle, March 2016. https://developer.android.com/ guide/topics/processes/process-lifecycle.html.Google ScholarGoogle Scholar
  15. Android Open Source Project. Saving data, March 2016.Google ScholarGoogle Scholar
  16. https://developer.android.com/training/ basics/data-storage/index.html.Google ScholarGoogle Scholar
  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. doi: 10.1145/2594291.2594299. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. doi: 10. 1145/2509136.2509549. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Google Code. Dex2jar. https://code.google.com/p/ dex2jar/.Google ScholarGoogle Scholar
  21. Google Code. Scramblednet issue 54: Scramblednet loses game state, March 2016. https://code.google.com/p/ moonblink/issues/detail?id=54.Google ScholarGoogle Scholar
  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.Google ScholarGoogle Scholar
  23. Google Play reviewers. Brightness profiles, March 2016.Google ScholarGoogle Scholar
  24. https://play.google.com/store/apps/details?id= com.angrydoughnuts.android.brightprof.Google ScholarGoogle Scholar
  25. Google Play reviewers. Souvey musical pro, March 2016. https://play.google.com/store/apps/details?id= com.angrydoughnuts.android.brightprof.Google ScholarGoogle Scholar
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. doi: 10.1145/2594291.2594330. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. doi: 10.1145/1982595.1982612. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Jinseong Jeon and Kristopher Micinski and Jeffrey S. Foster. Redexer. http://www.cs.umd.edu/projects/PL/ redexer/index.html.Google ScholarGoogle Scholar
  32. J. B. Kam and J. D. Ullman. Monotone data flow analysis frameworks. Acta Informatica, 7(3):305–317, 1977. ISSN 1432-0525. doi: 10.1007/BF00290339. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. doi: 10. 1145/2594291.2594311. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. doi: 10.1145/367701. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. 367728.Google ScholarGoogle Scholar
  37. 367728.Google ScholarGoogle Scholar
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. doi: 10.1145/2307636.2307661. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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.Google ScholarGoogle Scholar
  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. doi: 10.1109/ICDE.2010.Google ScholarGoogle ScholarCross RefCross Ref
  44. 5447821.Google ScholarGoogle Scholar
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Finding resume and restart errors in Android applications

              Recommendations

              Comments

              Login options

              Check if you have access through your login credentials or your institution to get full access on this article.

              Sign in

              Full Access

              • Published in

                cover image ACM SIGPLAN Notices
                ACM SIGPLAN Notices  Volume 51, Issue 10
                OOPSLA '16
                October 2016
                915 pages
                ISSN:0362-1340
                EISSN:1558-1160
                DOI:10.1145/3022671
                Issue’s Table of Contents
                • 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

                Copyright © 2016 ACM

                Publisher

                Association for Computing Machinery

                New York, NY, United States

                Publication History

                • Published: 19 October 2016

                Check for updates

                Qualifiers

                • research-article

              PDF Format

              View or Download as a PDF file.

              PDF

              eReader

              View online with eReader.

              eReader
              About Cookies On This Site

              We use cookies to ensure that we give you the best experience on our website.

              Learn more

              Got it!