Open Bug 1582243 Opened 7 months ago Updated 4 months ago

Assertion failure: [GFX1]: RGBX corner pixel at (0,0) in 1x1 surface, bounded by (0,0,1,1) is not opaque: 0,0,0,0, at src/gfx/2d/Logging.h:740

Categories

(Core :: Graphics, defect, P3)

defect

Tracking

()

Tracking Status
firefox71 --- affected

People

(Reporter: tsmith, Assigned: aosmond)

References

(Blocks 1 open bug)

Details

(Keywords: assertion, testcase)

Attachments

(1 file)

Attached file testcase.html

Reduced with m-c:
BuildID=20190918105434
SourceStamp=a3a081ae714f1123bdc23c9d9ef53dfaa783a8de

Assertion failure: [GFX1]: RGBX corner pixel at (0,0) in 1x1 surface, bounded by (0,0,1,1) is not opaque: 0,0,0,0, at src/gfx/2d/Logging.h:740

#0 mozilla::gfx::Log<1, mozilla::gfx::CriticalLogger>::WriteLog(std::string const&) src/gfx/2d/Logging.h:741:9
#1 mozilla::gfx::Log<1, mozilla::gfx::CriticalLogger>::Flush() src/gfx/2d/Logging.h:279:7
#2 mozilla::gfx::Log<1, mozilla::gfx::CriticalLogger>::~Log() src/gfx/2d/Logging.h:272:12
#3 mozilla::gfx::VerifyRGBXCorners(unsigned char*, mozilla::gfx::IntSizeTyped<mozilla::gfx::UnknownUnits> const&, int, mozilla::gfx::SurfaceFormat, mozilla::gfx::RectTyped<mozilla::gfx::UnknownUnits, float> const*, mozilla::gfx::BaseMatrix<float> const*) src/gfx/2d/DrawTargetSkia.cpp:205:7
#4 mozilla::gfx::GetSkImageForSurface(mozilla::gfx::SourceSurface*, mozilla::gfx::RectTyped<mozilla::gfx::UnknownUnits, float> const*, mozilla::gfx::BaseMatrix<float> const*) src/gfx/2d/DrawTargetSkia.cpp:261:3
#5 mozilla::gfx::SetPaintPattern(SkPaint&, mozilla::gfx::Pattern const&, float, SkMatrix const*, mozilla::gfx::RectTyped<mozilla::gfx::UnknownUnits, float> const*) src/gfx/2d/DrawTargetSkia.cpp:502:11
#6 mozilla::gfx::DrawTargetSkia::FillRect(mozilla::gfx::RectTyped<mozilla::gfx::UnknownUnits, float> const&, mozilla::gfx::Pattern const&, mozilla::gfx::DrawOptions const&) src/gfx/2d/DrawTargetSkia.cpp:763:18
#7 mozilla::gfx::DrawTargetCaptureImpl::ReplayToDrawTarget(mozilla::gfx::DrawTarget*, mozilla::gfx::BaseMatrix<float> const&) src/gfx/2d/DrawTargetCapture.cpp:330:10
#8 mozilla::gfx::DrawTarget::DrawCapturedDT(mozilla::gfx::DrawTargetCapture*, mozilla::gfx::BaseMatrix<float> const&) src/gfx/2d/DrawTarget.cpp:168:9
#9 mozilla::layers::PaintThread::AsyncPaintTask(mozilla::layers::CompositorBridgeChild*, mozilla::layers::PaintTask*) src/gfx/layers/PaintThread.cpp:228:13
#10 mozilla::detail::RunnableFunction<mozilla::layers::PaintThread::QueuePaintTask(mozilla::UniquePtr<mozilla::layers::PaintTask, mozilla::DefaultDelete<mozilla::layers::PaintTask> >&&)::$_7>::Run() src/obj-firefox/dist/include/nsThreadUtils.h:564:5
#11 nsThread::ProcessNextEvent(bool, bool*) src/xpcom/threads/nsThread.cpp:1225:14
#12 NS_ProcessNextEvent(nsIThread*, bool) src/xpcom/threads/nsThreadUtils.cpp:486:10
#13 mozilla::ipc::MessagePumpForNonMainThreads::Run(base::MessagePump::Delegate*) src/ipc/glue/MessagePump.cpp:333:5
#14 MessageLoop::RunInternal() src/ipc/chromium/src/base/message_loop.cc:315:10
#15 MessageLoop::Run() src/ipc/chromium/src/base/message_loop.cc:290:3
#16 nsThread::ThreadFunc(void*) src/xpcom/threads/nsThread.cpp:458:11
#17 _pt_root src/nsprpub/pr/src/pthreads/ptthread.c:198:5
#18 start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x76b9)
Flags: in-testsuite?
Summary: RGBX corner pixel at → Assertion failure: [GFX1]: RGBX corner pixel at (0,0) in 1x1 surface, bounded by (0,0,1,1) is not opaque: 0,0,0,0, at src/gfx/2d/Logging.h:740

Which platform does this crash on? I cannot reproduce on Linux.

Lee, any ideas?

Priority: -- → P3

(In reply to Jamie Nicol [:jnicol] from comment #1)

Which platform does this crash on? I cannot reproduce on Linux.

I am able to reproduce with the attached testcase on both Windows 10 and Linux (Ubuntu 16.04 x86_64).
I used a m-c debug build:
BuildID=20190923160444
SourceStamp=e3a4bd8e4991ca6d26115faf528416e405759946

Traced this a bit, and it seems imagelib is producing an 1x1 BGRX image that doesn't contain an opaque alpha value. Due to the limitations of skia, BGRX format still requires that the alpha values not be transparent, otherwise Skia will still actually process the alphas...

Stack looked something like this with OMTP/e10s off to simplify:
#10 0x00007f1356201a77 in mozilla::gfx::VerifyRGBXCorners(unsigned char*, mozilla::gfx::IntSizeTyped<mozilla::gfx::UnknownUnits> const&, int, mozilla::gfx::SurfaceFormat, mozilla::gfx::RectTyped<mozilla::gfx::UnknownUnits, float> const*, mozilla::gfx::BaseMatrix<float> const*)
(aData=0x7f13462711c0 "", aSize=..., aStride=4, aFormat=mozilla::gfx::SurfaceFormat::B8G8R8X8, aBounds=0x7ffd2986e870, aMatrix=0x7ffd2986e8f4)
at /home/lee/central/gfx/2d/DrawTargetSkia.cpp:205
#11 0x00007f13561fa500 in mozilla::gfx::GetSkImageForSurface(mozilla::gfx::SourceSurface*, mozilla::gfx::RectTyped<mozilla::gfx::UnknownUnits, float> const*, mozilla::gfx::BaseMatrix<float> const*) (aSurface=0x7f133ed07340, aBounds=0x7ffd2986e870, aMatrix=0x7ffd2986e8f4) at /home/lee/central/gfx/2d/DrawTargetSkia.cpp:261
#12 0x00007f13561fda2a in mozilla::gfx::SetPaintPattern(SkPaint&, mozilla::gfx::Pattern const&, float, SkMatrix const*, mozilla::gfx::RectTyped<mozilla::gfx::UnknownUnits, float> const*)
(aPaint=..., aPattern=..., aAlpha=1, aMatrix=0x0, aBounds=0x7ffd2986e870) at /home/lee/central/gfx/2d/DrawTargetSkia.cpp:502
#13 0x00007f1356203ef1 in mozilla::gfx::AutoPaintSetup::AutoPaintSetup(SkCanvas*, mozilla::gfx::DrawOptions const&, mozilla::gfx::Pattern const&, mozilla::gfx::RectTyped<mozilla::gfx::UnknownUnits, float> const*, SkMatrix const*, mozilla::gfx::RectTyped<mozilla::gfx::UnknownUnits, float> const*)
(this=0x7ffd2986e750, aCanvas=0x7f13462aa000, aOptions=..., aPattern=..., aMaskBounds=0x7ffd2986e870, aMatrix=0x0, aSourceBounds=0x7ffd2986e870)
at /home/lee/central/gfx/2d/DrawTargetSkia.cpp:558
#14 0x00007f13561fb66f in mozilla::gfx::DrawTargetSkia::FillRect(mozilla::gfx::RectTyped<mozilla::gfx::UnknownUnits, float> const&, mozilla::gfx::Pattern const&, mozilla::gfx::DrawOptions const&) (this=0x7f133f3cc640, aRect=..., aPattern=..., aOptions=...) at /home/lee/central/gfx/2d/DrawTargetSkia.cpp:763
#15 0x00007f1356833120 in gfxSurfaceDrawable::DrawInternal(mozilla::gfx::DrawTarget*, mozilla::gfx::CompositionOp, mozilla::gfx::AntialiasMode, mozilla::gfx::RectTyped<mozilla::gfx::UnknownUnits, double> const&, mozilla::gfx::IntRectTyped<mozilla::gfx::UnknownUnits> const&, mozilla::gfx::ExtendMode, mozilla::gfx::SamplingFilter, double, mozilla::gfx::BaseMatrix<double> const&)
(this=0x7f1342734520, aDrawTarget=0x7f133f3cc640, aOp=mozilla::gfx::CompositionOp::OP_OVER, aAntialiasMode=mozilla::gfx::AntialiasMode::SUBPIXEL, aFillRect=..., aSamplingRect=..., aExtendMode=mozilla::gfx::ExtendMode::CLAMP, aSamplingFilter=mozilla::gfx::SamplingFilter::GOOD, aOpacity=1, aTransform=...) at /home/lee/central/gfx/thebes/gfxDrawable.cpp:88
#16 0x00007f1356833259 in gfxSurfaceDrawable::Draw(gfxContext*, mozilla::gfx::RectTyped<mozilla::gfx::UnknownUnits, double> const&, mozilla::gfx::ExtendMode, mozilla::gfx::SamplingFilter, double, mozilla::gfx::BaseMatrix<double> const&)
(this=0x7f1342734520, aContext=0x7f133ed83d00, aFillRect=..., aExtendMode=mozilla::gfx::ExtendMode::CLAMP, aSamplingFilter=mozilla::gfx::SamplingFilter::GOOD, aOpacity=1, aTransform=...)
at /home/lee/central/gfx/thebes/gfxDrawable.cpp:64
#17 0x00007f1356906fdc in gfxUtils::DrawPixelSnapped(gfxContext*, gfxDrawable*, mozilla::gfx::SizeTyped<mozilla::gfx::UnknownUnits, double> const&, mozilla::image::ImageRegion const&, mozilla::gfx::SurfaceFormat, mozilla::gfx::SamplingFilter, unsigned int, double, bool)
(aContext=0x7f133ed83d00, aDrawable=0x7f1342734520, aImageSize=..., aRegion=..., aFormat=mozilla::gfx::SurfaceFormat::B8G8R8X8, aSamplingFilter=mozilla::gfx::SamplingFilter::GOOD, aImageFlags=100, aOpacity=1, aUseOptimalFillOp=true) at /home/lee/central/gfx/thebes/gfxUtils.cpp:562
#18 0x00007f1356a33e5a in mozilla::image::imgFrame::Draw(gfxContext*, mozilla::image::ImageRegion const&, mozilla::gfx::SamplingFilter, unsigned int, float)
(this=0x7f13462909b0, aContext=0x7f133ed83d00, aRegion=..., aSamplingFilter=mozilla::gfx::SamplingFilter::GOOD, aImageFlags=100, aOpacity=1) at /home/lee/central/image/imgFrame.cpp:638
#19 0x00007f1356a336e8 in mozilla::image::RasterImage::DrawInternal(mozilla::image::DrawableSurface&&, gfxContext*, mozilla::gfx::IntSizeTyped<mozilla::gfx::UnknownUnits> const&, mozilla::image::ImageRegion const&, mozilla::gfx::SamplingFilter, unsigned int, float)
(this=0x7f13497e0d60, aSurface=..., aContext=0x7f133ed83d00, aSize=..., aRegion=..., aSamplingFilter=mozilla::gfx::SamplingFilter::GOOD, aFlags=100, aOpacity=1)
at /home/lee/central/image/RasterImage.cpp:1380
#20 0x00007f1356a341b5 in mozilla::image::RasterImage::Draw(gfxContext*, mozilla::gfx::IntSizeTyped<mozilla::gfx::UnknownUnits> const&, mozilla::image::ImageRegion const&, unsigned int, mozilla::gfx::SamplingFilter, mozilla::Maybe<mozilla::SVGImageContext> const&, unsigned int, float)
(this=0x7f13497e0d60, aContext=0x7f133ed83d00, aSize=..., aRegion=..., aWhichFrame=1, aSamplingFilter=mozilla::gfx::SamplingFilter::GOOD, aFlags=100, aOpacity=1)
at /home/lee/central/image/RasterImage.cpp:1442

Flags: needinfo?(aosmond)

Looks like an edge case of the GIF decoder. It trusts we are BGRX on the first frame if it says it cover the full size. But I don't think we enforce that.

Assignee: nobody → aosmond

While writing a test case, I found this only happens to the first frame, if we decode multiple frames. If we mark the decoder as us wanting only the first frame (the only frame that can be BGRX) it comes out opaque. The main difference is BlendAnimationFilter is in the decoding pipeline now.

The sub block is empty, so there is no pixel data and BlendAnimationFilter clears the data. Sigh.

Flags: needinfo?(aosmond)
See Also: → 1516761
You need to log in before you can comment on or make changes to this bug.