Finding Resume And Restart Errors In Android . - IBM

2y ago
51 Views
4 Downloads
1.61 MB
15 Pages
Last View : 1m ago
Last Download : 3m ago
Upload by : Karl Gosselin
Transcription

Finding Resume and RestartErrors in Android Applications[OOPSLA’16]Iulian NeamtiuNew Jersey Institute of Technologyjoint work with Zhiyong Shan (Univ. of Central Missouri), Tanzirul Azim (MSR)IBM PL Day5/12/16

Smartphone apps have a fundamentally differentlifecycle, compared to desktop/server programsDesktop/serverprograms never killedby the system duringproper operationIBM PL Day5/12/16Android apps are stopped when Pressing Home button Pressing Back button Changing phone’s orientation Receiving phone call Receiving text message etc.Rationale: energy, security, etc.iOS has similar behavior2

Earlier version of Alarm Clock Plus app,more than 5 million installsChange phone orientation, alarm is reset !Or send app to background, then bring to foregroundalarm is reset!Instance data that has to persist across runs - KR dataKR data lost upon restart/resume - KR errorIBM PL Day5/12/163

Example: KR error in DateSlider appBefore restart?After restartIBM PL Day5/12/16mTime is modifiedWhen pressing theBack button,onSaveInstanceState() is not called bythe system thesave operationputLong() is notcalled4

Platform support and save protocolAndroid saves GUI state, invokes user-defined callbacksDevelopers must do the rest, e.g., fill out callbacksConfusing and error-proneonCreate()Android Activity LifecycleNew processCreatedKilled/exit edPausedonResume()onStop()Not guaranteedStoppedonDestroy()Not guaranteedDestroyedonSaveInstanceState()Not guaranteedonRestart()IBM PL Day5/12/165

Define Kill & Restart (KR) hierarchyLevel 1: Pause activityCauses: Display dialogShow drop-down menuCallbacks: onPause()/onResume()onCreate()New processCreatedKilled/exit Resume()onRestart()IBM PL stroy()DestroyedAndroid ActivityLifecycle6

Level 2: Stop activityCauses: Press Home buttonSwitch to another appStart a new activityReceive a phone callCallbacks: onStop()/onRestart()onCreate()New processCreatedKilled/exit Resume()onRestart()IBM PL stroy()DestroyedAndroid ActivityLifecycle7

Level 3: Destroy activityCauses: Press Back buttonKilled by userCallbacks: onDestroy()/onCreate()onCreate()New processCreatedKilled/exit Resume()onRestart()IBM PL stroy()DestroyedAndroid ActivityLifecycle8

Our approach: a complete toolchain to find andreproduce KR errorsKREfinderKREreproducerKR dataChangedKR dataData-flowanalysisAPKControl-flowanalysisKR saveKRrestoreFlowsummaryErrorlocation RedexerGator DirectedtransitionsExit! Find KR data, KR changes, KR saves,KR restores and exits! Track data and control flow fromchanged KR data to KR saves, exits! Track data and control flow betweenKR changes and KR restoresIBM PL Day5/12/16! Report potentialbugs and theirlocation! Generate a list oftargeted methodshttp://spruce.cs.ucr.edu/kre/! Construct input ! Usersequence toverifiesreach errorerrorlocation9

KREfinder: data flow analysis pointsKR dataFields that are mutable and modifiedKR restoreAPI calls that restore data, e.g.,Android.OS.Bundle.get*()KR data changeAssignment statement where a KRdata (or alias thereof) is written toKR saveAPI calls that save data, e.g.,Android.OS.Bundle.put*()The end of onDestroy() or onStop(),java.lang.system.exit() callIBM PL Day5/12/16Exit10

Killed/exit KR writeonPause() {.}Resumedkrfield .onStop() {.}onDestroy() {.save (krfield)}Not calledKREfinder: Four error typesType 1: save operation in a callback not guaranteed to executeResumedkrfield .onPause() {.if (pred).elsesave(krfield)Not calledKR writeKilled/exit onStop() {.}onDestroy() {.}}Type 2: save operation in a callback guaranteed to execute, but not on the path to exitType 3: no save or restore of KR dataType 4: restore KR data but no save operationIBM PL Day5/12/1611

