[Webkit-unassigned] [Bug 129419] [GTK] Wrong GL context when destroying textures

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Feb 27 23:28:58 PST 2014


https://bugs.webkit.org/show_bug.cgi?id=129419





--- Comment #3 from Iago Toral <itoral at igalia.com>  2014-02-27 23:26:02 PST ---
The risk I see with a different approach to fixing the problem is that we may be taking an error-prone path by having clients be responsible of always binding the right GL context before any GraphicsContext3D GL operation is done. Actually, it kind of feels wrong considering that GraphicsContext3D is already calling makeContextCurrent to take care of this, but I trust your judgment here better than mine :). I agree that the number of abstractions related with the GL context is already important. Doing a run-time decision between EGL and GLX is easy though.

A least one other way to fix this that I tried was to to invalidate the LayerTreeHost instance ASAP in WebPage::close (before FrameLoader::detachFromParent). That works because it will bind and then destroy the GL context before anything else is destroyed. It would be a one line patch, so let me know if you prefer that solution better and I'll provide the patch.

For reference, this is the stack trace leading to the problem:

#0  _mesa_delete_texture_object (ctx=0x2158de8, texObj=0x2c07880) at main/texobj.c:224
#1  0x00007fc01f3a4e74 in intelDeleteTextureObject (ctx=0x2158de8, texObj=0x2c07880) at intel_tex.c:56
#2  0x00007fc01f15cfc7 in _mesa_reference_texobj_ (ptr=0x7fff27a5ffc0, tex=0x0) at main/texobj.c:392
#3  0x00007fc01f15c5d3 in _mesa_reference_texobj (ptr=0x7fff27a5ffc0, tex=0x0) at main/texobj.h:81
#4  0x00007fc01f15e35a in _mesa_DeleteTextures (n=1, textures=0x7fff27a6001c) at main/texobj.c:1193
#5  0x00007fc0905bc09b in glDeleteTextures (n=1, textures=0x7fff27a6001c) at ../../../src/mapi/glapi/glapi_mapi_tmp.h:3810
#6  0x00007fc094da20a6 in WebCore::GraphicsContext3D::deleteTexture(unsigned int) () from /home/itoral/Devel/Gnome/bin/lib64/libwebkit2gtk-3.0.so.25
#7  0x00007fc094a1b604 in WebCore::BitmapTextureGL::~BitmapTextureGL() () from /home/itoral/Devel/Gnome/bin/lib64/libwebkit2gtk-3.0.so.25
#8  0x00007fc094a1b619 in WebCore::BitmapTextureGL::~BitmapTextureGL() () from /home/itoral/Devel/Gnome/bin/lib64/libwebkit2gtk-3.0.so.25
#9  0x00007fc094a3307d in WTF::Vector<WebCore::TextureMapperTile, 0ul, WTF::CrashOnOverflow>::shrink(unsigned long) ()
   from /home/itoral/Devel/Gnome/bin/lib64/libwebkit2gtk-3.0.so.25
