Open Bug 1864622 Opened 2 years ago Updated 2 months ago

PDF content uri cannot be used in an isolated process

Categories

(GeckoView :: General, defect, P3)

Firefox 121
All
Android
defect

Tracking

(Not tracked)

People

(Reporter: calixte, Assigned: m_kato)

References

(Blocks 1 open bug)

Details

(Keywords: leave-open, Whiteboard: [fxdroid] [geckoview] )

Attachments

(2 files)

11-14 11:15:42.339 E/ContentInputStream( 6802): Cannot read the uri: content://org.mozilla.geckoview.test.provider/pdf
11-14 11:15:42.339 E/ContentInputStream( 6802): java.lang.SecurityException: Isolated process not allowed to call getContentProvider
11-14 11:15:42.339 E/ContentInputStream( 6802): at android.os.Parcel.readException(Parcel.java:1683)
11-14 11:15:42.339 E/ContentInputStream( 6802): at android.os.Parcel.readException(Parcel.java:1636)
11-14 11:15:42.339 E/ContentInputStream( 6802): at android.app.ActivityManagerProxy.getContentProvider(ActivityManagerNative.java:4169)
11-14 11:15:42.339 E/ContentInputStream( 6802): at android.app.ActivityThread.acquireProvider(ActivityThread.java:5434)
11-14 11:15:42.339 E/ContentInputStream( 6802): at android.app.ContextImpl$ApplicationContentResolver.acquireUnstableProvider(ContextImpl.java:2267)
11-14 11:15:42.339 E/ContentInputStream( 6802): at android.content.ContentResolver.acquireUnstableProvider(ContentResolver.java:1515)
11-14 11:15:42.339 E/ContentInputStream( 6802): at android.content.ContentResolver.openTypedAssetFileDescriptor(ContentResolver.java:1129)
11-14 11:15:42.339 E/ContentInputStream( 6802): at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:982)
11-14 11:15:42.339 E/ContentInputStream( 6802): at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:905)
11-14 11:15:42.339 E/ContentInputStream( 6802): at org.mozilla.geckoview.ContentInputStream.isReadable(ContentInputStream.java:123)
11-14 11:15:42.339 E/ContentInputStream( 6802): at org.mozilla.gecko.mozglue.GeckoLoader.nativeRun(Native Method)
11-14 11:15:42.339 E/ContentInputStream( 6802): at org.mozilla.gecko.GeckoThread.run(GeckoThread.java:659)

Component: Sandboxing → General
Whiteboard: [fxdroid] [geckoview]

I'll start investigating this.

Recently locally tested w/isolated processes on:

  • org.mozilla.geckoview.test.PdfCreationTest#saveAContentPdfDocument
  • org.mozilla.geckoview.test.PdfCreationTest#dontTryToOpenNullContent - Appears fixed locally, I'll open and test on CI w/other test

Log:

04-18 12:17:41.013  6020  6045 D ContentInputStream: The uri is readable: content://org.mozilla.geckoview.test.provider/pdf
04-18 12:17:41.019  6061  6077 E ContentInputStream: Cannot read the uri: content://org.mozilla.geckoview.test.provider/pdf
04-18 12:17:41.019  6061  6077 E ContentInputStream: java.lang.SecurityException: Isolated process not allowed to call getContentProvider

Relevant lines:

I think some Android function in those referenced lines is indirectly is calling getContentProvider right now, I'll see if I can narrow down the caller.

Assignee: nobody → ohall

Read the full stack:

04-18 13:09:08.187  8189  8205 E ContentInputStream: Cannot read the uri: content://org.mozilla.geckoview.test.provider/pdf
04-18 13:09:08.187  8189  8205 E ContentInputStream: java.lang.SecurityException: Isolated process not allowed to call getContentProvider
04-18 13:09:08.187  8189  8205 E ContentInputStream: 	at android.os.Parcel.readException(Parcel.java:1683)
04-18 13:09:08.187  8189  8205 E ContentInputStream: 	at android.os.Parcel.readException(Parcel.java:1636)
04-18 13:09:08.187  8189  8205 E ContentInputStream: 	at android.app.ActivityManagerProxy.getContentProvider(ActivityManagerNative.java:4169)
04-18 13:09:08.187  8189  8205 E ContentInputStream: 	at android.app.ActivityThread.acquireProvider(ActivityThread.java:5434)
04-18 13:09:08.187  8189  8205 E ContentInputStream: 	at android.app.ContextImpl$ApplicationContentResolver.acquireUnstableProvider(ContextImpl.java:2267)
04-18 13:09:08.187  8189  8205 E ContentInputStream: 	at android.content.ContentResolver.acquireUnstableProvider(ContentResolver.java:1515)
04-18 13:09:08.187  8189  8205 E ContentInputStream: 	at android.content.ContentResolver.openTypedAssetFileDescriptor(ContentResolver.java:1129)
04-18 13:09:08.187  8189  8205 E ContentInputStream: 	at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:982)
04-18 13:09:08.187  8189  8205 E ContentInputStream: 	at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:905)
04-18 13:09:08.187  8189  8205 E ContentInputStream: 	at org.mozilla.geckoview.ContentInputStream.isReadable(ContentInputStream.java:139)
04-18 13:09:08.187  8189  8205 E ContentInputStream: 	at org.mozilla.gecko.mozglue.GeckoLoader.nativeRun(Native Method)
04-18 13:09:08.187  8189  8205 E ContentInputStream: 	at org.mozilla.gecko.GeckoThread.run(GeckoThread.java:498)

It is openAssetFileDescriptor that needs a workaround.

  • PdfCreationTest#dontTryToOpenNullContent appears to be working for
    isolated process.

It is openAssetFileDescriptor that needs a workaround.

This channel isn't e10s compatible. getContentProvider should be called on chrome process. I think we must have IPC for geckoview content channel like bug 1666725 (this issue is for GIOChannel. Linux's content process is under sandbox.)

Keywords: leave-open
Pushed by ohall@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/4dc8ab347ff9 Open Junit PDF Test to Isolated Process r=geckoview-reviewers,m_kato

Thanks for identifying the root cause, m_kato! I'll pass this bug on to you - thanks for offering. The bug is more complicated than I was expecting.

Assignee: ohall → m_kato
Flags: needinfo?(m_kato)

Yep.

Flags: needinfo?(m_kato)

GeckoViewContentChannel runs on content process, so this doesn't work
with isolated process. So we should add the IPC to handle this channel
on parent process.

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

Attachment

General

Created:
Updated:
Size: