Last Comment Bug 726393 - crash [@ java.lang.NullPointerException: at org.mozilla.gecko.GeckoInputConnection.processKeyDown(GeckoInputConnection.java) ]
: crash [@ java.lang.NullPointerException: at org.mozilla.gecko.GeckoInputConne...
Status: VERIFIED FIXED
[native-crash]
: crash
Product: Firefox for Android
Classification: Client Software
Component: Keyboards and IME (show other bugs)
: 12 Branch
: ARM Android
: P1 critical (vote)
: Firefox 14
Assigned To: Chris Peterson [:cpeterson]
:
Mentors:
Depends on:
Blocks: 731034
  Show dependency treegraph
 
Reported: 2012-02-11 20:17 PST by Naoki Hirata :nhirata (please use needinfo instead of cc)
Modified: 2012-06-06 00:53 PDT (History)
9 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
fixed
fixed
-


Attachments
bug-726393-null-keylistener.patch (4.62 KB, patch)
2012-03-12 16:04 PDT, Chris Peterson [:cpeterson]
blassey.bugs: review+
gbrown: feedback+
akeybl: approval‑mozilla‑aurora+
Details | Diff | Splinter Review

Description Naoki Hirata :nhirata (please use needinfo instead of cc) 2012-02-11 20:17:04 PST
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)
Comment 1 Naoki Hirata :nhirata (please use needinfo instead of cc) 2012-02-27 12:33:40 PST
Java crash; nom-ing for blocking fennec
Comment 2 Kevin Brosnan [:kbrosnan] 2012-03-04 13:51:42 PST
Not a top crash, not blocking. Still good to fix though.
Comment 3 Geoff Brown [:gbrown] 2012-03-09 16:30:15 PST
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?
Comment 4 Chris Peterson [:cpeterson] 2012-03-12 16:04:01 PDT
Created attachment 605195 [details] [diff] [review]
bug-726393-null-keylistener.patch

Fetch Android's cached TextKeyListener on key down/up events to avoid nulls.
Comment 5 Ryan VanderMeulen [:RyanVM] 2012-03-14 15:04:55 PDT
https://hg.mozilla.org/integration/mozilla-inbound/rev/30a16e96d2f9
Comment 6 Marco Bonardo [::mak] 2012-03-15 08:19:21 PDT
https://hg.mozilla.org/mozilla-central/rev/30a16e96d2f9
Comment 7 Chris Peterson [:cpeterson] 2012-03-19 12:17:48 PDT
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
Comment 8 Alex Keybl [:akeybl] 2012-03-20 13:04:26 PDT
Comment on attachment 605195 [details] [diff] [review]
bug-726393-null-keylistener.patch

[Triage Comment]
Mobile only - approved for Aurora 13.
Comment 9 Chris Peterson [:cpeterson] 2012-03-20 14:19:20 PDT
checkin-needed for mozilla-aurora
Comment 10 Mark Finkle (:mfinkle) (use needinfo?) 2012-03-24 09:17:30 PDT
https://hg.mozilla.org/releases/mozilla-aurora/rev/31feb157bc0b
Comment 11 Paul Feher 2012-06-06 00:53:39 PDT
I'm setting this as verified/fixed since it wasn't reported for the last 4 weeks.

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