Crash in java.lang.ClassCastException: org.mozilla.gecko.favicons.decoders.ICODecoder$ICOIterator cannot be cast to org.mozilla.gecko.favicons.decoders.FaviconDecoder$SingleBitmapIterator

VERIFIED FIXED in Firefox 29

Status

()

Firefox for Android
General
--
critical
VERIFIED FIXED
4 years ago
4 years ago

People

(Reporter: aaronmt, Assigned: ckitching)

Tracking

({crash, regression, reproducible})

Trunk
Firefox 29
All
Android
crash, regression, reproducible
Points:
---
Bug Flags:
in-testsuite ?

Firefox Tracking Flags

(firefox29 verified)

Details

(Whiteboard: [native-crash], crash signature, URL)

Attachments

(1 attachment)

(Reporter)

Description

4 years ago
E/GeckoAppShell(12437): >>> REPORTING UNCAUGHT EXCEPTION FROM THREAD 541 ("GeckoBackgroundThread")
E/GeckoAppShell(12437): java.lang.ClassCastException: org.mozilla.gecko.favicons.decoders.ICODecoder$ICOIterator cannot be cast to org.mozilla.gecko.favicons.decoders.FaviconDecoder$SingleBitmapIterator
E/GeckoAppShell(12437): 	at org.mozilla.gecko.favicons.decoders.LoadFaviconResult.getBytesForDatabaseStorage(LoadFaviconResult.java:53)
E/GeckoAppShell(12437): 	at org.mozilla.gecko.favicons.LoadFaviconTask.doInBackground$2d4c763b(LoadFaviconTask.java:379)
E/GeckoAppShell(12437): 	at org.mozilla.gecko.favicons.LoadFaviconTask.doInBackground$42af7916(LoadFaviconTask.java:42)
E/GeckoAppShell(12437): 	at org.mozilla.gecko.util.UiAsyncTask$BackgroundTaskRunnable.run(UiAsyncTask.java:48)
E/GeckoAppShell(12437): 	at android.os.Handler.handleCallback(Handler.java:733)
E/GeckoAppShell(12437): 	at android.os.Handler.dispatchMessage(Handler.java:95)
E/GeckoAppShell(12437): 	at android.os.Looper.loop(Looper.java:136)
E/GeckoAppShell(12437): 	at org.mozilla.gecko.util.GeckoBackgroundThread.run(GeckoBackgroundThread.java:32)

Visit http://bing.com, crash

bp-2102e821-b915-447e-8fde-fd2502140119

--
Nightly (01/19)
Flags: in-testsuite?
(Reporter)

Updated

4 years ago
Flags: needinfo?(rnewman)
Flags: needinfo?(chriskitching)
(Reporter)

Updated

4 years ago
Severity: normal → critical
Keywords: crash
(Assignee)

Comment 1

4 years ago
Bing doesn't work? Clearly a feature.

The Bing favicon is an ICO containin a single 16x16 BMP payload.

The offending cast is casting to SingleBitmapIterator if the hasMultipleBitmaps flag of the result object is false. The logic of the decoder, however, always uses an ICOIterator if the input is an ICO, even if it only has a single entry.

Since the ICOIterator does some lazy-decoding stuff for ICOs, it seems that the solution is to change this flag to "isICO" and continue always using ICOIterator in such cases.

Patch to follow.
Flags: needinfo?(chriskitching)
(Assignee)

Updated

4 years ago
Assignee: nobody → chriskitching
(Assignee)

Comment 2

4 years ago
Created attachment 8362256 [details] [diff] [review]
Prevent ICO decoder from exploding when faced with single-resource ICOs

This ought to do it. Locally testing bing this does the trick - loads the favicon okay (When it exploded without the patch).

Comments, RNewman?
Attachment #8362256 - Flags: review?(rnewman)
Comment on attachment 8362256 [details] [diff] [review]
Prevent ICO decoder from exploding when faced with single-resource ICOs

Review of attachment 8362256 [details] [diff] [review]:
-----------------------------------------------------------------

If this fixes things, wfm. I'll be around today to hit m-c.
Attachment #8362256 - Flags: review?(rnewman) → review+
(Assignee)

Comment 4

4 years ago
https://hg.mozilla.org/integration/fx-team/rev/7e2c7a2ad679
https://hg.mozilla.org/mozilla-central/rev/b56b70d548a2
Status: NEW → RESOLVED
Last Resolved: 4 years ago
status-firefox29: affected → fixed
Flags: needinfo?(rnewman)
Resolution: --- → FIXED
Hardware: ARM → All
Target Milestone: --- → Firefox 29
(In reply to Richard Newman [:rnewman] from comment #5)
> https://hg.mozilla.org/mozilla-central/rev/b56b70d548a2

Why not just merge fx-team over?
Too much time pressure to wait for a full green fx-team, sheriff the rest, and spend time with m-cMerge. Working on fixing another couple of bugs before work starts for real on Monday :/
Oh happy day: there are actually two bugs here. Even if I fix the decode part, there's still no icon being returned from the DB.
It was the only cset on fx-team that would have been merged and it was already pretty green on fx-team (2hrs is plenty of time for Android builds/tests to run for the most part). Just saying.
(In reply to Richard Newman [:rnewman] from comment #8)
> Oh happy day: there are actually two bugs here. Even if I fix the decode
> part, there's still no icon being returned from the DB.

Oops: this comment should have hit Bug 961538.
https://hg.mozilla.org/mozilla-central/rev/7e2c7a2ad679
(Reporter)

Updated

4 years ago
Status: RESOLVED → VERIFIED
tracking-fennec: ? → ---
status-firefox29: fixed → verified
Duplicate of this bug: 961910
You need to log in before you can comment on or make changes to this bug.