Closed Bug 726393 Opened 12 years ago Closed 12 years ago

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

Categories

(Firefox for Android Graveyard :: Keyboards and IME, defect, P1)

12 Branch
ARM
Android
defect

Tracking

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

VERIFIED FIXED
Firefox 14
Tracking Status
firefox13 --- fixed
firefox14 --- fixed
blocking-fennec1.0 --- -

People

(Reporter: nhirata, Assigned: cpeterson)

References

Details

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

Crash Data

Attachments

(1 file)

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: --- → ?
Priority: -- → P1
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: nobody → cpeterson
Fetch Android's cached TextKeyListener on key down/up events to avoid nulls.
Attachment #605195 - Flags: review?(blassey.bugs)
Attachment #605195 - Flags: feedback?(gbrown)
Status: NEW → ASSIGNED
Attachment #605195 - Flags: review?(blassey.bugs) → review+
Attachment #605195 - Flags: feedback?(gbrown) → feedback+
Component: General → IME
QA Contact: general → ime
Keywords: checkin-needed
Depends on: 731034
Blocks: 731034
No longer depends on: 731034
https://hg.mozilla.org/mozilla-central/rev/30a16e96d2f9
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
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 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+
checkin-needed for mozilla-aurora
Keywords: checkin-needed
I'm setting this as verified/fixed since it wasn't reported for the last 4 weeks.
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: