Closed Bug 1411827 Opened 7 years ago Closed 7 years ago

Crash in java.lang.NullPointerException: Attempt to invoke interface method ''android.view.MenuItem android.view.MenuItem.setChecked(boolean)'' on a null object reference at org.mozilla.gecko.BrowserApp.onPrepareOptionsMenu(BrowserApp.java) (Android O)

Categories

(Firefox for Android Graveyard :: General, defect, P1)

56 Branch
Unspecified
Android
defect

Tracking

(fennec+, firefox57 fixed)

RESOLVED FIXED
Firefox 57
Tracking Status
fennec + ---
firefox57 --- fixed

People

(Reporter: bli, Assigned: cnevinchen)

References

Details

(Whiteboard: [FNC][SPT59.1][INT])

Crash Data

Feedback from users:
----------------------------------
HUAWEI Mate 10
Android 8.0
Firefox for Android 56.0

Tapping on the Menu icon on the right top corner
=> Crash

https://crash-stats.mozilla.com/report/index/69399670-5d8a-4d49-9fcf-8b04c0171023


As far as we know, HUAWEI launched their latest product, Mate 10, with Android 8.0, OPPO and VIVO,two major mobile manufacturers in China, are going to launch their new product with Android 8.0 soon, so the priority is set to P1.

Additional info from HUAWEI:
-------------------------------------------
10-23 15:43:06.499 17181 17181 E AndroidRuntime: FATAL EXCEPTION: main
10-23 15:43:06.499 17181 17181 E AndroidRuntime: Process: org.mozilla.firefox, PID: 17181
10-23 15:43:06.499 17181 17181 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke interface method 'android.view.MenuItem android.view.MenuItem.setChecked(boolean)' on a null object reference
10-23 15:43:06.499 17181 17181 E AndroidRuntime:          at org.mozilla.gecko.BrowserApp.onPrepareOptionsMenu(BrowserApp.java:3527)
10-23 15:43:06.499 17181 17181 E AndroidRuntime:          at org.mozilla.gecko.GeckoApp.invalidateOptionsMenu(GeckoApp.java:439)
10-23 15:43:06.499 17181 17181 E AndroidRuntime:          at org.mozilla.gecko.GeckoApp.getMenuPanel(GeckoApp.java:461)
10-23 15:43:06.499 17181 17181 E AndroidRuntime:          at org.mozilla.gecko.toolbar.BrowserToolbar.openOptionsMenu(BrowserToolbar.java:882)
10-23 15:43:06.499 17181 17181 E AndroidRuntime:          at org.mozilla.gecko.BrowserApp.openOptionsMenu(BrowserApp.java:3490)
10-23 15:43:06.499 17181 17181 E AndroidRuntime:          at org.mozilla.gecko.toolbar.BrowserToolbar$7.onClick(BrowserToolbar.java:337)
10-23 15:43:06.499 17181 17181 E AndroidRuntime:          at android.view.View.performClick(View.java:6291)
10-23 15:43:06.499 17181 17181 E AndroidRuntime:          at android.view.View$PerformClick.run(View.java:24931)
10-23 15:43:06.499 17181 17181 E AndroidRuntime:          at android.os.Handler.handleCallback(Handler.java:808)
10-23 15:43:06.499 17181 17181 E AndroidRuntime:          at android.os.Handler.dispatchMessage(Handler.java:101)
10-23 15:43:06.499 17181 17181 E AndroidRuntime:          at android.os.Looper.loop(Looper.java:166)
10-23 15:43:06.499 17181 17181 E AndroidRuntime:          at android.app.ActivityThread.main(ActivityThread.java:7358)
10-23 15:43:06.499 17181 17181 E AndroidRuntime:          at java.lang.reflect.Method.invoke(Native Method)
10-23 15:43:06.499 17181 17181 E AndroidRuntime:          at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
10-23 15:43:06.499 17181 17181 E AndroidRuntime:          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:926)
10-23 15:43:06.499 12493 12509 W zygote  : Couldn't lock the profile file /data/user/0/com.tencent.qqmusic/app_tbs/core_unzip_tmp/game_impl_dex.jar.prof: Failed to open file '/data/user/0/com.tencent.qqmusic/app_tbs/core_unzip_tmp/game_impl_dex.jar.prof': No such file or directory
10-23 15:43:06.499 12493 12509 W zygote  : Could not forcefully load profile /data/user/0/com.tencent.qqmusic/app_tbs/core_unzip_tmp/game_impl_dex.jar.prof
10-23 15:43:06.499 17181 17181 E GeckoCrashHandler: >>> REPORTING UNCAUGHT EXCEPTION FROM THREAD 1 ("main")
10-23 15:43:06.499 17181 17181 E GeckoCrashHandler: java.lang.NullPointerException: Attempt to invoke interface method 'android.view.MenuItem android.view.MenuItem.setChecked(boolean)' on a null object reference
10-23 15:43:06.499 17181 17181 E GeckoCrashHandler:    at org.mozilla.gecko.BrowserApp.onPrepareOptionsMenu(BrowserApp.java:3527)
10-23 15:43:06.499 17181 17181 E GeckoCrashHandler:    at org.mozilla.gecko.GeckoApp.invalidateOptionsMenu(GeckoApp.java:439)
10-23 15:43:06.499 17181 17181 E GeckoCrashHandler:    at org.mozilla.gecko.GeckoApp.getMenuPanel(GeckoApp.java:461)
10-23 15:43:06.499 17181 17181 E GeckoCrashHandler:    at org.mozilla.gecko.toolbar.BrowserToolbar.openOptionsMenu(BrowserToolbar.java:882)
10-23 15:43:06.499 17181 17181 E GeckoCrashHandler:    at org.mozilla.gecko.BrowserApp.openOptionsMenu(BrowserApp.java:3490)
10-23 15:43:06.499 17181 17181 E GeckoCrashHandler:    at org.mozilla.gecko.toolbar.BrowserToolbar$7.onClick(BrowserToolbar.java:337)
10-23 15:43:06.499 17181 17181 E GeckoCrashHandler:    at android.view.View.performClick(View.java:6291)
10-23 15:43:06.499 17181 17181 E GeckoCrashHandler:    at android.view.View$PerformClick.run(View.java:24931)
10-23 15:43:06.499 17181 17181 E GeckoCrashHandler:    at android.os.Handler.handleCallback(Handler.java:808)
10-23 15:43:06.499 17181 17181 E GeckoCrashHandler:    at android.os.Handler.dispatchMessage(Handler.java:101)
10-23 15:43:06.499 17181 17181 E GeckoCrashHandler:    at android.os.Looper.loop(Looper.java:166)
10-23 15:43:06.499 17181 17181 E GeckoCrashHandler:    at android.app.ActivityThread.main(ActivityThread.java:7358)
10-23 15:43:06.499 17181 17181 E GeckoCrashHandler:    at java.lang.reflect.Method.invoke(Native Method)
10-23 15:43:06.499 17181 17181 E GeckoCrashHandler:    at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
10-23 15:43:06.499 17181 17181 E GeckoCrashHandler:    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:926)
According to Crash Stats this crash seems indeed O-only.