KREreproducer Given an error point method, instruction generate adirected transition to reach that point Undecidable in general, but works well on Android Use Redexer to generate a method transitionlist that ends at method Identify GUI callbacks Use Gator to build the UI-event mapping that leads to method, instruction Flow summaryError location method, instruction IBM PL Day5/12/16RedexerGatorDirectedtransitions 12

EvaluationDataset! 324 apps from Google Play, AppsApk, GitHub! CategoriesUtilities, Email & SMS, Games, Health & Fitness! Size3KB—23MB, on average 377KB! Popularity (installs)11 apps with more than 1 million installs, e.g., Facebook, YahooWeather, NPR News!Effectiveness49 confirmed bugs in 37 apps (1.4 bugs per app)210 potential bugs in 287 appsEfficiencyTime (seconds)MinMaxAverageMedian12,1846122IBM PL Day5/12/1613

Error examples and categoriesAppError DescriptionAppError DescriptionNorton snap QR!User turns on the flashlight,then stops the app; afterresuming, flashlight is offDr.Web Anti-virus Light!The custom scan check boxsetting is lost after restartOpenSudoku!Game state lostMotorola Camera!The user switches from imagemode to video mode, thenrestarts. The camera returns toimage mode again! Losing GUI state! Losing user’s progress! Losing device settings(see paper for more examples)IBM PL Day5/12/1614

Conclusions! Smartphone apps are restarted frequentlyo When restarts not handled properly KR errors! Our approach finds and reproduces KR errorso Effective: 324 apps, found 49 reproducible bugs, 210other potential bugso Efficient: 61 seconds per app! Wanna know more?o See our OOPSLA’16 papero Try the open source toolchain, available athttp://spruce.cs.ucr.edu/kre/IBM PL Day5/12/1615

Finding Resume and Restart Errors in Android Applications [OOPSLA’16] Iulian Neamtiu New Jersey Institute of Technology joint work with Zhiyong Shan (Univ. of Central Missouri), Tanzirul Azim (MSR) IBM PL Day 5/12/16 . Smartphone apps have a fundamentally different lifecycle, compared to desktop/server programs Desktop/server .

Related Documents:

Errors and Data Analysis Types of errors: 1) Precision errors - these are random errors. These could also be called repeatability errors. They are caused by fluctuations in some part (or parts) of the data acquisition. These errors can be treated by statistical analysis. 2) Bias errors - These are systematic errors. Zero offset, scale .

ing apps of pause-and-resume or kill-and-restart operations. In Android, apps are structured around “activities”; an activity roughly corresponds to a separate screen in a tra-ditional, desktop program with a GUI. Activities are created by ext

Capacitors 5 – 6 Fault Finding & Testing Diodes,Varistors, EMC capacitors & Recifiers 7 – 10 Fault Finding & Testing Rotors 11 – 12 Fault Finding & Testing Stators 13 – 14 Fault Finding & Testing DC Welders 15 – 20 Fault Finding & Testing 3 Phase Alternators 21 – 26 Fault Finding & Testing

1. Proceed with surgery. Resume ASA and clopidogrel postoperatively 2. Restart ASA and clopidogrel now and proceed with surgery 3. Restart ASA and clopidogrel now and postpone surgery for at least 5 more months 4. Restart ASA and clopidogr

the university can restart, that is resume, in whole or part, normal face-to-face operations. It is chaired by Executive Vi ce President (EVP) and School of Medicine Dean Jay Hess and currently has 15 . (MRT) Recommendations Report . Indiana University Restart Committee . 8 . Risk Mitigation .

A Plan for Fall 2020 Restart at SUNY Oswego Introduction Individual Accountability in a Team Approach to Protect Health and Safety Oswego Forward is SUNY Oswego's ongoing plan for a safe restart of on-campus operations and a blend of online, hybrid and face-to-face courses beginning this August 24, 2020. The

4 Restart: When the phone is on, press and hold the Power key until the options pop up. Select Restart to restart the phone. Airplane mode: When

Devices in ST’s ARM Cortex‑M0‑based STM32F0 series deliver 32‑bit performance while featuring the essentials of the STM32 family and are particularly suited for cost‑sensitive applications. STM32F0 MCUs combine real‑time performance, low‑power operation, and the advanced architecture and peripherals of the STM32 platform.