Closed Bug 1888978 Opened 1 year ago Closed 1 year ago

Crash in [@ java.lang.IllegalStateException: at android.os.Parcel.createExceptionOrNull(Parcel.java)]

Categories

(GeckoView :: PDF Viewer, defect, P1)

Unspecified
Android
defect

Tracking

(firefox124 wontfix, firefox125 wontfix, firefox126 fixed)

RESOLVED FIXED
126 Branch
Tracking Status
firefox124 --- wontfix
firefox125 --- wontfix
firefox126 --- fixed

People

(Reporter: calu, Assigned: calu)

References

(Regression)

Details

(Keywords: crash, regression, Whiteboard: [fxdroid] [group4] )

Crash Data

Attachments

(1 file)

Crash report: https://crash-stats.mozilla.org/report/index/4afbc268-4fd7-4330-a166-cfe7e0240401

Java stack trace:

java.lang.IllegalStateException
	at android.os.Parcel.createExceptionOrNull(Parcel.java:2394)
	at android.os.Parcel.createException(Parcel.java:2370)
	at android.os.Parcel.readException(Parcel.java:2353)
	at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:190)
	at android.database.DatabaseUtils.readExceptionWithFileNotFoundExceptionFromParcel(DatabaseUtils.java:153)
	at android.content.ContentProviderProxy.openTypedAssetFile(ContentProviderNative.java:781)
	at android.content.ContentResolver.openTypedAssetFileDescriptor(ContentResolver.java:1993)
	at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:1808)
	at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:1724)
	at org.mozilla.geckoview.ContentInputStream.isReadable(ContentInputStream.java:38)
	at org.mozilla.gecko.mozglue.GeckoLoader.nativeRun(Native Method)
	at org.mozilla.gecko.GeckoThread.run(GeckoThread.java:615)

Hey Calixte, does this crash look familiar to you?
Looks like it interacts with GeckoViewContentChannel.OpenContentStream calling ContentInputStream.isReadable: https://searchfox.org/mozilla-central/rev/10f46c9c638e0e5935ed9fa12aadc9d0d4e71ade/mobile/android/components/geckoview/GeckoViewContentChannel.cpp#30
Any idea why it might be causing a createExceptionOrNull crash?

Flags: needinfo?(cdenizet)

Set release status flags based on info from the regressing bug 1815739

:calu, it's very likely unrelated and it isn't fixed by the mentioned patch.
According to the docs:
https://developer.android.com/reference/android/content/ContentResolver#openAssetFileDescriptor(android.net.Uri,%20java.lang.String)
openAssetFileDescriptor is supposed to throw a FileNotFoundException which is caught under IOException.
I'd say that the content provider (which is an other app) is failing to provide the queried file.
So an easy fix would be to just catch IllegalStateException:
https://searchfox.org/mozilla-central/source/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/ContentInputStream.java#149
:olivia, what do you think about adding IllegalStateException to list of the potential exception types ? or about just catching Exception to avoid any other future issues ?

Flags: needinfo?(cdenizet) → needinfo?(ohall)
Whiteboard: [fxdroid] [group4]

Thanks for looking into this!

:olivia, what do you think about adding IllegalStateException to list of the potential exception types ? or about just catching Exception to avoid any other future issues ?

I like both ideas! Just catching Exception seems reasonable to me, since it seems like there is a lot of potentially different exceptions and we don't have any branching behavior based on exception.

Flags: needinfo?(ohall)
Assignee: nobody → calu
Priority: -- → P1
Pushed by calu@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/69ec5a7efc4d Catch exceptions for PDF Viewer openAssetFileDescriptor r=geckoview-reviewers,ohall,calixte
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 126 Branch

The patch landed in nightly and beta is affected.
:calu, is this bug important enough to require an uplift?

  • If yes, please nominate the patch for beta approval.
  • If no, please set status-firefox125 to wontfix.

For more information, please visit BugBot documentation.

Flags: needinfo?(calu)
Flags: needinfo?(calu)

This is fine to let it to go to nightly.

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

Attachment

General

Created:
Updated:
Size: