Closed Bug 1677838 Opened 4 years ago Closed 3 years ago

NumberFormatExceptionjava.lang.Integer in parseInt fatal for input string: "undefined"

Categories

(GeckoView :: IME, defect, P1)

Unspecified
All

Tracking

(firefox84+ fixed, firefox85+ fixed)

RESOLVED FIXED
85 Branch
Tracking Status
firefox84 + fixed
firefox85 + fixed

People

(Reporter: amejia, Assigned: esawin)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

We are seeing these crash being reported on sentry multiple times

Fenix related issue https://github.com/mozilla-mobile/fenix/issues/16623
Sentry crash https://sentry.prod.mozaws.net/operations/firefox-nightly/issues/9812825/

java.lang.NumberFormatException: For input string: "undefined"
    at java.lang.Integer.parseInt(Integer.java:615)
    at java.lang.Integer.valueOf(Integer.java:801)
    at org.mozilla.geckoview.MediaSession$Metadata.fromBundle(MediaSession.java:16)
    at org.mozilla.geckoview.MediaSession$Handler.handleMessage(MediaSession.java:9)
    at org.mozilla.geckoview.MediaSession$Handler.handleMessage(MediaSession.java:1)
    at org.mozilla.geckoview.GeckoSessionHandler.handleMessage(GeckoSessionHandler.java:2)
    at org.mozilla.gecko.EventDispatcher$2.run(EventDispatcher.java:1)
    at android.os.Handler.handleCallback(Handler.java:883)
    at android.os.Handler.dispatchMessage(Handler.java:100)
    at android.os.Looper.loop(Looper.java:214)
    at android.app.ActivityThread.main(ActivityThread.java:7682)
    at java.lang.reflect.Method.invoke(Method.java)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:516)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)

Eugen, any ideas?

Flags: needinfo?(esawin)

The line numbers in the stack trace are garbage and the stack seems incomplete.
Since on this path, we only use Integer.valueOf in ImageResource sizes parsing, I assume we're encountering invalid size strings and fail when trying to make them fit the <int>x<int> format.
Let's ignore those invalid size strings.

Flags: needinfo?(esawin)
Assignee: nobody → esawin
Status: NEW → ASSIGNED
Priority: -- → P1
Blocks: 1681352

Filed bug 1681352 to investigate a Gecko/DOM validation solution.

Pushed by esawin@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e764199bb911
[1.0] Verify the image resource size string is valid before accepting it. r=geckoview-reviewers,agi
Attachment #9189236 - Attachment description: Bug 1677838 - [1.0] Verify the image resource size string is valid before accepting it. → Bug 1677838 - [1.1] Verify the image resource size string is valid before accepting it.
Pushed by esawin@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ac5832465c28
[1.1] Verify the image resource size string is valid before accepting it. r=geckoview-reviewers,agi
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 85 Branch
Flags: needinfo?(esawin)

[Tracking Requested - why for this release]: Crashes on cnn.com live video. If we have not pushed the buttons for 84.1.4 this seems like a good ridealong.

Comment on attachment 9189236 [details]
Bug 1677838 - [1.1] Verify the image resource size string is valid before accepting it.

Beta/Release Uplift Approval Request

  • User impact if declined: Crash when opening cnn.com and other pages
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Mostly adding a try { } catch block and ignoring bad data, patch has been in nightly and beta for a while
  • String changes made/needed: N/A
Attachment #9189236 - Flags: approval-mozilla-release?

Comment on attachment 9189236 [details]
Bug 1677838 - [1.1] Verify the image resource size string is valid before accepting it.

Approved for Fenix 84.1.4.

Attachment #9189236 - Flags: approval-mozilla-release? → approval-mozilla-release+

Moving some input bugs to the new GeckoView::IME component.

Component: General → IME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: