Closed Bug 988800 Opened 11 years ago Closed 11 years ago

crash in java.lang.NullPointerException: at org.mozilla.gecko.gfx.ScrollbarLayer.draw(ScrollbarLayer.java)

Categories

(Firefox for Android Graveyard :: Toolbar, defect)

31 Branch
All
Android
defect
Not set
critical

Tracking

(firefox31 verified)

VERIFIED FIXED
Firefox 31
Tracking Status
firefox31 --- verified

People

(Reporter: u421692, Assigned: kats)

References

Details

(Keywords: crash, regression)

Crash Data

Attachments

(1 file)

This bug was filed from the Socorro interface and is report bp-363ddc09-90a5-474a-98a8-21b5c2140326. ============================================================= Environment: Device: Alcatel One Touch 8008D (Android 4.1.2) Build: Nightly 30.0a1 (2014-03-26) Steps to reproduce: Have some apps in the background, have also Nightly 30.0a1 (2014-03-26) in the background From task manager, change through apps; bring FF Nightly from background to front. Actual result: Nightly crashes. Note: It seems that is a new crash, from what I can see in the crash-stats report: https://crash-stats.mozilla.com/report/list?product=FennecAndroid&query_type=contains&range_unit=days&process_type=any&hang_type=any&signature=java.lang.NullPointerException%3A+at+org.mozilla.gecko.gfx.ScrollbarLayer.draw%28ScrollbarLayer.java%29&date=2014-03-27+09%3A00%3A00&range_value=28#tab-reports . There are only two other crashes reported, besides the crashes from the device I've tested on: Scribe5HD. Good build: Nightly 30.0a1 (2014-03-25) Bad build: Nightly 30.0a1 (2014-03-26) pushlog: http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=5c0673441fc8&tochange=140ac04d7454
java.lang.NullPointerException at org.mozilla.gecko.gfx.ScrollbarLayer.draw(ScrollbarLayer.java:203) at org.mozilla.gecko.gfx.LayerRenderer$Frame.drawForeground(LayerRenderer.java:631) at dalvik.system.NativeStart.run(Native Method) at dalvik.system.NativeStart.run(Native Method)
Component: General → Graphics, Panning and Zooming
1395802177 - good 1395804220 - bad http://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=db3cd3239562&tochange=9a1c527eeafc still can't narrow what bug caused this regression
Depends on: 987281
Component: Graphics, Panning and Zooming → General
Assignee: nobody → nchen
Kats, can someone from gfx take a quick look? This is a crash that we were ignoring before, until bug 987281 made exceptions crash if not handled. We can always restore the previous behavior (ignore exceptions), but I want to see if this crash indicates a real bug or not before we do that.
Flags: needinfo?(bugmail.mozilla)
Hm.. so this NPE would happen if the coordBuffer is null in the RenderContext, which should never really be happening. The most likely condition under which this would happen given the STR is that we are invoking the drawForeground on a LayerRenderer that has already been destroyed. That is, we have a stale handle in the JNI code and are using that when compositing.
Flags: needinfo?(bugmail.mozilla)
So yeah I guess this is a bug in the fennec graphics code. We might want to just catch and ignore the exception but I'll take a quick look to see if there's an easy fix.
Assignee: nchen → nobody
Component: General → Graphics, Panning and Zooming
Yeah I think it's probably best to just ignore the exception. I think this is a race condition where the view is destroyed and the java-side objects are killed while we're in the middle of doing a composition on the compositor thread. So the LayerRenderer.destroy() function is called, and then the compositor calls the drawForeground stuff to draw the scrollbars, and the coordBuffer has already been nulled out. In this case just ignoring the exception and failing safely should be fine; the compositor will get paused anyway once the composite finishes and it doesn't matter if it can't draw the scrollbars on that frame. Jim, is there a flag to make the AutoLocalJNIFrame ignore the exception, or do I have to manually stick in a try/catch block somewhere?
I think we wanted to expose the crashes and then address on a case-by-case basis.
Attached patch PatchSplinter Review
Here's a patch to catch the condition and ignore it properly. I was able to compile this but since I couldn't package the build (bug 991017) I wasn't able to test it. Try push at https://tbpl.mozilla.org/?tree=Try&rev=bd046ded6981
Assignee: nobody → bugmail.mozilla
Comment on attachment 8400545 [details] [diff] [review] Patch Review of attachment 8400545 [details] [diff] [review]: ----------------------------------------------------------------- Try is green
Attachment #8400545 - Flags: review?(chrislord.net)
Blocks: 987281
No longer depends on: 987281
Comment on attachment 8400545 [details] [diff] [review] Patch Review of attachment 8400545 [details] [diff] [review]: ----------------------------------------------------------------- LGTM.
Attachment #8400545 - Flags: review?(chrislord.net) → review+
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 31
Verified as fixed on Nightly 31.0a1 (2014-04-07)
Status: RESOLVED → VERIFIED
Target Milestone: Firefox 31 → ---
Target Milestone: --- → Firefox 31
No longer blocks: 991184
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: