Opened 6 weeks ago

Closed 6 weeks ago

Last modified 4 weeks ago

#6454 closed defect (fixed)

IllegalStateException crash

Reported by: diegocarloslima Assignee: diegocarloslima
Priority: P1 Milestone: Adblock-Plus-for-Samsung-Browser-1.1.4
Module: Adblock-Plus-for-Samsung-Browser Keywords:
Cc: vicky, jwangenheim, mario Blocked By:
Blocking: Platform: Samsung Browser
Ready: yes Confidential: no
Tester: Unknown Verified working: yes
Review URL(s):

https://codereview.adblockplus.org/29716681/

Description

Environment

ABP for Samsung Internet 1.1.3
Android Oreo (API 26+)

How to reproduce

  1. Launch ABP for Samsung Internet
  2. Use the menu + swipe gesture to close ABP

Observed behaviour

The app crashes with the following error:

02-26 11:06:56.542  1000  4794 21388 W ActivityManager: Background start not allowed: service Intent { cmp=org.adblockplus.adblockplussbrowser/org.adblockplus.sbrowser.contentblocker.engine.EngineService } to org.adblockplus.adblockplussbrowser/org.adblockplus.sbrowser.contentblocker.engine.EngineService from pid=25258 uid=10289 pkg=org.adblockplus.adblockplussbrowser
02-26 11:06:56.544 10289 25258 25258 D AndroidRuntime: Shutting down VM
02-26 11:06:56.545 10289 25258 25258 E AndroidRuntime: FATAL EXCEPTION: main
02-26 11:06:56.545 10289 25258 25258 E AndroidRuntime: Process: org.adblockplus.adblockplussbrowser, PID: 25258
02-26 11:06:56.545 10289 25258 25258 E AndroidRuntime: java.lang.RuntimeException: Unable to get provider org.adblockplus.sbrowser.contentblocker.ContentBlockerContentProvider: java.lang.IllegalStateException: Not allowed to start service Intent { cmp=org.adblockplus.adblockplussbrowser/org.adblockplus.sbrowser.contentblocker.engine.EngineService }: app is in background uid UidRecord{88eb819 u0a289 CEM  idle procs:1 seq(0,0,0)}
02-26 11:06:56.545 10289 25258 25258 E AndroidRuntime:  at android.app.ActivityThread.installProvider(ActivityThread.java:6575)
02-26 11:06:56.545 10289 25258 25258 E AndroidRuntime:  at android.app.ActivityThread.installContentProviders(ActivityThread.java:6127)
02-26 11:06:56.545 10289 25258 25258 E AndroidRuntime:  at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6037)
02-26 11:06:56.545 10289 25258 25258 E AndroidRuntime:  at android.app.ActivityThread.-wrap1(Unknown Source:0)
02-26 11:06:56.545 10289 25258 25258 E AndroidRuntime:  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1764)
02-26 11:06:56.545 10289 25258 25258 E AndroidRuntime:  at android.os.Handler.dispatchMessage(Handler.java:105)
02-26 11:06:56.545 10289 25258 25258 E AndroidRuntime:  at android.os.Looper.loop(Looper.java:164)
02-26 11:06:56.545 10289 25258 25258 E AndroidRuntime:  at android.app.ActivityThread.main(ActivityThread.java:6938)
02-26 11:06:56.545 10289 25258 25258 E AndroidRuntime:  at java.lang.reflect.Method.invoke(Native Method)
02-26 11:06:56.545 10289 25258 25258 E AndroidRuntime:  at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
02-26 11:06:56.545 10289 25258 25258 E AndroidRuntime:  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
02-26 11:06:56.545 10289 25258 25258 E AndroidRuntime: Caused by: java.lang.IllegalStateException: Not allowed to start service Intent { cmp=org.adblockplus.adblockplussbrowser/org.adblockplus.sbrowser.contentblocker.engine.EngineService }: app is in background uid UidRecord{88eb819 u0a289 CEM  idle procs:1 seq(0,0,0)}
02-26 11:06:56.545 10289 25258 25258 E AndroidRuntime:  at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1538)
02-26 11:06:56.545 10289 25258 25258 E AndroidRuntime:  at android.app.ContextImpl.startService(ContextImpl.java:1484)
02-26 11:06:56.545 10289 25258 25258 E AndroidRuntime:  at android.content.ContextWrapper.startService(ContextWrapper.java:663)
02-26 11:06:56.545 10289 25258 25258 E AndroidRuntime:  at org.adblockplus.sbrowser.contentblocker.ContentBlockerContentProvider.onCreate(Unknown Source:22)
02-26 11:06:56.545 10289 25258 25258 E AndroidRuntime:  at android.content.ContentProvider.attachInfo(ContentProvider.java:1925)
02-26 11:06:56.545 10289 25258 25258 E AndroidRuntime:  at android.content.ContentProvider.attachInfo(ContentProvider.java:1900)
02-26 11:06:56.545 10289 25258 25258 E AndroidRuntime:  at android.app.ActivityThread.installProvider(ActivityThread.java:6572)

Even with the fix in #6389, we are still receiving crash reports related to the creation of background services in Android Oreo. With that, we should probably eliminate the use of a background service for the creation of the Engine in order to avoid any kind of scenario where the service cannot be started.

Expected behaviour

No crash should happen

Change History (4)

comment:1 Changed 6 weeks ago by diegocarloslima

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing

comment:2 Changed 6 weeks ago by abpbot

A commit referencing this issue has landed:
Issue 6454 - IllegalStateException crash

comment:3 Changed 6 weeks ago by diegocarloslima

  • Resolution set to fixed
  • Status changed from reviewing to closed

comment:4 Changed 4 weeks ago by rscott

  • Verified working set

Crash is reproduceable on 1.1.3 and not observed any more in 1.1.4. Excellent!

Note: See TracTickets for help on using tickets.