skip to main content
10.1145/2307636.2307661acmconferencesArticle/Chapter ViewAbstractPublication PagesmobisysConference Proceedingsconference-collections
research-article

What is keeping my phone awake?: characterizing and detecting no-sleep energy bugs in smartphone apps

Published:25 June 2012Publication History

ABSTRACT

Despite their immense popularity in recent years, smartphones are and will remain severely limited by their battery life. Preserving this critical resource has driven smartphone OSes to undergo a paradigm shift in power management: by default every component, including the CPU, stays off or in an idle state, unless the app explicitly instructs the OS to keep it on! Such a policy encumbers app developers to explicitly juggle power control APIs exported by the OS to keep the components on, during their active use by the app and off otherwise. The resulting power-encumbered programming unavoidably gives rise to a new class of software energy bugs on smartphones called no-sleep bugs, which arise from mis-handling power control APIs by apps or the framework and result in significant and unexpected battery drainage.

This paper makes the first advances towards understanding and automatically detecting software energy bugs on smartphones. It makes the following three contributions: (1) we present the first comprehensive study of real world no-sleep energy bug characteristics; (2) we propose the first automatic solution to detect these bugs based on the classic reaching definitions dataflow analysis algorithm; (3) we provide experimental data showing that our tool accurately detected all 17 known instances of no-sleep bugs and found 34 new bugs in the 73 apps examined.

References

  1. "Smartphone sales overtake pcs for the first time." URL: http://mashable.com/2012/02/03/smartphone-sales-overtake-pcs/Google ScholarGoogle Scholar
  2. H. Zeng, C. S. Ellis, A. R. Lebeck, and A. Vahdat, "Ecosystem: Managing energy as a first class operating system resource," in Proc. of ASPLOS, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. "Android powermanager class." URL: http://developer.android.com/reference/android/os/PowerManager.htmlGoogle ScholarGoogle Scholar
  4. A. Pathak, Y. C. Hu, and M. Zhang, "Bootstrapping energy debugging for smartphones: A first look at energy bugs in mobile devices," in Proc. of Hotnets, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. S. Lu, S. Park, E. Seo, and Y. Zhou, "Learning from mistakes - a comprehensive study on real world concurrency bug characteristics," in ASPLOS, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. A. Aho, M. Lam, R. Sethi, and J. Ullman, Compilers: principles, techniques, and tools. Pearson/Addison Wesley.Google ScholarGoogle Scholar
  7. S. Lu, S. Park, C. Hu, X. Ma, W. Jiang, Z. Li, R. Popa, and Y. Zhou, "Muvi: automatically inferring multi-variable access correlations and detecting related semantic and concurrency bugs," in SOSP, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. "Android sensorevent class." URL: http://developer.android.com/reference/android/hardware/SensorEvent.htmlGoogle ScholarGoogle Scholar
  9. "Class powermanager.wakelock: Reference count." URL: http://developer.android.com/reference/android/os/PowerManager.WakeLock.html#setReferenceCounted(boolean)Google ScholarGoogle Scholar
  10. "Class powermanager.wakelock: Timer based." URL: http://developer.android.com/reference/android/os/PowerManager.WakeLock.html#acquire(long)Google ScholarGoogle Scholar
  11. A. Pathak, Y. C. Hu, M. Zhang, P. Bahl, and Y.-M. Wang, "Fine-grained power modeling for smartphones using system-call tracing," in Proc. of EuroSys, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. L. Zhang, B. Tiwana, Z. Qian, Z. Wang, R. Dick, Z. Mao, and L. Yang, "Accurate Online Power Estimation and Automatic Battery Behavior Based Power Model Generation for Smartphones," in Proc. of CODES+ISSS, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. A. Shye, B. Scholbrock, and G. Memik, "Into the wild: studying real user activity patterns to guide power optimizations for mobile architectures," in MICRO, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. "Dialer app." URL: http://www.java2s.com/Open-Source/Android/android-platform-apps/Phone/com/android/phone/PhoneApp.java.htmGoogle ScholarGoogle Scholar
  15. "Android proguard." URL: http://developer.android.com/guide/developing/tools/proguard.htmlGoogle ScholarGoogle Scholar
  16. "Decompiling apps." URL: http://siis.cse.psu.edu/ded/Google ScholarGoogle Scholar
  17. "Android - an open handset alliance project." URL: http://code.google.com/p/android/issues/listGoogle ScholarGoogle Scholar
  18. "Maemo community." URL: http://maemo.org/intro/Google ScholarGoogle Scholar
  19. "Sipservice: release wake lock for cancelled tasks." URL: https://github.com/android/platform_frameworks_base/commit/0c01e6e060d079b0a25a44c1159db63944afce17Google ScholarGoogle Scholar
  20. "Github: Social coding." URL: https://www.github.com/Google ScholarGoogle Scholar
  21. "Agenda." URL: http://www.androidagendawidget.comGoogle ScholarGoogle Scholar
  22. "Facebook 1.3 not releasing partial wake lock." URL: http://geekfor.me/news/facebook-1-3-wakelock/Google ScholarGoogle Scholar
  23. "K9mail: Simplifying wakelock." URL: http://code.google.com/p/k9mail/source/detail?r=1696Google ScholarGoogle Scholar
  24. "Checkinmap: Disable location updates when checkinmap is paused." URL: https://github.com/jmschanck/Ushahidi_Android/commit/337b48f5f2725f3e84796fab12947ffbec3c0357Google ScholarGoogle Scholar
  25. "My tracks android app." URL: http://mytracks.appspot.comGoogle ScholarGoogle Scholar
  26. "Babblesink: Move line inside try in case of npe before release of wake lock." URL: https://github.com/hatstand/babblesink/commit/9fbc6f01ce81ef4625a6bd62a3b4b787e6080e36Google ScholarGoogle Scholar
  27. "Ensuring that the wakelock is released during exception." URL: https://github.com/commonsguy/cwac-wakeful/commit/c7d440f1150887bb9a1a3c44015c7579d7ab1970Google ScholarGoogle Scholar
  28. "frameworks/base/telephony: Release wakelock on ril request send error." URL: https://gist.github.com/CyanogenMod/android_frameworks_base/commit/133d22d577aa86a8e4095e3af29851d1bd7f7b1bGoogle ScholarGoogle Scholar
  29. "Ensure wake lock is released when an ioexception is thrown during a sync." URL: https://github.com/mtuton/android_apps_email/commit/85fec873c4413ef86d40972cc3dbe925ee23e733Google ScholarGoogle Scholar
  30. "Android issue#9307 fixed - partial wake lock released." URL: https://github.com/CyanogenMod/android_packages_apps_Email/commit/f53bf8f178380ed882a0fa34e10c41f9e8242b93Google ScholarGoogle Scholar
  31. "Wakelock issue for driver stop." URL: https://github.com/buglabs/android-buglabs-frameworks-base/commit/3bf504df9fc1971078fdde7eed418a0dd8f601e2#wifiGoogle ScholarGoogle Scholar
  32. "Fix wakelock leak in powermanagerservice.sendnotificationlocked()." URL: http://gitorious.org/rowboat/frameworks-base/commit/93597ed1839de164c81f83832d4c2373ea32ac8fGoogle ScholarGoogle Scholar
  33. "Using a locationlistener is generally unsafe for leaving a permanent partial_wake_lock." URL: http://code.google.com/p/android/issues/detail?id=4333Google ScholarGoogle Scholar
  34. "Locationmanagerservice: Fix race when removing locationlistener." URL: https://gist.github.com/CyanogenMod/android_frameworks_base/commit/0528b9b26a9d64ba43acd0e334638303d514b8eb#location/java/android/location/ILocationProvider.aidlGoogle ScholarGoogle Scholar
  35. "Email application partial wake lock." URL: http://code.google.com/p/android/issues/detail?id=9307Google ScholarGoogle Scholar
  36. "E-mail app has a bug which causes a partial wake lock to be held until manually interrupted." URL: http://code.google.com/p/android/issues/detail?id=6811Google ScholarGoogle Scholar
  37. "Android backup service." URL: http://code.google.com/android/backup/index.htmlGoogle ScholarGoogle Scholar
  38. "Googlebackuptransport holds backup wake lock so long which leads to high current." URL: http://www.google.bg/support/forum/p/Google+Mobile/thread?tid=481ff31338a19536Google ScholarGoogle Scholar
  39. "Fix threading problem that resulted in the wakelock being held too long." URL: https://github.com/CyanogenMod/android_hardware_qcom_gps/commit/a162c4351926285892214b0726aaf07f0631dc72Google ScholarGoogle Scholar
  40. "Googlemaps holding wakelock for long." URL: http://www.google.com/support/forum/p/maps/thread?tid=016d2cec36d7410bGoogle ScholarGoogle Scholar
  41. "java.lang.exception class." URL: http://download.oracle.com/javase/1.4.2/docs/api/java/lang/Exception.htmlGoogle ScholarGoogle Scholar
  42. "Email 2.3 app keeps awake when no data connection is available." URL: http://www.google.com/support/forum/p/Google+Mobile/thread?tid=53bfe134321358e8Google ScholarGoogle Scholar
  43. J. B. Kam and J. D. Ullman, "Global data flow analysis and iterative algorithms," J. ACM, vol. 23, 1976. Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. E. M. Myers, "A precise inter-procedural data flow algorithm," in POPL. ACM, 1981. Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. "java.lang class runtimeexception." URL: http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/RuntimeException.htmlGoogle ScholarGoogle Scholar
  46. F. Qian, L. Hendren, and C. Verbrugge, "A comprehensive approach to array bounds check elimination for java," in Compiler Construction, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  47. R. Bodik, R. Gupta, and V. Sarkar, "Abcd: Eliminating array bounds checks on demand," in PLDI, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  48. M. Bravenboer and Y. Smaragdakis, "Exception analysis and points-to analysis: better together," in International symposium on Software testing and analysis, 2009, pp. 1--12. Google ScholarGoogle ScholarDigital LibraryDigital Library
  49. J. Lee, D. Padua, and S. Midkiff, "Basic compiler algorithms for parallel programs," in ACM SIGPLAN Notices, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  50. D. Grunwald and H. Srinivasan, "Data flow equations for explicitly parallel programs," in PPoPP, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  51. ".dex: Dalvik executable format." URL: http://source.android.com/tech/dalvik/dex-format.htmlGoogle ScholarGoogle Scholar
  52. "Android activity." URL: http://developer.android.com/reference/android/app/Activity.htmlGoogle ScholarGoogle Scholar
  53. S. Agarwal, R. Mahajan, A. Zheng, and V. Bahl, "There's an app for that, but it doesn.t work. diagnosing mobile applications in the wild," in Hotnets, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  54. Z. Yin, X. Ma, J. Zheng, Y. Zhou, B. Lakshmi, and S. Pasupathy, "An empirical study on configuration errors in commercial and open source systems," in SOSP, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  55. D. Engler and K. Ashcraft, "Racerx: Effective, static detection of race conditions and deadlocks," SOSP, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. What is keeping my phone awake?: characterizing and detecting no-sleep energy bugs in smartphone apps

    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
    • Published in

      cover image ACM Conferences
      MobiSys '12: Proceedings of the 10th international conference on Mobile systems, applications, and services
      June 2012
      548 pages
      ISBN:9781450313018
      DOI:10.1145/2307636

      Copyright © 2012 ACM

      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]

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 25 June 2012

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • research-article

      Acceptance Rates

      Overall Acceptance Rate274of1,679submissions,16%

      Upcoming Conference

      MOBISYS '24

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader