Open Bug 1810736 Opened 2 years ago Updated 1 month ago

Media decoding is not compatible with isolated process

Categories

(GeckoView :: General, task, P3)

Unspecified
Android
task

Tracking

(firefox139 fixed)

REOPENED
139 Branch
Tracking Status
firefox139 --- fixed

People

(Reporter: jnicol, Unassigned)

References

(Depends on 1 open bug, Blocks 2 open bugs)

Details

(Whiteboard: [sandboxing] [geckoview:2022q3][fxdroid] [geckoview] )

Attachments

(1 file)

+++ This bug was initially created as a clone of Bug #1706656 +++

In bug 1706656 we made it so that the SurfaceAllocator works correctly in an isolated process. This means we are now able to successfully allocate Surfaces and proceed to creating the decoder, which fails:

W/System.err( 3953): java.lang.SecurityException: Isolated process not allowed to call bindService
W/System.err( 3953): 	at android.os.Parcel.readException(Parcel.java:1683)
W/System.err( 3953): 	at android.os.Parcel.readException(Parcel.java:1636)
W/System.err( 3953): 	at android.app.ActivityManagerProxy.bindService(ActivityManagerNative.java:4374)
W/System.err( 3953): 	at android.app.ContextImpl.bindServiceCommon(ContextImpl.java:1491)
W/System.err( 3953): 	at android.app.ContextImpl.bindService(ContextImpl.java:1450)
W/System.err( 3953): 	at android.content.ContextWrapper.bindService(ContextWrapper.java:636)
W/System.err( 3953): 	at org.mozilla.gecko.media.RemoteManager$RemoteConnection.connect(RemoteManager.java:65)
W/System.err( 3953): 	at org.mozilla.gecko.media.RemoteManager$RemoteConnection.-$$Nest$mconnect(RemoteManager.java)
W/System.err( 3953): 	at org.mozilla.gecko.media.RemoteManager.init(RemoteManager.java:127)
W/System.err( 3953): 	at org.mozilla.gecko.media.RemoteManager.getInstance(RemoteManager.java:33)
W/System.err( 3953): 	at org.mozilla.gecko.media.CodecProxy.create(CodecProxy.java:158)

Isolated processes are not allowed to call bindService, so we need to find another way to start and communicate with the media process.

(I'm not going to work on this, just filing a bug so that I can link to it when I mark tests as failing in bug 1706656)

Severity: -- → N/A
OS: All → Android
Priority: -- → P3
Blocks: 1771452
Component: Sandboxing → General

Do the logs in Bug 1698214 look related to the issue?

I was able to open many of the media test suites open due to cubeb remoting being fixed in bug 1700243. Bug 1698214 was one of the few set of junit tests that I couldn't open. I'm trying to determine what the root issue is over there so I can file a ticket for it specifically or link it to this one.

I can't see the exact same problem in those logs, no. The issue I described here (though I'm afraid my recollection is a bit hazy) is that isolated processes do not have the required permissions to bind android services, which we use to create/bind to the media process from the content process in CodecProxy.java.

I can't see any mention of CodecProxy or the media process in your logs. I'm not sure if that issue is fixed, or perhaps only affects certain android versions, or the tests just aren't getting far enough to run in to it.

Whiteboard: [sandboxing] [geckoview:2022q3] → [sandboxing] [geckoview:2022q3][fxdroid] [geckoview]

Bug 1698214 unblocked this. I'll open the tests shortly. They appear to be working locally:

  • All tests in ContentDelegateChildTests
  • All tests in PermissionDelegateTest
Assignee: nobody → ohall
  • Bug 1698214 appears to have resolved the issue with these tests.
  • Opened all isolated process blocked tests in:
    • ContentDelegateChildTest
    • PermissionDelegateTest

I'm going to go ahead open the tests that are working right now.

ContentDelegateChildTest#requestContextMenuOnVideo was failing locally for me, but not reporting as a failure. The test fails as expected in CI.

Relevant failure:
ContentDelegateChildTest#requestContextMenuOnVideo - failure stems from this call in RemoteManager.java

