Closed Bug 1136157 Opened 10 years ago Closed 8 years ago

crash in java.lang.NullPointerException: Attempt to invoke virtual method ''int java.lang.Object.hashCode()'' on a null object reference at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java)

Categories

(Firefox for Android Graveyard :: Favicon Handling, defect)

ARM
Android
defect
Not set
critical

Tracking

(firefox36 affected, firefox37 affected, firefox38 affected, firefox39 affected, fennec+)

RESOLVED WORKSFORME
Tracking Status
firefox36 --- affected
firefox37 --- affected
firefox38 --- affected
firefox39 --- affected
fennec + ---

People

(Reporter: TeoVermesan, Unassigned, Mentored)

Details

(Keywords: crash, regression, Whiteboard: [good second bug][lang=java])

Crash Data

This bug was filed from the Socorro interface and is report bp-36da1f4d-a968-4cc0-9225-388db2150224. ============================================================= Steps to reproduce: 1. Open about:reader 2. Open tab tray 3. Tap the three-dots-menu and choose "Close all tabs" Expected results: - about:home is displayed Actual results: - Firefox crashes
java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.Object.hashCode()' on a null object reference at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:883) at org.mozilla.gecko.util.NonEvictingLruCache.get(NonEvictingLruCache.java:26) at org.mozilla.gecko.favicons.Favicons.getSizedFaviconForPageFromLocal(Favicons.java:267) at org.mozilla.gecko.favicons.Favicons.getSizedFaviconForPageFromLocal(Favicons.java:295) at org.mozilla.gecko.home.TwoLinePageRow.update(TwoLinePageRow.java:260) at org.mozilla.gecko.home.TwoLinePageRow.updateFromCursor(TwoLinePageRow.java:291) at org.mozilla.gecko.home.RecentTabsPanel$RecentTabsAdapter.bindView(RecentTabsPanel.java:402) at org.mozilla.gecko.home.MultiTypeCursorAdapter.getView(MultiTypeCursorAdapter.java:62)
tracking-fennec: --- → ?
Null page URL passed to getSizedFaviconForPageFromLocal. It doesn't null-check. Easy fix.
Rather, easy band-aid. It's not obvious why there's a null URL here; maybe we somehow saw a snapshot of about:home before it had a URL? We should fix that, too.
(In reply to Richard Newman [:rnewman] from comment #2) > Null page URL passed to getSizedFaviconForPageFromLocal. It doesn't > null-check. Easy fix. Definitely something that should be fixed at the caller: getSizedFaviconForPageFromLocal with no page URL is nonsensical, and defensive null checks aren't nice. We were called from TwoLinePageRow. Since it didn't NPE at line 248 (where it does url.equals(mPageUrl)), TwoLinePageRow.update definitely got a non-null url. The root of the problem, then, is that ReaderModeUtils.getUrlFromAboutReader(url) is returning null.
(In reply to Richard Newman [:rnewman] from comment #3) > > maybe we somehow saw a snapshot of about:home before it had a URL? We should fix > that, too. It is about:reader not about:home; see bug 1136167.
Assignee: nobody → margaret.leibovic
tracking-fennec: ? → +
Assignee: margaret.leibovic → rnewman
Assignee: rnewman → nobody
Mentor: rnewman
Whiteboard: [good second bug][lang=java]
Crash Signature: [@ java.lang.NullPointerException: Attempt to invoke virtual method ''int java.lang.Object.hashCode()'' on a null object reference at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java)] → [@ java.lang.NullPointerException: Attempt to invoke virtual method ''int java.lang.Object.hashCode()'' on a null object reference at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java)] [@ java.lang.NullPointerException: Attempt to invoke…
I can take this up if nobody's working on it. Would it be OK if I tested for the return value of StringUtils.getQueryParameter() and if it's null, I can return "about:home"? Would that fix the problem or is that too simplistic?
Flags: needinfo?(rnewman)
(In reply to swaroop.rao from comment #6) > I can take this up if nobody's working on it. Would it be OK if I tested for > the return value of StringUtils.getQueryParameter() and if it's null, I can > return "about:home"? Would that fix the problem or is that too simplistic? That's too simplistic. The caller shouldn't be passing a null URL. Above that, we shouldn't be in a state where we don't know the page URL at the time we try to fetch the icon. In comment 4, Chris suggests that ReaderModeUtils.getUrlFromAboutReader is failing to return a URL. But I can't reproduce this bug with an old 2015-12 Nightly, nor with today's Nightly, so I'm going to close this bug!
Status: NEW → RESOLVED
Closed: 8 years ago
Flags: needinfo?(rnewman)
Resolution: --- → WORKSFORME
Product: Firefox for Android → Firefox for Android Graveyard

Removing regressionwindow-wanted keyword because this bug has been resolved.

Removing regressionwindow-wanted keyword because this bug has been resolved.

Removing regressionwindow-wanted keyword because this bug has been resolved.

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