#10 0x00007fc094a331a7 in WebCore::TextureMapperTiledBackingStore::~TextureMapperTiledBackingStore() () from /home/itoral/Devel/Gnome/bin/lib64/libwebkit2gtk-3.0.so.25
#11 0x00007fc094a2fce6 in WebCore::TextureMapperLayer::~TextureMapperLayer() () from /home/itoral/Devel/Gnome/bin/lib64/libwebkit2gtk-3.0.so.25
#12 0x00007fc094a2fd79 in WebCore::TextureMapperLayer::~TextureMapperLayer() () from /home/itoral/Devel/Gnome/bin/lib64/libwebkit2gtk-3.0.so.25
#13 0x00007fc094a26431 in WebCore::GraphicsLayerTextureMapper::~GraphicsLayerTextureMapper() () from /home/itoral/Devel/Gnome/bin/lib64/libwebkit2gtk-3.0.so.25
#14 0x00007fc094a26479 in WebCore::GraphicsLayerTextureMapper::~GraphicsLayerTextureMapper() () from /home/itoral/Devel/Gnome/bin/lib64/libwebkit2gtk-3.0.so.25
#15 0x00007fc0948f4751 in WebCore::RenderLayerBacking::destroyGraphicsLayers() () from /home/itoral/Devel/Gnome/bin/lib64/libwebkit2gtk-3.0.so.25
#16 0x00007fc0948f6029 in WebCore::RenderLayerBacking::~RenderLayerBacking() () from /home/itoral/Devel/Gnome/bin/lib64/libwebkit2gtk-3.0.so.25
#17 0x00007fc0948f6159 in WebCore::RenderLayerBacking::~RenderLayerBacking() () from /home/itoral/Devel/Gnome/bin/lib64/libwebkit2gtk-3.0.so.25
#18 0x00007fc0948e7141 in WebCore::RenderLayer::clearBacking(bool) () from /home/itoral/Devel/Gnome/bin/lib64/libwebkit2gtk-3.0.so.25
#19 0x00007fc0948e729a in WebCore::RenderLayer::~RenderLayer() () from /home/itoral/Devel/Gnome/bin/lib64/libwebkit2gtk-3.0.so.25
#20 0x00007fc0948e74f9 in WebCore::RenderLayer::~RenderLayer() () from /home/itoral/Devel/Gnome/bin/lib64/libwebkit2gtk-3.0.so.25
#21 0x00007fc094927ec1 in WebCore::RenderObject::willBeDestroyed() () from /home/itoral/Devel/Gnome/bin/lib64/libwebkit2gtk-3.0.so.25
#22 0x00007fc09492d1ed in WebCore::RenderObject::destroy() () from /home/itoral/Devel/Gnome/bin/lib64/libwebkit2gtk-3.0.so.25
#23 0x00007fc0949dae7e in WebCore::Style::detachRenderTree(WebCore::Element&, WebCore::Style::DetachType) () from /home/itoral/Devel/Gnome/bin/lib64/libwebkit2gtk-3.0.so.25
#24 0x00007fc0949dad9b in WebCore::Style::detachChildren(WebCore::ContainerNode&, WebCore::Style::DetachType) ()
   from /home/itoral/Devel/Gnome/bin/lib64/libwebkit2gtk-3.0.so.25
#25 0x00007fc0949dadfb in WebCore::Style::detachRenderTree(WebCore::Element&, WebCore::Style::DetachType) () from /home/itoral/Devel/Gnome/bin/lib64/libwebkit2gtk-3.0.so.25
#26 0x00007fc0949dad9b in WebCore::Style::detachChildren(WebCore::ContainerNode&, WebCore::Style::DetachType) ()
   from /home/itoral/Devel/Gnome/bin/lib64/libwebkit2gtk-3.0.so.25
#27 0x00007fc0949dadfb in WebCore::Style::detachRenderTree(WebCore::Element&, WebCore::Style::DetachType) () from /home/itoral/Devel/Gnome/bin/lib64/libwebkit2gtk-3.0.so.25
#28 0x00007fc0949dad9b in WebCore::Style::detachChildren(WebCore::ContainerNode&, WebCore::Style::DetachType) ()
   from /home/itoral/Devel/Gnome/bin/lib64/libwebkit2gtk-3.0.so.25
#29 0x00007fc0949dadfb in WebCore::Style::detachRenderTree(WebCore::Element&, WebCore::Style::DetachType) () from /home/itoral/Devel/Gnome/bin/lib64/libwebkit2gtk-3.0.so.25
#30 0x00007fc0949dad9b in WebCore::Style::detachChildren(WebCore::ContainerNode&, WebCore::Style::DetachType) ()
   from /home/itoral/Devel/Gnome/bin/lib64/libwebkit2gtk-3.0.so.25
#31 0x00007fc0949dadfb in WebCore::Style::detachRenderTree(WebCore::Element&, WebCore::Style::DetachType) () from /home/itoral/Devel/Gnome/bin/lib64/libwebkit2gtk-3.0.so.25
#32 0x00007fc0949dad9b in WebCore::Style::detachChildren(WebCore::ContainerNode&, WebCore::Style::DetachType) ()
   from /home/itoral/Devel/Gnome/bin/lib64/libwebkit2gtk-3.0.so.25
#33 0x00007fc0949dadfb in WebCore::Style::detachRenderTree(WebCore::Element&, WebCore::Style::DetachType) () from /home/itoral/Devel/Gnome/bin/lib64/libwebkit2gtk-3.0.so.25
#34 0x00007fc0949dad9b in WebCore::Style::detachChildren(WebCore::ContainerNode&, WebCore::Style::DetachType) ()
   from /home/itoral/Devel/Gnome/bin/lib64/libwebkit2gtk-3.0.so.25
#35 0x00007fc0949dadfb in WebCore::Style::detachRenderTree(WebCore::Element&, WebCore::Style::DetachType) () from /home/itoral/Devel/Gnome/bin/lib64/libwebkit2gtk-3.0.so.25
#36 0x00007fc0943f52d7 in WebCore::Document::destroyRenderTree() () from /home/itoral/Devel/Gnome/bin/lib64/libwebkit2gtk-3.0.so.25
#37 0x00007fc0944000c5 in WebCore::Document::prepareForDestruction() () from /home/itoral/Devel/Gnome/bin/lib64/libwebkit2gtk-3.0.so.25
#38 0x00007fc0947bedc8 in WebCore::Frame::setView(WTF::PassRefPtr<WebCore::FrameView>) () from /home/itoral/Devel/Gnome/bin/lib64/libwebkit2gtk-3.0.so.25
#39 0x00007fc0947297d3 in WebCore::FrameLoader::detachFromParent() () from /home/itoral/Devel/Gnome/bin/lib64/libwebkit2gtk-3.0.so.25
#40 0x00007fc0941e6df5 in WebKit::WebPage::close() () from /home/itoral/Devel/Gnome/bin/lib64/libwebkit2gtk-3.0.so.25
#41 0x00007fc094210b54 in WebKit::WebPage::didReceiveWebPageMessage(CoreIPC::Connection*, CoreIPC::MessageDecoder&) ()
   from /home/itoral/Devel/Gnome/bin/lib64/libwebkit2gtk-3.0.so.25
#42 0x00007fc0952fec7b in CoreIPC::MessageReceiverMap::dispatchMessage(CoreIPC::Connection*, CoreIPC::MessageDecoder&) ()
   from /home/itoral/Devel/Gnome/bin/lib64/libwebkit2gtk-3.0.so.25
#43 0x00007fc0941f1e16 in WebKit::WebProcess::didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageDecoder&) ()
   from /home/itoral/Devel/Gnome/bin/lib64/libwebkit2gtk-3.0.so.25
#44 0x00007fc0952f8e2b in CoreIPC::Connection::dispatchMessage(std::unique_ptr<CoreIPC::MessageDecoder, std::default_delete<CoreIPC::MessageDecoder> >) ()
   from /home/itoral/Devel/Gnome/bin/lib64/libwebkit2gtk-3.0.so.25
#45 0x00007fc0952f8f73 in CoreIPC::Connection::dispatchOneMessage() () from /home/itoral/Devel/Gnome/bin/lib64/libwebkit2gtk-3.0.so.25
#46 0x00007fc0935076d8 in WTF::RunLoop::performWork() () from /home/itoral/Devel/Gnome/bin/lib64/libjavascriptcoregtk-3.0.so.0
#47 0x00007fc093514459 in WTF::RunLoop::queueWork(WTF::RunLoop*) () from /home/itoral/Devel/Gnome/bin/lib64/libjavascriptcoregtk-3.0.so.0
#48 0x00007fc090153d7b in g_idle_dispatch (source=0x7fc03c0022e0, callback=0x7fc093514450 <WTF::RunLoop::queueWork(WTF::RunLoop*)>, user_data=0x7fc087352d90) at gmain.c:5280
#49 0x00007fc0901514e0 in g_main_dispatch (context=0xcf7ac0) at gmain.c:3066
#50 0x00007fc09015220e in g_main_context_dispatch (context=0xcf7ac0) at gmain.c:3641
#51 0x00007fc0901523fe in g_main_context_iterate (context=0xcf7ac0, block=1, dispatch=1, self=0xce1920) at gmain.c:3712
#52 0x00007fc09015282e in g_main_loop_run (loop=0xd14590) at gmain.c:3906
#53 0x00007fc094176b2d in WebProcessMainGtk () from /home/itoral/Devel/Gnome/bin/lib64/libwebkit2gtk-3.0.so.25
#54 0x00007fc093874de5 in __libc_start_main (main=0x400750 <main>, argc=2, ubp_av=0x7fff27a60a18, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, 
    stack_end=0x7fff27a60a08) at libc-start.c:260
#55 0x000000000040077e in _start ()

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list