IllegalArgumentException in HighlightedDomainUrlKt.computeDomainEndScrollValue
Categories
(Firefox for Android :: Toolbar, defect)
Tracking
()
People
(Reporter: polly, Assigned: petru)
References
Details
(Keywords: crash, Whiteboard: [fxdroid][android-core] )
Attachments
(6 files)
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-beta+
|
Details | Review |
|
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-beta+
|
Details | Review |
|
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-release+
|
Details | Review |
|
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-release+
|
Details | Review |
Crash observed in play store since firefox v153
Exception java.lang.IllegalArgumentException:
at androidx.compose.ui.text.internal.InlineClassHelperKt.throwIllegalArgumentException (InlineClassHelper.kt:53)
at androidx.compose.ui.text.MultiParagraph.getPathForRange (MultiParagraph.java:1262)
at androidx.compose.ui.text.TextLayoutResult.getPathForRange (TextLayoutResult.kt:533)
at mozilla.components.compose.browser.toolbar.ui.HighlightedDomainUrlKt.computeDomainEndScrollValue (HighlightedDomainUrl.kt:222)
at mozilla.components.compose.browser.toolbar.ui.HighlightedDomainUrlKt$focusTextIndexRange$2$1$1.invokeSuspend (HighlightedDomainUrl.kt:151)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith (ContinuationImpl.kt:34)
at kotlinx.coroutines.DispatchedTask.run (DispatchedTask.kt:100)
at androidx.compose.ui.platform.AndroidUiDispatcher.performTrampolineDispatch (AndroidUiDispatcher.android.kt:79)
at androidx.compose.ui.platform.AndroidUiDispatcher.access$performTrampolineDispatch (AndroidUiDispatcher.android.kt:41)
at androidx.compose.ui.platform.AndroidUiDispatcher$dispatchCallback$1.run (AndroidUiDispatcher.android.kt:57)
at android.os.Handler.handleCallback (Handler.java:938)
at android.os.Handler.dispatchMessage (Handler.java:99)
at android.os.Looper.loopOnce (Looper.java:210)
at android.os.Looper.loop (Looper.java:299)
at android.app.ActivityThread.main (ActivityThread.java:8280)
at java.lang.reflect.Method.invoke
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:576)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1073)
| Reporter | ||
Comment 1•13 days ago
|
||
looks like this code is throwing, because the index is out of bounds
maybe we need to be more defensive in this calculation
| Assignee | ||
Updated•13 days ago
|
Updated•13 days ago
|
| Assignee | ||
Updated•12 days ago
|
| Assignee | ||
Comment 2•12 days ago
|
||
buildUrlAnnotatedString logged but still added a LinkAnnotation when the link
text was blank or not found in the full text (indexOf returned -1), producing a
span with a negative start that crashed later in the text layout pass.
Skip such links instead so the text still renders, just without the broken
clickable span. This mainly guards against localized strings whose link
substring drifts out of the full text.
| Assignee | ||
Comment 3•12 days ago
|
||
computeDomainEndScrollValue passed the registrable domain indices straight to
getPathForRange, which throws if they are out of range or start > end. Coerce
them so 0 <= startIndex <= endIndex <= text.length always holds, guarding
against a caller supplying a domain span inconsistent with the displayed URL.
This is mostly hardening the changes done for bug 2056836.
https://hg.mozilla.org/mozilla-central/rev/ed69de72aa79
https://hg.mozilla.org/mozilla-central/rev/de36f9398a2e
Updated•11 days ago
|
Comment 6•11 days ago
|
||
The patch landed in nightly and beta is affected.
:petru, is this bug important enough to require an uplift?
- If yes, please nominate the patch for beta approval.
- See https://wiki.mozilla.org/Release_Management/Requesting_an_Uplift for documentation on how to request an uplift.
- If no, please set
status-firefox154towontfix.
For more information, please visit BugBot documentation.
| Assignee | ||
Comment 7•8 days ago
|
||
Checking what happened over the weekend I see that we haven't had any more of these crash in Nightly while in total we had a few hundreds crashes in beta and a few thousands of crashes in release so with the fix for this being small we should look into uplifting it.
| Assignee | ||
Comment 8•8 days ago
|
||
buildUrlAnnotatedString logged but still added a LinkAnnotation when the link
text was blank or not found in the full text (indexOf returned -1), producing a
span with a negative start that crashed later in the text layout pass.
Skip such links instead so the text still renders, just without the broken
clickable span. This mainly guards against localized strings whose link
substring drifts out of the full text.
Original Revision: https://phabricator.services.mozilla.com/D315282
Updated•8 days ago
|
Comment 9•8 days ago
|
||
firefox-beta Uplift Approval Request
- User impact if declined/Reason for urgency: Potential crashes in the toolbar from trying to highlight the URL domain concurrently with the URL being changed.
- Code covered by automated testing?: yes
- Fix verified in Nightly?: no
- Needs manual QE testing?: no
- Steps to reproduce for manual QE testing: Issue depends on a race condition - hard to reproduce. We can check the crash reports to assess the impact of the fix.
- Risk associated with taking this patch: low
- Explanation of risk level: Small patch which avoids the original crash as per the Google Play statistics without causing other problems.
- String changes made/needed?: --
- Is Android affected?: yes
| Assignee | ||
Comment 10•8 days ago
|
||
computeDomainEndScrollValue passed the registrable domain indices straight to
getPathForRange, which throws if they are out of range or start > end. Coerce
them so 0 <= startIndex <= endIndex <= text.length always holds, guarding
against a caller supplying a domain span inconsistent with the displayed URL.
This is mostly hardening the changes done for bug 2056836.
Original Revision: https://phabricator.services.mozilla.com/D315283
| Assignee | ||
Comment 11•8 days ago
|
||
buildUrlAnnotatedString logged but still added a LinkAnnotation when the link
text was blank or not found in the full text (indexOf returned -1), producing a
span with a negative start that crashed later in the text layout pass.
Skip such links instead so the text still renders, just without the broken
clickable span. This mainly guards against localized strings whose link
substring drifts out of the full text.
Original Revision: https://phabricator.services.mozilla.com/D315282
Updated•8 days ago
|
Comment 12•8 days ago
|
||
firefox-release Uplift Approval Request
- User impact if declined/Reason for urgency: Potential crashes in the toolbar from trying to highlight the URL domain concurrently with the URL being changed.
- Code covered by automated testing?: yes
- Fix verified in Nightly?: no
- Needs manual QE testing?: no
- Steps to reproduce for manual QE testing: Issue depends on a race condition - hard to reproduce. We can check the crash reports to assess the impact of the fix.
- Risk associated with taking this patch: low
- Explanation of risk level: Small patch which avoids the original crash as per the Google Play statistics without causing other problems.
- String changes made/needed?: --
- Is Android affected?: yes
| Assignee | ||
Comment 13•8 days ago
|
||
computeDomainEndScrollValue passed the registrable domain indices straight to
getPathForRange, which throws if they are out of range or start > end. Coerce
them so 0 <= startIndex <= endIndex <= text.length always holds, guarding
against a caller supplying a domain span inconsistent with the displayed URL.
This is mostly hardening the changes done for bug 2056836.
Original Revision: https://phabricator.services.mozilla.com/D315283
Let's assess the crash data in beta first and if it's good, we can uplift in next week dot release.
Updated•8 days ago
|
Updated•8 days ago
|
Updated•8 days ago
|
Comment 15•8 days ago
|
||
| uplift | ||
Updated•4 days ago
|
Updated•4 days ago
|
Updated•4 days ago
|
Comment 16•4 days ago
|
||
| uplift | ||
Updated•17 hours ago
|
Description
•