04-21 10:28:42.434 24608 24671 W System.err: java.lang.SecurityException: Isolated process not allowed to call bindService
04-21 10:28:42.434 24608 24671 W System.err: 	at android.os.Parcel.readException(Parcel.java:1683)
04-21 10:28:42.434 24608 24671 W System.err: 	at android.os.Parcel.readException(Parcel.java:1636)
04-21 10:28:42.434 24608 24671 W System.err: 	at android.app.ActivityManagerProxy.bindService(ActivityManagerNative.java:4374)
04-21 10:28:42.434 24608 24671 W System.err: 	at android.app.ContextImpl.bindServiceCommon(ContextImpl.java:1491)
04-21 10:28:42.434 24608 24671 W System.err: 	at android.app.ContextImpl.bindService(ContextImpl.java:1450)
04-21 10:28:42.434 24608 24671 W System.err: 	at android.content.ContextWrapper.bindService(ContextWrapper.java:636)
04-21 10:28:42.434 24608 24671 W System.err: 	at org.mozilla.gecko.media.RemoteManager$RemoteConnection.connect(RemoteManager.java:75)
04-21 10:28:42.434 24608 24671 W System.err: 	at org.mozilla.gecko.media.RemoteManager$RemoteConnection.-$$Nest$mconnect(RemoteManager.java)
04-21 10:28:42.434 24608 24671 W System.err: 	at org.mozilla.gecko.media.RemoteManager.init(RemoteManager.java:143)
04-21 10:28:42.434 24608 24671 W System.err: 	at org.mozilla.gecko.media.RemoteManager.getInstance(RemoteManager.java:37)
04-21 10:28:42.434 24608 24671 W System.err: 	at org.mozilla.gecko.media.CodecProxy.create(CodecProxy.java:159)
04-21 10:28:42.435 24608 24671 E GeckoCrashHandler: >>> REPORTING UNCAUGHT EXCEPTION FROM THREAD 971 ("MediaPDecoder #")
04-21 10:28:42.435 24608 24671 E GeckoCrashHandler: java.lang.SecurityException: Isolated process not allowed to call bindService
04-21 10:28:42.435 24608 24671 E GeckoCrashHandler: 	at android.os.Parcel.readException(Parcel.java:1683)
04-21 10:28:42.435 24608 24671 E GeckoCrashHandler: 	at android.os.Parcel.readException(Parcel.java:1636)
04-21 10:28:42.435 24608 24671 E GeckoCrashHandler: 	at android.app.ActivityManagerProxy.bindService(ActivityManagerNative.java:4374)
04-21 10:28:42.435 24608 24671 E GeckoCrashHandler: 	at android.app.ContextImpl.bindServiceCommon(ContextImpl.java:1491)
04-21 10:28:42.435 24608 24671 E GeckoCrashHandler: 	at android.app.ContextImpl.bindService(ContextImpl.java:1450)
04-21 10:28:42.435 24608 24671 E GeckoCrashHandler: 	at android.content.ContextWrapper.bindService(ContextWrapper.java:636)
04-21 10:28:42.435 24608 24671 E GeckoCrashHandler: 	at org.mozilla.gecko.media.RemoteManager$RemoteConnection.connect(RemoteManager.java:75)
04-21 10:28:42.435 24608 24671 E GeckoCrashHandler: 	at org.mozilla.gecko.media.RemoteManager$RemoteConnection.-$$Nest$mconnect(RemoteManager.java)
04-21 10:28:42.435 24608 24671 E GeckoCrashHandler: 	at org.mozilla.gecko.media.RemoteManager.init(RemoteManager.java:143)
04-21 10:28:42.435 24608 24671 E GeckoCrashHandler: 	at org.mozilla.gecko.media.RemoteManager.getInstance(RemoteManager.java:37)
04-21 10:28:42.435 24608 24671 E GeckoCrashHandler: 	at org.mozilla.gecko.media.CodecProxy.create(CodecProxy.java:159)
04-21 10:28:42.435 24608 24671 E GeckoCrashHandler: Main thread (1) stack:
04-21 10:28:42.435 24608 24671 E GeckoCrashHandler:     android.os.MessageQueue.nativePollOnce(Native Method)
04-21 10:28:42.435 24608 24671 E GeckoCrashHandler:     android.os.MessageQueue.next(MessageQueue.java:323)
04-21 10:28:42.435 24608 24671 E GeckoCrashHandler:     android.os.Looper.loop(Looper.java:136)
04-21 10:28:42.435 24608 24671 E GeckoCrashHandler:     android.app.ActivityThread.main(ActivityThread.java:6077)
04-21 10:28:42.435 24608 24671 E GeckoCrashHandler:     java.lang.reflect.Method.invoke(Native Method)
04-21 10:28:42.435 24608 24671 E GeckoCrashHandler:     com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
04-21 10:28:42.435 24608 24671 E GeckoCrashHandler:     com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)
04-21 10:28:42.435 24608 24671 E AndroidRuntime: FATAL EXCEPTION: MediaPDecoder #
04-21 10:28:42.435 24608 24671 E AndroidRuntime: Process: org.mozilla.geckoview.test:tab2, PID: 24608
04-21 10:28:42.435 24608 24671 E AndroidRuntime: java.lang.SecurityException: Isolated process not allowed to call bindService
04-21 10:28:42.435 24608 24671 E AndroidRuntime: 	at android.os.Parcel.readException(Parcel.java:1683)
04-21 10:28:42.435 24608 24671 E AndroidRuntime: 	at android.os.Parcel.readException(Parcel.java:1636)
04-21 10:28:42.435 24608 24671 E AndroidRuntime: 	at android.app.ActivityManagerProxy.bindService(ActivityManagerNative.java:4374)
04-21 10:28:42.435 24608 24671 E AndroidRuntime: 	at android.app.ContextImpl.bindServiceCommon(ContextImpl.java:1491)
04-21 10:28:42.435 24608 24671 E AndroidRuntime: 	at android.app.ContextImpl.bindService(ContextImpl.java:1450)
04-21 10:28:42.435 24608 24671 E AndroidRuntime: 	at android.content.ContextWrapper.bindService(ContextWrapper.java:636)
04-21 10:28:42.435 24608 24671 E AndroidRuntime: 	at org.mozilla.gecko.media.RemoteManager$RemoteConnection.connect(RemoteManager.java:75)
04-21 10:28:42.435 24608 24671 E AndroidRuntime: 	at org.mozilla.gecko.media.RemoteManager$RemoteConnection.-$$Nest$mconnect(RemoteManager.java)
04-21 10:28:42.435 24608 24671 E AndroidRuntime: 	at org.mozilla.gecko.media.RemoteManager.init(RemoteManager.java:143)
04-21 10:28:42.435 24608 24671 E AndroidRuntime: 	at org.mozilla.gecko.media.RemoteManager.getInstance(RemoteManager.java:37)
04-21 10:28:42.435 24608 24671 E AndroidRuntime: 	at org.mozilla.gecko.media.CodecProxy.create(CodecProxy.java:159)

This test was linked to bug 1700243, which is now marked as Fixed, so I'll file a new bug for fixing and opening this specific test. I'll go ahead and open the others here.

See Also: → 1961624
Pushed by ohall@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/85247a305699 Opening Additional Media Junit tests on Isolated Process r=geckoview-reviewers,owlish
Status: NEW → RESOLVED
Closed: 7 months ago
Resolution: --- → FIXED
Target Milestone: --- → 139 Branch
See Also: → 1988531

https://phabricator.services.mozilla.com/D264619?vs=on&id=1121635#9158314 suggests that this may still be an issue.
Bug 1698214 was not about decoding, so i assume this bug was accidentally closed by https://phabricator.services.mozilla.com/D246049

Status: RESOLVED → REOPENED
Resolution: FIXED → ---

Bug 1981478 might help here.

Depends on: 1981478

Yes that should definitely fix the originally described problem here, as the surface will now be allocated from the RDD process which is not isolated. (Whether or not there will be other issues I cannot say)

Assignee: ohall → nobody
See Also: → 1988727

Some skip-ifs landing tagged to this bug 1810736 soon from bug 1986543.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: