Closed Bug 830557 Opened 12 years ago Closed 12 years ago

java.lang.NullPointerException at com.android.internal.view.IInputMethodManager$Stub$Proxy.startInput(IInputMethodManager.java:359) startup crash during test

Categories

(Firefox for Android Graveyard :: General, defect)

ARM
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 21

People

(Reporter: gbrown, Assigned: jchen)

References

Details

Crash Data

Attachments

(1 file)

Bug 722166 has many test startup crashes reported against it. Most of those logs have no stacks reported, or stacks that only show system libs; other logs have Java exceptions which have not been noticed. Comment 1443 contains: philor https://tbpl.mozilla.org/php/getParsedLog.php?id=18718702&tree=Mozilla-Inbound Android Tegra 250 mozilla-inbound opt test robocop on 2013-01-11 08:49:01 slave: tegra-313 and that log shows a Java exception: 01-11 08:58:44.838 E/GeckoAppShell( 2300): >>> REPORTING UNCAUGHT EXCEPTION FROM THREAD 1 ("main") 01-11 08:58:44.838 E/GeckoAppShell( 2300): java.lang.NullPointerException 01-11 08:58:44.838 E/GeckoAppShell( 2300): at com.android.internal.view.IInputMethodManager$Stub$Proxy.startInput(IInputMethodManager.java:359) 01-11 08:58:44.838 E/GeckoAppShell( 2300): at android.view.inputmethod.InputMethodManager.startInputInner(InputMethodManager.java:979) 01-11 08:58:44.838 E/GeckoAppShell( 2300): at android.view.inputmethod.InputMethodManager.checkFocus(InputMethodManager.java:1114) 01-11 08:58:44.838 E/GeckoAppShell( 2300): at android.view.inputmethod.InputMethodManager.onWindowFocus(InputMethodManager.java:1143) 01-11 08:58:44.838 E/GeckoAppShell( 2300): at android.view.ViewRoot.handleMessage(ViewRoot.java:1928) 01-11 08:58:44.838 E/GeckoAppShell( 2300): at android.os.Handler.dispatchMessage(Handler.java:99) 01-11 08:58:44.838 E/GeckoAppShell( 2300): at android.os.Looper.loop(Looper.java:123) 01-11 08:58:44.838 E/GeckoAppShell( 2300): at android.app.ActivityThread.main(ActivityThread.java:4627) 01-11 08:58:44.838 E/GeckoAppShell( 2300): at java.lang.reflect.Method.invokeNative(Native Method) 01-11 08:58:44.838 E/GeckoAppShell( 2300): at java.lang.reflect.Method.invoke(Method.java:521) 01-11 08:58:44.838 E/GeckoAppShell( 2300): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) 01-11 08:58:44.838 E/GeckoAppShell( 2300): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) 01-11 08:58:44.838 E/GeckoAppShell( 2300): at dalvik.system.NativeStart.main(Native Method)
Bug 722166, comments 1437 and 1444 (and perhaps others) show very similar exceptions.
Blocks: 722166
Crash Signature: [@ java.lang.NullPointerException at java.lang.NullPointerExceptioncom.android.internal.view.IInputMethodManager$Stub$Proxy.startInput(IInputMethodManager.java)]
Blocks: 686245
These crashes continue to cause test failures. Recent example: https://bugzilla.mozilla.org/show_bug.cgi?id=722166#c1454
I believe this is an Android bug. According to [1], the line where the exception occurred is > _result = com.android.internal.view.InputBindResult.CREATOR.createFromParcel(_reply); and the only way to have a NullPointerException is if CREATOR is null, but CREATOR is a pre-initialized final field in InputBindResult. So I'm tempted to think it's a bug in Dalvik, unless we start seeing this on Android 4.0 tests. [1] http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/2.2.2_r1/com/android/internal/view/IInputMethodManager.java#359
The tegras are FRF91, or 2.2_r1.1, I believe...not sure if that makes any difference.
Crash Signature: [@ java.lang.NullPointerException at java.lang.NullPointerExceptioncom.android.internal.view.IInputMethodManager$Stub$Proxy.startInput(IInputMethodManager.java)] → [@ java.lang.NullPointerException at com.android.internal.view.IInputMethodManager$Stub$Proxy.startInput(IInputMethodManager.java)]
Summary: java.lang.NullPointerException 01-11 08:5java.lang.NullPointerException at com.android.internal.view.IInputMethodManager$Stub$Proxy.startInput(IInputMethodManager.java:359) startup crash during test → java.lang.NullPointerException at com.android.internal.view.IInputMethodManager$Stub$Proxy.startInput(IInputMethodManager.java:359) startup crash during test
(In reply to Geoff Brown [:gbrown] from comment #5) > The tegras are FRF91, or 2.2_r1.1, I believe...not sure if that makes any > difference. It doesn't.
The mobile platform team brainstormed approaches to resolving this bug. Ideas: - look at IInputMethodManager history to see if this bug was fixed in a future (after 2.2) Android version - use special handling in the uncaught exception handler to continue (likely not possible) or signal tbpl to treat this as an infra problem and automatically restart the failed test - patch / upgrade tegras Also, this independent report was found: http://www.anddev.org/sdk-adt-emulator-problems-f16/strange-error-t53366.html. See also bug 782096.
We weren't able to test this patch on try, so I think we should just land it now and back out later if it doesn't fix the problem. The theory is the class com.android.internal.view.InputBindResult is not being loaded correctly due to a bug in Dalvik. This patch preloads the class manually on start-up to avoid whatever condition that causes the bug. The fix targets Froyo and below only, so it's very low risk, and it otherwise has virtually no impact on start-up perf, etc.
Attachment #709783 - Flags: review?(gbrown)
Comment on attachment 709783 [details] [diff] [review] Fix startup crash by preloading class (v1) Review of attachment 709783 [details] [diff] [review]: ----------------------------------------------------------------- Thanks for looking at this. I really hope it works! nit/suggestion: Remove the "using froyo startup fix" logging and change the other log statements to be more explicit, like "froyo startup fix failed".
Attachment #709783 - Flags: review?(gbrown) → review+
Assignee: nobody → nchen
Status: NEW → ASSIGNED
Flags: in-testsuite-
Hardware: x86 → ARM
Most tbpl test logcats do not include app startup, but the ts results do: 02-04 12:41:24.750 I/GeckoApp( 4736): froyo startup fix: com.android.internal.view.InputBindResult$1@484fdde0 Looks good so far.
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 21
Blocks: 810471
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: