Closed Bug 1406230 Opened 4 years ago Closed 3 years ago

Linux: GPU Process crash @ missing FinishObjectAPPLE

Categories

(Core :: Graphics: WebRender, defect, P3)

x86_64
Linux
defect

Tracking

()

RESOLVED FIXED
Tracking Status
firefox-esr52 --- unaffected
firefox57 --- unaffected
firefox58 --- unaffected
firefox59 --- unaffected
firefox60 --- disabled
firefox61 --- disabled

People

(Reporter: jan, Assigned: stransky)

References

(Blocks 1 open bug)

Details

(Keywords: nightly-community, Whiteboard: [wr-reserve])

Crash Data

Attachments

(1 file)

Nightly 58 x64 20171005100211 de_DE @ Debian Testing (KDE / Radeon RX480).
layers.gpu-process.enabled;true
layers.gpu-process.force-enabled;true
layers.acceleration.force-enabled;true
( gfx.webrender.enabled;true )

Other remote webext panels (at their regular position on the right top, like uBlock Origin) are working fine.

I would like to use remote webextensions just for testing with webrender etc.

As I only get this gpu process crash signature when remote webextensions are enabled, I think crash signature and this text belong together.

Example addon: https://addons.mozilla.org/firefox/addon/ipvfoo-pmarks/
Summary: Panels of Remote Webextensions inside locationbar are empty on Linux, Crash in [@ gfxPlatform::Init | mozilla::widget::WindowSurfaceX11::GetVisualFormat ] → Panels of remote webextension icons inside locationbar are empty on Linux, Crash in [@ gfxPlatform::Init | mozilla::widget::WindowSurfaceX11::GetVisualFormat ]
Linux x64 debug try build from bug 1406008 comment 18:
> [GPU 18711, Compositor] WARNING: [GLX] XGetWindowAttributes() failed: file /builds/worker/workspace/build/src/gfx/gl/GLContextProviderGLX.cpp, line 932
> [GPU 18711, Compositor] WARNING: Failed to create CompositorOGL context: file /builds/worker/workspace/build/src/gfx/layers/opengl/CompositorOGL.cpp, line 148
> Crash Annotation GraphicsCriticalError: |[G0][GFX1-]: [OPENGL] Failed to init compositor with reason: FEATURE_FAILURE_OPENGL_CREATE_CONTEXT (t=14.019) |[G1][GFX1-]: [OPENGL] Failed to init compositor with reason: FEATURE_FAILURE_OPENGL_CREATE_CONTEXT (t=59.3221) [GFX1-]: [OPENGL] Failed to init compositor with reason: FEATURE_FAILURE_OPENGL_CREATE_CONTEXT
Summary: Panels of remote webextension icons inside locationbar are empty on Linux, Crash in [@ gfxPlatform::Init | mozilla::widget::WindowSurfaceX11::GetVisualFormat ] → Panels of remote webextension icons inside locationbar are invisible on Linux, Crash in [@ gfxPlatform::Init | mozilla::widget::WindowSurfaceX11::GetVisualFormat ]
Component: Graphics → Graphics: WebRender
Priority: -- → P3
Priority: P3 → P2
Whiteboard: [wr-mvp]
Summary: Panels of remote webextension icons inside locationbar are invisible on Linux, Crash in [@ gfxPlatform::Init | mozilla::widget::WindowSurfaceX11::GetVisualFormat ] → Linux: GPU Process (for Webrender stability): Panels of remote webextension icons inside locationbar are invisible, Crash in [@ gfxPlatform::Init | mozilla::widget::WindowSurfaceX11::GetVisualFormat ]
GPU Process + OOP Webextensions prevent WebRender from functioning at all:

This is what I get after enabling OOP Webextensions and restarting Nightly, when those "Panels of remote webextension icons inside locationbar are invisible" afterwards:

about:support
> Error	Compositors might be mixed (5,2)
> GP+[GFX1-]: Failed GL context creation for WebRender: 0
> GP+[GFX1-]: [OPENGL] Failed to init compositor with reason: FEATURE_FAILURE_OPENGL_CREATE_CONTEXT
> GP+[GFX1-]: [OPENGL] Failed to init compositor with reason: FEATURE_FAILURE_OPENGL_CREATE_CONTEXT

This can be fixed by just disabling the GPU Process, but this would very bad for WebRender stability (bug 1402067/regressions for example) as "full browser crashes" would be too often then.

---
GPU Process + OOP Webextensions + without Webrender
behaves the same and would only show this on about:support:
> (#0) 	GP+[GFX1-]: [OPENGL] Failed to init compositor with reason: FEATURE_FAILURE_OPENGL_CREATE_CONTEXT
> (#1) 	GP+[GFX1-]: [OPENGL] Failed to init compositor with reason: FEATURE_FAILURE_OPENGL_CREATE_CONTEXT
See Also: → 1357487
Duplicate of this bug: 1401634
Priority: P2 → P3
Whiteboard: [wr-mvp] → [wr-reserve]
See Also: → 1430694
Crash Signature: [@ gfxPlatform::Init | mozilla::widget::WindowSurfaceX11::GetVisualFormat ] → [@ gfxPlatform::Init | mozilla::widget::WindowSurfaceX11::GetVisualFormat ]
See Also: → 1446059
Crash Signature: [@ gfxPlatform::Init | mozilla::widget::WindowSurfaceX11::GetVisualFormat ] → [@ gfxPlatform::Init | mozilla::widget::WindowSurfaceX11::GetVisualFormat ] [@ libX11.so.6.3.0@0x431db ] [@ libX11.so.6.3.0@0x39c49 ]
Behavior has changed a bit over time:
I haven't seen [@ gfxPlatform::Init | mozilla::widget::WindowSurfaceX11::GetVisualFormat ] for a long time.
It still doesn't work, but it doesn't seem to crash with that signature. Altough something is horribly failing in the background.

https://mozilla.github.io/mozregression/install.html

This is a day before bug 1406533, but behavior seems to be the same today:

=== The underlying problem: GPU Process, OOP Webextensions, OpenGL ===

> mozregression --launch 2018-07-23 --pref layers.gpu-process.enabled:true layers.acceleration.force-enabled:true extensions.webextensions.remote:true -a 'https://addons.mozilla.org/en-US/firefox/addon/ipvfoo-pmarks/'
1. Install IPvFoo.
2. Reload the AMO page. On the right side of the locationbar you see an "?" icon. Click on it. Its panel is invisible/broken.
3. Open about:support
> Compositing	OpenGL
> [...]
> Failure Log
> (#0) 	GP+[GFX1-]: [OPENGL] Failed to init compositor with reason: FEATURE_FAILURE_OPENGL_CREATE_CONTEXT


> mozregression --launch 2018-07-23 --pref layers.gpu-process.enabled:true layers.acceleration.force-enabled:true extensions.webextensions.remote:true -a 'https://addons.mozilla.org/en-US/firefox/addon/ublock-origin/'
1. Install uBlock Origin.
2. Click on its icon. The browser was white for a moment.
3. Open about:support
> Compositing	OpenGL
> [...]
> Failure Log
> (#0) 	GP+[GFX1-]: [OPENGL] Failed to init compositor with reason: FEATURE_FAILURE_OPENGL_CREATE_CONTEXT


=== GPU Process, OOP Webextensions, WebRender ===

> mozregression --launch 2018-07-23 --pref layers.gpu-process.enabled:true gfx.webrender.all:true extensions.webextensions.remote:true -a 'https://addons.mozilla.org/en-US/firefox/addon/ipvfoo-pmarks/'
1. Install IPvFoo.
2. Reload the AMO page. On the right side of the locationbar you see an "?" icon. Click on it. Its panel is invisible/broken. The browser was white for a moment.
3. Open about:support
> Compositing	OpenGL
> [...]
> Failure Log
> (#0) Error	Compositors might be mixed (5,2)
> (#1) 	GP+[GFX1-]: Failed GL context creation for WebRender: 0
> (#2) 	GP+[GFX1-]: [OPENGL] Failed to init compositor with reason: FEATURE_FAILURE_OPENGL_CREATE_CONTEXT



> mozregression --launch 2018-07-23 --pref layers.gpu-process.enabled:true gfx.webrender.all:true extensions.webextensions.remote:true -a 'https://addons.mozilla.org/en-US/firefox/addon/ublock-origin/'
1. Install uBlock Origin.
2. Click on its icon. The browser was white for a moment.
3. Open about:support
> Compositing	OpenGL
> [...]
> Failure Log
> (#0) Error	Compositors might be mixed (5,2)
> (#1) 	GP+[GFX1-]: Failed GL context creation for WebRender: 0
> (#2) 	GP+[GFX1-]: [OPENGL] Failed to init compositor with reason: FEATURE_FAILURE_OPENGL_CREATE_CONTEXT
See Also: → 1478454
There's a backtrace I get on Mesa DRI Intel(R) HD Graphics 530 (Skylake GT2):

#4  0x00007fdf2358f070 in <signal handler called> () at /lib64/libc.so.6
#5  0x00007fdf0e024611 in mozilla::gl::GLContext::fFinishObjectAPPLE(unsigned int, int) (this=0x7fdef3c46000, object=5890, name=4) at /home/komat/tmp676-trunk-gtk3/src2/objdir/dist/include/GLContext.h:3311
#6  0x00007fdf0e03361e in mozilla::layers::DirectMapTextureSource::Sync(bool) (this=0x7fdef312d900, aBlocking=true)
    at /home/komat/tmp676-trunk-gtk3/src2/gfx/layers/opengl/TextureHostOGL.cpp:346
#7  0x00007fdf0e1b33b7 in mozilla::layers::BufferTextureHost::ReadUnlock() (this=0x7fdef312b3d0)
    at /home/komat/tmp676-trunk-gtk3/src2/gfx/layers/composite/TextureHost.cpp:903
#8  0x00007fdf0e1b3466 in mozilla::layers::BufferTextureHost::UnbindTextureSource() (this=0x7fdef312b3d0)
    at /home/komat/tmp676-trunk-gtk3/src2/gfx/layers/composite/TextureHost.cpp:936
#9  0x00007fdf0e04174b in mozilla::layers::TextureHost::ReleaseCompositableRef() (this=0x7fdef312b3d0)
    at /home/komat/tmp676-trunk-gtk3/src2/objdir/dist/include/mozilla/layers/TextureHost.h:615
#10 0x00007fdf0e0663e4 in mozilla::layers::CompositableTextureRef<mozilla::layers::TextureHost>::~CompositableTextureRef() (this=0x7fdef40f0408, __in_chrg=<optimized out>)
    at /home/komat/tmp676-trunk-gtk3/src2/objdir/dist/include/mozilla/layers/TextureHost.h:247
#11 0x00007fdf0e1a8f42 in mozilla::layers::TileHost::~TileHost() (this=0x7fdef40f0408, __in_chrg=<optimized out>)
    at /home/komat/tmp676-trunk-gtk3/src2/gfx/layers/composite/TiledContentHost.h:44
#12 0x00007fdf0e1c5d50 in nsTArrayElementTraits<mozilla::layers::TileHost>::Destruct(mozilla::layers::TileHost*) (aE=0x7fdef40f0408) at /home/komat/tmp676-trunk-gtk3/src2/objdir/dist/include/nsTArray.h:544
#13 0x00007fdf0e1c43a4 in nsTArray_Impl<mozilla::layers::TileHost, nsTArrayInfallibleAllocator>::DestructRange(unsigned long, unsigned long) (this=0x7fdf09ffda00, aStart=0, aCount=1)
    at /home/komat/tmp676-trunk-gtk3/src2/objdir/dist/include/nsTArray.h:2150
#14 0x00007fdf0e1c1b01 in nsTArray_Impl<mozilla::layers::TileHost, nsTArrayInfallibleAllocator>::ClearAndRetainStorage() (this=0x7fdf09ffda00) at /home/komat/tmp676-trunk-gtk3/src2/objdir/dist/include/nsTArray.h:1367
#15 0x00007fdf0e1bf1d1 in nsTArray_Impl<mozilla::layers::TileHost, nsTArrayInfallibleAllocator>::~nsTArray_Impl() (this=0x7fdf09ffda00, __in_chrg=<optimized out>) at /home/komat/tmp676-trunk-gtk3/src2/objdir/dist/include/nsTArray.h:924
#16 0x00007fdf0e1b5478 in nsTArray<mozilla::layers::TileHost>::~nsTArray() (this=0x7fdf09ffda00, __in_chrg=<optimized out>)
    at /home/komat/tmp676-trunk-gtk3/src2/objdir/dist/include/nsTArray.h:2399
#17 0x00007fdf0e1b5d68 in mozilla::layers::TextureSourceRecycler::~TextureSourceRecycler() (this=0x7fdf09ffda00, __in_chrg=<optimized out>) at /home/komat/tmp676-trunk-gtk3/src2/gfx/layers/composite/TiledContentHost.cpp:207
#18 0x00007fdf0e1b6726 in mozilla::layers::TiledLayerBufferComposite::UseTiles(mozilla::layers::SurfaceDescriptorTiles const&, mozilla::layers::HostLayerManager*, mozilla::layers::ISurfaceAllocator*) (this=0x7fdef312b508, aTiles=..., aLayerManager=0x7fdef4126940, aAllocator=0x7fdef42fd448) at /home/komat/tmp676-trunk-gtk3/src2/gfx/layers/composite/TiledContentHost.cpp:301
#19 0x00007fdf0e1b5835 in mozilla::layers::TiledContentHost::UseTiledLayerBuffer(mozilla::layers::ISurfaceAllocator*, mozilla::layers::SurfaceDescriptorTiles const&) (this=0x7fdef312b4c0, aAllocator=0x7fdef42fd448, aTiledDescriptor=...)
    at /home/komat/tmp676-trunk-gtk3/src2/gfx/layers/composite/TiledContentHost.cpp:176

GL_APPLE_fence is not present on my extension list so it crashes as it's missing FinishObjectAPPLE routine.
Jan, can you check if the GL_APPLE_fence gl extension is present on your box where you see this crash? (by glxinfo | grep APPLE for instance). Thanks.
Flags: needinfo?(jan)
This seems to be rated to Bug 1265824.
Summary: Linux: GPU Process (for Webrender stability): Panels of remote webextension icons inside locationbar are invisible, Crash in [@ gfxPlatform::Init | mozilla::widget::WindowSurfaceX11::GetVisualFormat ] → Linux: GPU Process crash @ missing FinishObjectAPPLE
Assignee: nobody → stransky
Depends on: 1265824
(In reply to Martin Stránský [:stransky] from comment #10)
> Jan, can you check if the GL_APPLE_fence gl extension is present on your box where you see this crash? (by glxinfo | grep APPLE for instance). Thanks.

Good Morning. "glxinfo | grep APPLE" has no output, while glxinfo itself has a long output.
You can see Nvidia GLX stuff here: attachment 8995221 [details]
Flags: needinfo?(jan)
(In reply to Martin Stránský [:stransky] from comment #12)
> Created attachment 8995458 [details]
> Bug 1406230 - Check for APPLE_fence/APPLE_texture_range/APPLE_client_storage extensions,

This patch might need to be adjusted to the reviewed changes in bug 1478704 comment 5.
See Also: → 1478704
I believe bug 1478704 is separate. I'll have a patch up for this one by end of day. It should be as simple as turning this section:

    return mGLContext->IsExtensionSupported(gl::GLContext::APPLE_client_storage) &&
           mGLContext->IsExtensionSupported(gl::GLContext::APPLE_texture_range);

Into this:

    return mGLContext->IsExtensionSupported(gl::GLContext::APPLE_client_storage) &&
           mGLContext->IsExtensionSupported(gl::GLContext::APPLE_texture_range) &&
           mGLContext->IsExtensionSupported(gl::GLContext::APPLE_fence);

Missing the APPLE_fence requirement was just a silly oversight :( - sorry about that.
Comment on attachment 8995458 [details]
Bug 1406230 - Check for APPLE_fence/APPLE_texture_range/APPLE_client_storage extensions,

https://reviewboard.mozilla.org/r/259900/#review267152

I think we want to check before using DirectMapTextureSource, like Doug suggested in comment 12.
Attachment #8995458 - Flags: review?(matt.woodrow) → review-
Looking a little closer, I think CompositorOGL::CreateDataTextureSourceAround[1] and CompositorOGL::CreateDataTextureSourceAroundYCbCr need to fall back to the equivalent BasicCompositor methods if SupportsTextureDirectMapping() is false, which might be more what we're running into here.

[1] https://searchfox.org/mozilla-central/rev/033d45ca70ff32acf04286244644d19308c359d5/gfx/layers/opengl/CompositorOGL.cpp#1987
Thanks, I'll update the patch.
For completeness:
"glxinfo | grep APPLE" is empty with proprietary Nvidia driver (known problems with and without gpu process),
but with Nouveau/Mesa (no problems since bug 1401634; it seems comment 15 wasn't needed for Nouveau) I get exactly this:
>    GL_APPLE_packed_pixels, GL_ARB_ES2_compatibility, 
>    GL_APPLE_texture_max_level, GL_EXT_base_instance,
(In reply to Jan Andre Ikenmeyer [:darkspirit] from comment #8)
> === The underlying problem: GPU Process, OOP Webextensions, OpenGL ===

> > mozregression --launch 2018-07-23 --pref layers.gpu-process.enabled:true layers.acceleration.force-enabled:true extensions.webextensions.remote:true -a 'https://addons.mozilla.org/en-US/firefox/addon/ublock-origin/'
> 1. Install uBlock Origin.
> 2. Click on its icon. The browser was white for a moment.
> 3. Open about:support
> > Compositing	OpenGL
> > [...]
> > Failure Log
> > (#0) 	GP+[GFX1-]: [OPENGL] Failed to init compositor with reason: FEATURE_FAILURE_OPENGL_CREATE_CONTEXT


Proprietary Nvidia now:

mozregression --launch 20180730221422 --pref layers.gpu-process.enabled:true layers.acceleration.force-enabled:true -a 'https://addons.mozilla.org/en-US/firefox/addon/ublock-origin/'

This is fine and probably also fixed by bug 1401634.
Your crash from comment 9 seems to be a different than the original bug.


> === GPU Process, OOP Webextensions, WebRender ===

> > mozregression --launch 2018-07-23 --pref layers.gpu-process.enabled:true gfx.webrender.all:true extensions.webextensions.remote:true -a 'https://addons.mozilla.org/en-US/firefox/addon/ublock-origin/'
> 1. Install uBlock Origin.
> 2. Click on its icon. The browser was white for a moment.
> 3. Open about:support
> > Compositing	OpenGL
> > [...]
> > Failure Log
> > (#0) Error	Compositors might be mixed (5,2)
> > (#1) 	GP+[GFX1-]: Failed GL context creation for WebRender: 0
> > (#2) 	GP+[GFX1-]: [OPENGL] Failed to init compositor with reason: FEATURE_FAILURE_OPENGL_CREATE_CONTEXT

Proprietary Nvidia now:
mozregression --launch 20180730221422 --pref layers.gpu-process.enabled:true gfx.webrender.all:true -a 'https://addons.mozilla.org/en-US/firefox/addon/ublock-origin/'
> Compositing	OpenGL
> [...]
> Failure Log
> (#0) Error	Compositors might be mixed (5,2)
> (#1) 	GP+[GFX1-]: Failed GL context creation for WebRender: 0

The line "[OPENGL] Failed to init compositor with reason: FEATURE_FAILURE_OPENGL_CREATE_CONTEXT" is gone.
So it looks like only bug 1478454 is left for proprietary Nvidia both with and without gpu process.
(In reply to Jan Andre Ikenmeyer [:darkspirit] from comment #21)
> This is fine and probably also fixed by bug 1401634.
> Your crash from comment 9 seems to be a different than the original bug.

IMHO you're wrong here. From some reason (I'm still investigation it) the latest trunk does not use OGL compositor for WebRender but only a basic one, which apparently does not use DirectMapTextureSource by default (BasicCompositor::CreateDataTextureSourceAround is called here).
Dough, looks like the APPLE_client_storage/APPLE_texture_range checks are enough, no need to add APPLE_fence there as it's just a subset of them (IMHO). 

The issue it that at 428469:7ba07ef0e453 revision the DirectMapTextureSource is used without the CompositorOGL::SupportsTextureDirectMapping() call.

OTOH the latest trunk seems to be "fixed" as it ignores OGL compositor completely and creates only a BasicCompositor in GPU process (CompositorBridgeParent::AllocPLayerTransactionParent() has only BASIC hint). Are you aware of that change?
Flags: needinfo?(dothayer)
bug 1478454 seems to be fixed with patch from bug 1479181 comment 18 as I noted there.

(Proprietary Nvidia)
Now I ran my local build like this:
./mach run --enable-crash-reporter --temp-profile --setpref gfx.webrender.all=true --setpref layers.gpu-process.enabled=true --setpref gfx.webrender.debug.profiler=true --setpref gfx.webrender.debug.compact-profiler=true https://addons.mozilla.org/en-US/firefox/addon/ublock-origin/

uBlock's panel has a black background instead of transparency around it and it uses WR because there's a WR profiler in it. 
The black background is the same as with Nouveau and current m-c. Looking on about:support there is no fallback to OpenGL.
(In reply to Martin Stránský [:stransky] from comment #9)
> There's a backtrace I get on Mesa DRI Intel(R) HD Graphics 530 (Skylake GT2):

Debian Testing, Mesa 18.1.4, Mesa DRI Intel(R) HD Graphics 630 (Kaby Lake GT2) 
(Integrated Graphics of this Desktop computer)

latest m-c:
mozregression --launch af6a7edf0069 --pref layers.gpu-process.force-enabled:true gfx.webrender.all:true gfx.webrender.debug.profiler:true gfx.webrender.debug.compact-profiler:true -a https://addons.mozilla.org/en-US/firefox/addon/ublock-origin/
* black background around OOP webext panels, everything WebRender, no fallback, no failure log on about:support

$ glxinfo | grep APPLE
    GL_APPLE_object_purgeable, GL_ARB_ES2_compatibility, 
    GL_APPLE_object_purgeable, GL_APPLE_packed_pixels, 
    GL_ANGLE_texture_compression_dxt5, GL_APPLE_texture_max_level,
I don't know why but the crash is fixed now.
Status: NEW → RESOLVED
Closed: 3 years ago
Flags: needinfo?(dothayer)
Resolution: --- → FIXED
See Also: → 1549311
You need to log in before you can comment on or make changes to this bug.