Closed Bug 1435546 Opened 3 years ago Closed 3 years ago

Drawing to one canvas on a page affects another canvas


(Core :: Canvas: 2D, defect, P1)




Tracking Status
fennec + ---
firefox58 --- affected
firefox59 --- affected
firefox60 --- affected


(Reporter: ori, Assigned: sotaro)



(Whiteboard: [gfx-noted])


(1 file)

Attached file Test-case
Tested with Firefox for Android Beta and Nightly, on Nexus 5X.

The attached test-case has two canvases.
In one is drawn a red box, in the other a green box.
They also have colored borders that match the colors of the drawn boxes.

There are two bugs here:

1) When Firefox "loses focus" (for example when switching to another app, or locking the screen), when it regains focus the two canvases will be empty.

2) I have rigged a redraw of the red canvas when the page is clicked. Such a redraw after step #1 will cause both canvases to be red, as if they're sharing a context.

#1 only seems to happen when the canvases are large. Are they unloaded from memory?
tracking-fennec: --- → ?
OS: Unspecified → Android
Hardware: Unspecified → All
Component: General → Canvas: 2D
Flags: sec-review?
Product: Firefox for Android → Core
I can't reproduce #2 on my phone, but #1 seems like a regression from bug 1379920.
Blocks: 1379920
Keywords: regression
Version: Trunk → 57 Branch
Additionally, when I try to bring Firefox back into the foreground on a debug build, I get the following assertion:
> 02-06 21:08:30.568 7799-7863/org.mozilla.fennec_jan A/MOZ_Assert: Assertion failure: status != 0 (ClientWaitSync generated an error. Has mSync already been destroyed?), at /home/jan/Mozilla/mozilla-central/gfx/layers/opengl/TextureHostOGL.cpp:687

And the thing that triggers this seems to be the heap minimisation we do when going into the background on Android. If I comment out this line (, I can no longer reproduce this on a local build.
Jamie, can you reproduce on any of the phones you have?
Flags: needinfo?(jnicol)
I tested this on another phone, Xiaomi Mi 5, and only #1 happens.
When it tries to draw the red square, it appears in just one canvas.
Moving issue #1 over to bug 1436466 to keep things separate.
No longer blocks: 1379920
Keywords: regression
Version: 57 Branch → unspecified
See Also: → 1436466
Tested on Nexus 5 and Pixel 2 phones. Only #1 happens.
tracking-fennec: ? → +
Assignee: nobody → sotaro.ikeda.g
Blocks: 1379920
Flags: needinfo?(jnicol)
Priority: -- → P1
Whiteboard: [gfx-noted]
With bug 1436466 fixed, I can no longer reproduce this.
Should this bug be closed, or is there a worry of a different way it can be exposed?
This bug could be closed.
Closed: 3 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1436466
You need to log in before you can comment on or make changes to this bug.