Closed Bug 810764 Opened 7 years ago Closed 7 years ago

java.lang.NullPointerException: at org.mozilla.gecko.gfx.GeckoLayerClient.convertViewPointToLayerPoint(GeckoLayerClient.java)

Categories

(Firefox for Android :: Toolbar, defect, critical)

ARM
Android
defect
Not set
critical

Tracking

()

RESOLVED FIXED
Firefox 19

People

(Reporter: scoobidiver, Assigned: kats)

Details

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

Crash Data

Attachments

(1 file, 1 obsolete file)

There are two crashes from the same user in 19.0a1/20121111, including bp-2e552bf4-b589-4440-a720-4c5372121111.

java.lang.NullPointerException
	at org.mozilla.gecko.gfx.GeckoLayerClient.convertViewPointToLayerPoint(GeckoLayerClient.java:718)
	at org.mozilla.gecko.gfx.LayerView.convertViewPointToLayerPoint(LayerView.java:187)
	at org.mozilla.gecko.GeckoEvent.createNativeGestureEvent(GeckoEvent.java:274)
	at org.mozilla.gecko.ui.PanZoomController.onScaleBegin(PanZoomController.java:827)
	at org.mozilla.gecko.ui.SimpleScaleGestureDetector.sendScaleGesture(SimpleScaleGestureDetector.java:209)
	at org.mozilla.gecko.ui.SimpleScaleGestureDetector.onTouchStart(SimpleScaleGestureDetector.java:90)
	at org.mozilla.gecko.ui.SimpleScaleGestureDetector.onTouchEvent(SimpleScaleGestureDetector.java:64)
	at org.mozilla.gecko.gfx.TouchEventHandler.dispatchEvent(TouchEventHandler.java:262)
	at org.mozilla.gecko.gfx.TouchEventHandler.handleEvent(TouchEventHandler.java:199)
	at org.mozilla.gecko.gfx.LayerView.onTouchEvent(LayerView.java:141)
	at android.view.View.dispatchTouchEvent(View.java:5546)
	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1951)
	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1712)
	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1957)
	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1726)
	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1957)
	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1726)
	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1957)
	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1726)
	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1957)
	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1726)
	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1957)
	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1726)
	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1957)
	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1726)
	at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1938)
	at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1375)
	at android.app.Activity.dispatchTouchEvent(Activity.java:2364)
	at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1886)
	at android.view.View.dispatchPointerEvent(View.java:5726)
	at android.view.ViewRootImpl.deliverPointerEvent(ViewRootImpl.java:2890)
	at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2466)
	at android.view.ViewRootImpl.processInputEvents(ViewRootImpl.java:845)
	at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2475)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loop(Looper.java:137)
	at android.app.ActivityThread.main(ActivityThread.java:4424)
	at java.lang.reflect.Method.invokeNative(Native Method)
	at java.lang.reflect.Method.invoke(Method.java:511)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
	at dalvik.system.NativeStart.main(Native Method)

More reports at:
https://crash-stats.mozilla.com/report/list?signature=java.lang.NullPointerException%3A+at+org.mozilla.gecko.gfx.GeckoLayerClient.convertViewPointToLayerPoint%28GeckoLayerClient.java%29
Crash Signature: [@ java.lang.NullPointerException: at org.mozilla.gecko.gfx.GeckoLayerClient.convertViewPointToLayerPoint(GeckoLayerClient.java)] → [@ java.lang.NullPointerException: at org.mozilla.gecko.gfx.GeckoLayerClient.convertViewPointToLayerPoint(GeckoLayerClient.java) ]
kats, this crash looks like fallout from bug 809199. GeckoLayerClient.convertViewPointToLayerPoint() crashes on a null mGeckoViewport.
Blocks: 809199
Ok, I'll take a look.
Assignee: nobody → bugmail.mozilla
I could be wrong, but I don't think this is a regression from 809199. There's an older crash report with the same signature (modulo some modified line numbers) at https://crash-stats.mozilla.com/report/index/6fcbb5bc-73c9-4114-aa9f-93c5e2121024. I think this was a pre-existing race condition (if the user does a pinch after Gecko:Ready is received but before the first setFirstPaintViewport call occurs). I'll fix it anyway; we should probably be catching the various exceptions that can be thrown in GeckoEvent.createNativeGestureEvent, just like we do in GeckoEvent.addMotionPoint.
Attached patch Catch exceptions (obsolete) — Splinter Review
A more general fix because there's a handful of different paths here that can throw an NPE. In addMotionPoint we just did a general catch, so we should just do the same thing here for consistency.
Attachment #680817 - Flags: review?(sjohnson)
Comment on attachment 680817 [details] [diff] [review]
Catch exceptions

Review of attachment 680817 [details] [diff] [review]:
-----------------------------------------------------------------

::: mobile/android/base/GeckoEvent.java
@@ +273,2 @@
>  
> +            PointF geckoPoint = new PointF(pt.x, pt.y);

I think we should also check if this is null as in the previous patch. So, we should check for the exception, which you've added, but also check to make sure there was no exception, but geckoPoint == null.
Updated as we discussed
Attachment #680817 - Attachment is obsolete: true
Attachment #680817 - Flags: review?(sjohnson)
Attachment #680829 - Flags: review?(sjohnson)
Comment on attachment 680829 [details] [diff] [review]
Catch exceptions (v2)

Sorry, meant to r=jwir3 after I talked with you. :)
Attachment #680829 - Flags: review?(sjohnson) → review+
https://hg.mozilla.org/mozilla-central/rev/26c2e6c1c22e
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 19
You need to log in before you can comment on or make changes to this bug.