Background Task Scheduler crash after idling with Chrome open |
|||
Issue descriptionThis was seen on ToT with a custom build, may not exist in prod. 06-16 16:24:11.593 18057 18057 E JobService: Error while executing job: 78 06-16 16:24:11.593 18057 18057 D AndroidRuntime: Shutting down VM 06-16 16:24:11.597 18057 18057 E AndroidRuntime: FATAL EXCEPTION: main 06-16 16:24:11.597 18057 18057 E AndroidRuntime: Process: org.chromium.chrome, PID: 18057 06-16 16:24:11.597 18057 18057 E AndroidRuntime: java.lang.RuntimeException: java.lang.IllegalStateException: Browser hasn't finished initialization yet! 06-16 16:24:11.597 18057 18057 E AndroidRuntime: at android.app.job.JobService$JobHandler.handleMessage(JobService.java:130) 06-16 16:24:11.597 18057 18057 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102) 06-16 16:24:11.597 18057 18057 E AndroidRuntime: at android.os.Looper.loop(Looper.java:148) 06-16 16:24:11.597 18057 18057 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5417) 06-16 16:24:11.597 18057 18057 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method) 06-16 16:24:11.597 18057 18057 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 06-16 16:24:11.597 18057 18057 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 06-16 16:24:11.597 18057 18057 E AndroidRuntime: Caused by: java.lang.IllegalStateException: Browser hasn't finished initialization yet! 06-16 16:24:11.597 18057 18057 E AndroidRuntime: at org.chromium.chrome.browser.profiles.Profile.getLastUsedProfile(Profile.java:36) 06-16 16:24:11.597 18057 18057 E AndroidRuntime: at org.chromium.chrome.browser.offlinepages.prefetch.PrefetchBackgroundTask.<init>(PrefetchBackgroundTask.java:50) 06-16 16:24:11.597 18057 18057 E AndroidRuntime: at java.lang.Class.newInstance(Native Method) 06-16 16:24:11.597 18057 18057 E AndroidRuntime: at org.chromium.components.background_task_scheduler.BackgroundTaskScheduler.getBackgroundTaskFromClassName(BackgroundTaskScheduler.java:48) 06-16 16:24:11.597 18057 18057 E AndroidRuntime: at org.chromium.components.background_task_scheduler.BackgroundTaskSchedulerJobService.getBackgroundTaskFromJobParameters(BackgroundTaskSchedulerJobService.java:36) 06-16 16:24:11.597 18057 18057 E AndroidRuntime: at org.chromium.components.background_task_scheduler.BackgroundTaskJobService.onStartJob(BackgroundTaskJobService.java:69) 06-16 16:24:11.597 18057 18057 E AndroidRuntime: at android.app.job.JobService$JobHandler.handleMessage(JobService.java:126) 06-16 16:24:11.597 18057 18057 E AndroidRuntime: ... 6 more 06-16 16:24:11.656 597 663 I OpenGLRenderer: Initialized EGL, version 1.4 06-16 16:24:12.418 17095 16296 E bt_osi_alarm: reschedule_root_alarm alarm expiration too close for posix timers, switching to guns
,
Jun 18 2017
Steps to fix: 1. Don't use proile.getlastusedprofile() when native is not initialized (This is what happens in constructor. 2. Extend NativeBackgroundTask if your task actually needs native portion to be loaded when running (which it does). (This is consistent with recommendation from last month.)
,
Jun 27 2017
Working on this now.
,
Jun 28 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/e2856777652263b14611173aea65024db6a27919 commit e2856777652263b14611173aea65024db6a27919 Author: Justin DeWitt <dewittj@chromium.org> Date: Wed Jun 28 00:52:18 2017 [Offline Pages] Port PrefetchBackgroundTask to use NativeBackgroundTask Also fixes a crash at startup by delaying the call to Profile#getLastUsedProfile() until native is initialized. Bug: 734257 Change-Id: If0bf0ebce6ce04d3113bf8164bb69116cb11dde1 Reviewed-on: https://chromium-review.googlesource.com/550496 Commit-Queue: Justin DeWitt <dewittj@chromium.org> Reviewed-by: Jian Li <jianli@chromium.org> Cr-Commit-Position: refs/heads/master@{#482825} [modify] https://crrev.com/e2856777652263b14611173aea65024db6a27919/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchBackgroundTask.java [modify] https://crrev.com/e2856777652263b14611173aea65024db6a27919/chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchBackgroundTaskTest.java [modify] https://crrev.com/e2856777652263b14611173aea65024db6a27919/chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchBackgroundTaskUnitTest.java |
|||
►
Sign in to add a comment |
|||
Comment 1 by dewittj@chromium.org
, Jun 16 2017