There are only two places in BrowserApp.onPrepareOptionsMenu where we call setChecked:
https://dxr.mozilla.org/mozilla-release/rev/ca38c18d63f9dd59c93179cf3c43ddee58793f1e/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java#3535,3543

Since bookmark.setChecked is preceded by other method invocations that apparently don't crash, this means that it is presumably the desktopMode MenuItem that's gone AWOL. Why it's missing I've got no idea, though.
Severity: normal → critical
tracking-fennec: --- → ?
Crash Signature: [@ java.lang.NullPointerException: Attempt to invoke interface method ''android.view.MenuItem android.view.MenuItem.setChecked(boolean)'' on a null object reference at org.mozilla.gecko.BrowserApp.onPrepareOptionsMenu(BrowserApp.java)]
OS: Unspecified → Android
Summary: Crash in java.lang.NullPointerException: Attempt to invoke interface method ''android.view.MenuItem android.view.MenuItem.setChecked(boolean)'' on a null object reference at org.mozilla.gecko.BrowserApp.onPrepareOptionsMenu(BrowserApp.java) → Crash in java.lang.NullPointerException: Attempt to invoke interface method ''android.view.MenuItem android.view.MenuItem.setChecked(boolean)'' on a null object reference at org.mozilla.gecko.BrowserApp.onPrepareOptionsMenu(BrowserApp.java) (Android O)
Please help prioritize this
Assignee: nobody → cnevinchen
tracking-fennec: ? → +
Flags: needinfo?(wehuang)
Flags: needinfo?(jcheng)
Already fixed on Fennec 57(MozillaOnline build).
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Unless the fix is something horrible, shouldn't it be ported to the main codebase as well?
(In reply to Jan Henning [:JanH] from comment #4)
> Unless the fix is something horrible, shouldn't it be ported to the main
> codebase as well?

It's an issue that can only be reproduced in MozillaOnline build, so the fix should not be ported to the main codebase.
Truly sorry for all the misunderstanding and inconvenience I caused.
Flags: needinfo?(wehuang)
Flags: needinfo?(jcheng)
Target Milestone: --- → Firefox 57
Whiteboard: [FNC][SPT59.1][INT]
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.