Crash in [@ java.lang.IllegalStateException: at android.app.ContextImpl.startServiceCommon(ContextImpl.java)]

RESOLVED FIXED in Firefox 67

Status

()

defect
P1
critical
RESOLVED FIXED
5 months ago
4 months ago

People

(Reporter: calixte, Assigned: vlad.baicu)

Tracking

({crash})

Firefox 64
Firefox 67
Unspecified
Android
Points:
---

Firefox Tracking Flags

(firefox65 wontfix, firefox66 wontfix, firefox67 fixed)

Details

(crash signature)

Attachments

(2 attachments)

This bug is for crash report bp-136fb172-9ad8-4401-ada4-358ce0190227.

Java stack trace:

java.lang.IllegalStateException
	at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1595)
	at android.app.ContextImpl.startService(ContextImpl.java:1550)
	at android.content.ContextWrapper.startService(ContextWrapper.java:664)
	at org.mozilla.gecko.LauncherActivity.dispatchTabQueueIntent(LauncherActivity.java:107)
	at org.mozilla.gecko.LauncherActivity.onCreate(LauncherActivity.java:84)
	at android.app.Activity.performCreate(Activity.java:7149)
	at android.app.Activity.performCreate(Activity.java:7140)
	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1288)
	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3017)
	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3172)
	at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1906)
	at android.os.Handler.dispatchMessage(Handler.java:106)
	at android.os.Looper.loop(Looper.java:193)
	at android.app.ActivityThread.main(ActivityThread.java:6863)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:537)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

This crash is here for a moment (even after the backout in bug 1510587).
The # of crashes in release 65 is greater than 3.500.
:droeh, could you investigate please ?

Flags: needinfo?(droeh)

full java stack from one of the other crash ids

java.lang.IllegalStateException: Not allowed to start service Intent { act=android.intent.action.VIEW dat=http://connectivitycheck.platform.hicloud.com/... flg=0x10c00000 hwFlg=0x100 cmp=org.mozilla.firefox/org.mozilla.gecko.tabqueue.TabQueueService }: app is in background uid UidRecord{cf6d35c u0a136 TPSL idle procs:1 seq(0,0,0)} at 
android.app.ContextImpl.startServiceCommon(ContextImpl.java:1806) at 
android.app.ContextImpl.startService(ContextImpl.java:1761) at 
android.content.ContextWrapper.startService(ContextWrapper.java:664) at 
org.mozilla.gecko.LauncherActivity.dispatchTabQueueIntent(LauncherActivity.java:107) at 
org.mozilla.gecko.LauncherActivity.onCreate(LauncherActivity.java:84) at 
android.app.Activity.performCreate(Activity.java:7455) at 
android.app.Activity.performCreate(Activity.java:7445) at 
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1286) at 
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3343) at 
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3548) at 
android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:86) at 
android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) at 
android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) at 
android.app.ActivityThread$H.handleMessage(ActivityThread.java:2155) at 
android.os.Handler.dispatchMessage(Handler.java:109) at 
android.os.Looper.loop(Looper.java:207) at 
android.app.ActivityThread.main(ActivityThread.java:7534) at 
java.lang.reflect.Method.invoke(Native Method) at 
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524) at 
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:958)

This isn't a GeckoView issue. The problem (as with a few other bugs at this point) is most likely the new service restrictions in Android 8. Bouncing the NI to Stefan.

Flags: needinfo?(droeh) → needinfo?(sarentz)

This is a fairly high volume crash on release. I'll follow up in email.

Priority: -- → P1

Marcia also mentioned this is showing up more strongly for Android 9 than in 8.

Indeed, this is clearly because of the new service restrictions in Android 8.

IllegalStateException: Not allowed to start service: app is in background

Since the tab queue functionality already means a system notification about it for the user, we can convert this service to a foreground service which can be started even with the app in background.

Flags: needinfo?(sarentz)
Assignee: nobody → vlad.baicu

Can you explain how exactly this would work, Vlad? I want to understand what will be shown exactly, and what the buttons do.

Currently if you have the tab queue enabled, trying to open a link will queue it in our app and display a view on top of the apps you are currently using as well as show a notification with how many tabs are currently queued.

By refactoring this service to a foreground one, we need to start it with a notification asap and lock it for the duration of the service's life. My plan is to use the same notification but the user will be unable to swipe it away. Instead I suggest we add a "close" button in order to dismiss the feature.

Refactored the TabQueueService to be a foreground service from Android O
onwards. The service now uses a foreground notification that briefly informs
the user that a new tab is being added to the queue.

Depends on D23528

Keywords: checkin-needed

Pushed by archaeopteryx@coole-files.de:
https://hg.mozilla.org/integration/autoland/rev/069dea6b6bc5
Part 1: Some code cleanup. r=petru
https://hg.mozilla.org/integration/autoland/rev/36132f5347e8
Part 2: Refactor TabQueue to a foreground service. r=JanH

Keywords: checkin-needed
Status: NEW → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 67
You need to log in before you can comment on or make changes to this bug.