crash [@ java.lang.NullPointerException: at org.mozilla.gecko.GeckoInputConnection.processKeyDown(GeckoInputConnection.java) ]

VERIFIED FIXED in Firefox 13

Status

()

Firefox for Android
Keyboards and IME
P1
critical
VERIFIED FIXED
5 years ago
5 years ago

People

(Reporter: nhirata, Assigned: cpeterson)

Tracking

({crash})

12 Branch
Firefox 14
ARM
Android
crash
Points:
---

Firefox Tracking Flags

(firefox13 fixed, firefox14 fixed, blocking-fennec1.0 -)

Details

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

Attachments

(1 attachment)

Occurs on build : 	20120208042017
on : Product: 'GT-N7000', Manufacturer: 'samsung'

This bug was filed from the Socorro interface and is 
report bp-290df2c8-62a6-4999-a3fb-37c5d2120209 .
============================================================= 
java.lang.NullPointerException
	at org.mozilla.gecko.GeckoInputConnection.processKeyDown(GeckoInputConnection.java:675)
	at org.mozilla.gecko.GeckoInputConnection.onKeyPreIme(GeckoInputConnection.java:629)
	at org.mozilla.gecko.gfx.LayerView.onKeyPreIme(LayerView.java:150)
	at android.view.View.dispatchKeyEventPreIme(View.java:3959)
	at android.view.ViewGroup.dispatchKeyEventPreIme(ViewGroup.java:776)
	at android.view.ViewGroup.dispatchKeyEventPreIme(ViewGroup.java:776)
	at android.view.ViewGroup.dispatchKeyEventPreIme(ViewGroup.java:776)
	at android.view.ViewGroup.dispatchKeyEventPreIme(ViewGroup.java:776)
	at android.view.ViewRoot.deliverKeyEvent(ViewRoot.java:2736)
	at android.view.ViewRoot.handleMessage(ViewRoot.java:2000)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loop(Looper.java:130)
	at org.mozilla.gecko.GeckoApp$32.run(GeckoApp.java:1777)
	at android.os.Handler.handleCallback(Handler.java:587)
	at android.os.Handler.dispatchMessage(Handler.java:92)
	at android.os.Looper.loop(Looper.java:130)
	at android.app.ActivityThread.main(ActivityThread.java:3691)
	at java.lang.reflect.Method.invokeNative(Native Method)
	at java.lang.reflect.Method.invoke(Method.java:507)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:912)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:670)
	at dalvik.system.NativeStart.main(Native Method)
tracking-fennec: --- → ?

Updated

5 years ago
Priority: -- → P1

Updated

5 years ago
tracking-fennec: ? → ---
Java crash; nom-ing for blocking fennec
tracking-fennec: --- → ?
Crash Signature: [@ java.lang.NullPointerException: at org.mozilla.gecko.GeckoInputConnection.processKeyDown(GeckoInputConnection.java)] → [@ java.lang.NullPointerException: at org.mozilla.gecko.GeckoInputConnection.processKeyDown(GeckoInputConnection.java)] [@ java.lang.NullPointerException: at org.mozilla.gecko.GeckoInputConnection.processKeyDown(GeckoInputConnection.java) ]
tracking-fennec: ? → ---
blocking-fennec1.0: --- → ?
Not a top crash, not blocking. Still good to fix though.
blocking-fennec1.0: ? → -
It looks to me like the offending code is:

        if (mIMEState == IME_STATE_DISABLED ||
                keyCode == KeyEvent.KEYCODE_ENTER ||
                keyCode == KeyEvent.KEYCODE_DEL ||
                keyCode == KeyEvent.KEYCODE_TAB ||
                (event.getFlags() & KeyEvent.FLAG_SOFT_KEYBOARD) != 0 ||
                !mKeyListener.onKeyDown(v, mEditable, keyCode, event)) {

suggesting that either event == null or mKeyListener == null.

If event == null, there should have been a NullPointerException at:

    public boolean onKeyPreIme(int keyCode, KeyEvent event) {
        switch (event.getAction()) {
 
Since that didn't happen, I would conclude that mKeyListener == null. 

Normally mKeyListener would be set in onCreateInputConnection. Maybe it is possible for onKeyPreIme to be called before onCreateInputConnection?
(Assignee)

Updated

5 years ago
Assignee: nobody → cpeterson
(Assignee)

Comment 4

5 years ago
Created attachment 605195 [details] [diff] [review]
bug-726393-null-keylistener.patch

Fetch Android's cached TextKeyListener on key down/up events to avoid nulls.
Attachment #605195 - Flags: review?(blassey.bugs)
Attachment #605195 - Flags: feedback?(gbrown)
(Assignee)

Updated

5 years ago
Status: NEW → ASSIGNED
Attachment #605195 - Flags: review?(blassey.bugs) → review+

Updated

5 years ago
Attachment #605195 - Flags: feedback?(gbrown) → feedback+
(Assignee)

Updated

5 years ago
Component: General → IME
QA Contact: general → ime
(Assignee)

Updated

5 years ago
Keywords: checkin-needed
(Assignee)

Updated

5 years ago
Depends on: 731034
(Assignee)

Updated

5 years ago
Blocks: 731034
No longer depends on: 731034
https://hg.mozilla.org/integration/mozilla-inbound/rev/30a16e96d2f9
Keywords: checkin-needed
Target Milestone: --- → Firefox 14
https://hg.mozilla.org/mozilla-central/rev/30a16e96d2f9
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
(Assignee)

Comment 7

5 years ago
Comment on attachment 605195 [details] [diff] [review]
bug-726393-null-keylistener.patch

[Approval Request Comment]
Regression caused by (bug #): N/A
User impact if declined: Keyboard crash
Testing completed (on m-c, etc.): m-c
Risk to taking this patch (and alternatives if risky): Android Java only.
String changes made by this patch: N/A
Attachment #605195 - Flags: approval-mozilla-aurora?

Comment 8

5 years ago
Comment on attachment 605195 [details] [diff] [review]
bug-726393-null-keylistener.patch

[Triage Comment]
Mobile only - approved for Aurora 13.
Attachment #605195 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
(Assignee)

Comment 9

5 years ago
checkin-needed for mozilla-aurora
Keywords: checkin-needed
https://hg.mozilla.org/releases/mozilla-aurora/rev/31feb157bc0b
status-firefox13: --- → fixed
status-firefox14: --- → fixed
Keywords: checkin-needed

Comment 11

5 years ago
I'm setting this as verified/fixed since it wasn't reported for the last 4 weeks.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.