Closed Bug 1355676 Opened 7 years ago Closed 7 years ago

Crash in java.lang.NullPointerException: Attempt to invoke virtual method ''android.graphics.Bitmap org.mozilla.gecko.icons.decoders.LoadFaviconResult.getBestBitmap(int)'' on a null object reference at org.mozilla.gecko.BrowserApp.handleMessage(Browser...

Categories

(Firefox for Android Graveyard :: Web Apps (PWAs), defect, P1)

All
Android
defect

Tracking

(fennec55+, firefox-esr52 unaffected, firefox53 wontfix, firefox54 wontfix, firefox55 verified)

VERIFIED FIXED
Firefox 55
Tracking Status
fennec 55+ ---
firefox-esr52 --- unaffected
firefox53 --- wontfix
firefox54 --- wontfix
firefox55 --- verified

People

(Reporter: ting, Assigned: daleharvey)

References

Details

(Keywords: crash)

Crash Data

Attachments

(2 files)

This bug was filed from the Socorro interface and is 
report bp-2568070c-7f98-404b-b13d-07f912170410.
=============================================================
Top #2 of Nightly 20170409194153 on Android, 5 crashes from 1 installation. There are 17 reports from 5 installations in the past week.
The first observation was from build 20170405074742. Do you know any recent changes could cause this?
Flags: needinfo?(s.kaspari)
This seems to be in our web app code:

>  final Bitmap icon = FaviconDecoder
>      .decodeDataURI(getContext(), message.getString("icon"))
>      .getBestBitmap(GeckoAppShell.getPreferredIconSize());

Android Studio actually warns that decodeDataURI() might return null.
Blocks: 1285858
tracking-fennec: --- → ?
Flags: needinfo?(s.kaspari) → needinfo?(dale)
Hardware: Unspecified → All
[triage]
this is feature release blocker.
tracking-fennec: ? → 55+
Priority: -- → P1
Cheers will take it
Assignee: nobody → dale
Flags: needinfo?(dale)
Changed both instances of the same code
Attachment #8860115 - Flags: review?(s.kaspari)
Comment on attachment 8860115 [details] [diff] [review]
Check for nulls when decoding icons

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

::: mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
@@ +2055,5 @@
> +                    final Bitmap icon = loadIconResult
> +                        .getBestBitmap(GeckoAppShell.getPreferredIconSize());
> +                    createAppShortcut(name, startUrl, manifestPath, icon);
> +                } else {
> +                    Log.e(LOGTAG, "Failed to load icon for: " + startUrl);

We try to avoid logging URLs as in earlier Android versions other apps can read our log.
Attachment #8860115 - Flags: review?(s.kaspari) → review+
Ah yeh apologies you mentioned that in a previous review, will take out the url
Pushed by dharvey@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/841fa5fb06a8
Check for nulls when decoding icons. r=sebastian
https://hg.mozilla.org/mozilla-central/rev/841fa5fb06a8
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 55
crash-stats shows a couple hits on 54.0a2 - is this something we should consider uplifting to Beta as well?
Blocks: 1234558
Flags: needinfo?(dale)
Nah we are aiming for 55, this is disabled in 54 so the only people that could hit it are testing so I dont think we need to worry about uplifts
Flags: needinfo?(dale)
I initially reproduced this crash by installing snapdrop.net as a standalone web app on a Huawei 5X (Android 5.1) device.

The crash is now fixed, but I can't add the snapdrop.net page as a web app. It doesn't return any error/message, no response. This happens only on my Huawei and Xiamoi devices. On others, it works well.

note: The page can be added as a regular homescreen shortcut (with manifest.install.enabled false).
Thats quite confusing, yeh I can install snapdrop.net fine on my pixel, did you / could you file a bug about that? I couldnt get this reproduced. This fix is fine but yeh if there is another root cause would like to take a look at that
Logged Bug 1360455. Thanks!
Status: RESOLVED → VERIFIED
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: