crash in java.lang.NullPointerException: Attempt to invoke interface method ''android.view.MenuItem android.view.Menu.add(int, int, int, java.lang.CharSequence)'' on a null object reference at android.view.MenuInflater$MenuState.addItem(MenuInflater.java)

RESOLVED INVALID

Status

()

Firefox for Android
General
--
critical
RESOLVED INVALID
3 years ago
2 years ago

People

(Reporter: aaronmt, Assigned: sebastian)

Tracking

({crash})

37 Branch
All
Android
crash
Points:
---

Firefox Tracking Flags

(fennec44+)

Details

(crash signature)

(Reporter)

Description

3 years ago
This bug was filed from the Socorro interface and is 
report bp-627535a1-2898-4165-8c88-d50982141221.
=============================================================

java.lang.NullPointerException: Attempt to invoke interface method 'android.view.MenuItem android.view.Menu.add(int, int, int, java.lang.CharSequence)' on a null object reference
	at android.view.MenuInflater$MenuState.addItem(MenuInflater.java:492)
	at android.view.MenuInflater.parseMenu(MenuInflater.java:189)
	at android.view.MenuInflater.inflate(MenuInflater.java:110)
	at org.mozilla.gecko.GeckoApp.onCreateOptionsMenu(GeckoApp.java:326)
	at org.mozilla.gecko.BrowserApp.onCreateOptionsMenu(BrowserApp.java:2757)
	at android.app.Activity.onCreatePanelMenu(Activity.java:2820)
	at android.support.v4.app.FragmentActivity.onCreatePanelMenu(Unknown Source)
	at org.mozilla.gecko.GeckoApp.onCreatePanelMenu(GeckoApp.java:403)
	at org.mozilla.gecko.GeckoApp.getMenuPanel(GeckoApp.java:340)
	at org.mozilla.gecko.toolbar.BrowserToolbar.openOptionsMenu(BrowserToolbar.java:897)
	at org.mozilla.gecko.BrowserApp.openOptionsMenu(BrowserApp.java:2799)
	at org.mozilla.gecko.toolbar.BrowserToolbar$8.onClick(BrowserToolbar.java:360)
	at android.view.View.performClick(View.java:4756)
	at android.view.View$PerformClick.run(View.java:19749)
	at android.os.Handler.handleCallback(Handler.java:739)
	at android.os.Handler.dispatchMessage(Handler.java:95)
	at android.os.Looper.loop(Looper.java:135)
	at android.app.ActivityThread.main(ActivityThread.java:5221)
	at java.lang.reflect.Method.invoke(Native Method)
	at java.lang.reflect.Method.invoke(Method.java:372)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:898)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:693)
(Reporter)

Updated

3 years ago
Blocks: 909434

Updated

2 years ago
Crash Signature: [@ java.lang.NullPointerException: Attempt to invoke interface method ''android.view.MenuItem android.view.Menu.add(int, int, int, java.lang.CharSequence)'' on a null object reference at android.view.MenuInflater$MenuState.addItem(MenuInflater.java)] → [@ java.lang.NullPointerException: Attempt to invoke interface method ''android.view.MenuItem android.view.Menu.add(int, int, int, java.lang.CharSequence)'' on a null object reference at android.view.MenuInflater$MenuState.addItem(MenuInflater.java…
Looks like the crash rate spiked for this sometime last week: https://crash-stats.mozilla.com/report/list?product=FennecAndroid&signature=java.lang.NullPointerException%3A+Attempt+to+invoke+interface+method+%27%27android.view.MenuItem+android.view.Menu.add%28int%2C+int%2C+int%2C+java.lang.CharSequence%29%27%27+on+a+null+object+reference+at+android.view.MenuInflater%24MenuState.addItem%28MenuInflater.java%29#tab-reports

I can reproduce this 100% on my Moto X Pure Edition simply by tapping the menu button.
tracking-fennec: --- → ?
(Assignee)

Comment 2

2 years ago
This seems to be not related to bug 909434.
No longer blocks: 909434
(Assignee)

Comment 3

2 years ago
I can see exactly this error on a Gingerbread device after enabling the overflow menu there (bug 1209967) and clicking it.

Comment 4

2 years ago
I see this as #15 in 44, but not in the top 50 in 43/42.
Assignee: nobody → s.kaspari
tracking-fennec: ? → 44+
(Assignee)

Comment 5

2 years ago
With my patch in bug 1209967 this happened because hasMenuButton() returned false and Versions.feature11Plus returned false. Our current menu inflation implementation does not handle this well. However I can't see how this could happen on a Moto X.
(Assignee)

Comment 6

2 years ago
I can reproduce this on my N5 by installing the 2.3/Gingerbread build (-> feature11Plus will return false) on my N5 and pressing the menu button.

Brian: Can you check about:buildconfig if you have the 2.3/API9 build installed too?

Regarding the spike: Is this crash behavior new when installing the Gingerbread build? Should/can we prevent this? Do we not set maxSdkVersion to disable installation?
Flags: needinfo?(bnicholson)
(In reply to Sebastian Kaspari (:sebastian) from comment #6)
> Brian: Can you check about:buildconfig if you have the 2.3/API9 build
> installed too?

Ah, looks like that's it. Good catch!
Flags: needinfo?(bnicholson)
Invalid?
Depends on: 1119915
I think there's still a bug on Gingerbread (comment 3), though I don't know how far we are from the Gingerbread EOL.
(Assignee)

Comment 10

2 years ago
We can close this one. The gingerbread bug (comment 3) only occurs with my WIP patches (bug 1209967). I am going to pick up bug 1119915.
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.