Closed Bug 759653 Opened 12 years ago Closed 12 years ago

BasicLayers.cpp ABORTs in DEBUG mode on B2G

Categories

(Core :: Graphics, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla16

People

(Reporter: dhylands, Assigned: cjones)

References

Details

Attachments

(2 files)

All DEBUG builds after the following commit from our mozilla-central git repository:

7fe94a9 Sat May 26 12:38:17 2012 +0800 Kan-Ru Chen Bug 743182 - Use gfxPlatform::OptimalFormatForContent everywhere. r=joedrew

cause the following ABORT to occur in B2G:

###!!! ABORT: Bad! Did we create a buffer twice without painting?: '!mIsNewBuffer', file /home/work/B2G/gecko/gfx/layers/basic/BasicLayers.cpp, line 2531
Blocks: 743182
And oh yeah - the ABORT is only seen when OMTC is enabled.
This abort is a very serious logic error: it means our double-buffering code became discombobulated and probably would have not have synchronized front->back buffers correctly.  If that happens we'll get horrendous rendering artifacts.

Very interested to know how we're getting into this state.
It would be instructive to try re-applying the patch from bug 743182, but with the gfx/layers hunks removed.
I also confirmed that a non-debug build of the same commit fixes bug 744238 (so no artifacts seen when sliding up the lock screen when OMTC is enabled).
Removing gfx/layers/basic/BasicLayers.cpp and gfx/layers/ipc/ShadowLayers.cpp from the patchset, and adding back in the gfxASurface::FormatFromContent function cause the ABORT to not occur (and the lock screen artifact still shows)
That is very very odd.
In the working code case, the image format that ShadowLayerForwarder::AllocBuffer creates is ImageFormatRGB16_565.

In the case that aborts, the image format that ShadowLayerForwarder::AllocBuffer creates is ImageFormatARGB32.

And if I go back to the version of the code that doesn't ABORT and modify OptimalFormatFor to return ImageFormatARGB32 then I also get the ABORT.
And all of this testing was being done on a Samsung Galaxy S II running the ICS variant of gonk.
dhylands, do you have a patch for the ImageFormat problem?
Actually, I think this bug only affects sgs2, so it's not a top priority.  But if you already have a patch we should land it.
Attachment #632115 - Flags: review?(mwu) → review+
https://hg.mozilla.org/mozilla-central/rev/a9479d148ce5
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: