[i915] crash in sw fallback in fetch_texel_2d_f_argb8888
Submitted by Tomeu Vizoso
Assigned to Ian Romanick
Description
From some stepping with gdb, my guess is that when the i915 driver decides to fallback to software, the texture's Map gets replaced by its Buffer attribute, which is NULL because the texture hasn't been allocated by swrast yet.
The attached patch makes sure that the image buffer for the texture gets allocated, but I don't know if it shouldn't be done more lazily to not waste memory.
$ LD_LIBRARY_PATH=/usr/local/lib/i386-linux-gnu/ DISPLAY=:0 COGL_DRIVER=gles2 gdb --args /usr/lib/webkit-clutter-0/libexec/MxLauncher http://mrdoob.github.com/three.js/examples/webgl_trackballcamera_earth.html GNU gdb (Ubuntu/Linaro 7.4-2012.02-0ubuntu2co1) 7.4-2012.02 Copyright (C) 2012 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i686-linux-gnu". For bug reporting instructions, please see: http://bugs.launchpad.net/gdb-linaro/... Reading symbols from /usr/lib/webkit-clutter-0/libexec/MxLauncher...done.
(gdb) r
Starting program: /usr/lib/webkit-clutter-0/libexec/MxLauncher http://mrdoob.github.com/three.js/examples/webgl_trackballcamera_earth.html
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1".
libEGL warning: failed to create a pipe screen for i915
[New Thread 0xb1bb6b40 (LWP 32719)]
[New Thread 0xb128db40 (LWP 32720)]
[New Thread 0xb08ffb40 (LWP 32721)]
** (MxLauncher:32716): WARNING **: Failed to initialize atk-bridge. [New Thread 0xafeffb40 (LWP 32724)]
(MxLauncher:32716): Mx-WARNING **: Error loading fallback icon theme [New Thread 0xad81db40 (LWP 32725)] [New Thread 0xacc8fb40 (LWP 32726)] [New Thread 0xac2ffb40 (LWP 32727)] [New Thread 0xab8ffb40 (LWP 32728)] [New Thread 0xaaeffb40 (LWP 32729)] [New Thread 0xaa6feb40 (LWP 32730)] ** Message: JS CONSOLE: http://mrdoob.github.com/three.js/examples/webgl_trackballcamera_earth.html(69): THREE.WebGLRenderer ** Message: JS CONSOLE: http://mrdoob.github.com/three.js/examples/webgl_trackballcamera_earth.html(69): THREE.WebGLRenderer: Float textures not supported. [Thread 0xacc8fb40 (LWP 32726) exited]
Program received signal SIGSEGV, Segmentation fault.
0xb289049b in fetch_texel_2d_f_argb8888 (texImage=0x8f08f00, i=0, j=0, k=0, texel=0xbfffd87c)
at ../../../src/mesa/swrast/s_texfetch_tmp.h:430
430 const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1);
(gdb) p *texImage
$1 = {Base = {InternalFormat = 6408, _BaseFormat = 6408, TexFormat = MESA_FORMAT_ARGB8888,
Border = 0, Width = 1, Height = 1, Depth = 1, Width2 = 1, Height2 = 1, Depth2 = 1,
WidthLog2 = 0, HeightLog2 = 0, DepthLog2 = 0, MaxLog2 = 0, TexObject = 0x8f040a8,
Level = 0, Face = 0}, _IsPowerOfTwo = 1 '\001', WidthScale = 1, HeightScale = 1,
DepthScale = 1, RowStride = 16, ImageOffsets = 0x8bfab70, Map = 0x0, Buffer = 0x0,
FetchTexel = 0xb2890471 <fetch_texel_2d_f_argb8888>}
(gdb) set height 0
(gdb) bt
#0 0xb289049b in fetch_texel_2d_f_argb8888 (texImage=0x8f08f00, i=0, j=0, k=0,
texel=0xbfffd87c) at ../../../src/mesa/swrast/s_texfetch_tmp.h:430
#1 0xb2899f0c in sample_2d_nearest (ctx=0x88edb20, samp=0x8f040cc, img=0x8f08f00,
texcoord=0xbfffd88c, rgba=0xbfffd87c) at ../../../src/mesa/swrast/s_texfilter.c:1137
#2 0xb289a8d4 in sample_nearest_2d (ctx=0x88edb20, samp=0x8f040cc, tObj=0x8f040a8, n=1,
texcoords=0xbfffd88c, lambda=0xbfffd778, rgba=0xbfffd87c)
at ../../../src/mesa/swrast/s_texfilter.c:1369
#3 0xb2811427 in vp_fetch_texel (ctx=0x88edb20, texcoord=0xbfffd88c, lambda=0, unit=5,
color=0xbfffd87c) at ../../../src/mesa/tnl/t_vb_program.c:201
#4 0xb283bbb9 in fetch_texel (ctx=0x88edb20, machine=0x8a8efc0, inst=0x8f32d20,
texcoord=0xbfffd88c, lodBias=0, color=0xbfffd87c)
at ../../../src/mesa/program/prog_execute.c:408
#5 0xb283fad4 in _mesa_execute_program (ctx=0x88edb20, program=0x8f48350, machine=0x8a8efc0)
at ../../../src/mesa/program/prog_execute.c:1662
#6 0xb2811ae0 in run_vp (ctx=0x88edb20, stage=0x893aac8)
at ../../../src/mesa/tnl/t_vb_program.c:394
#7 0xb280df65 in _tnl_run_pipeline (ctx=0x88edb20) at ../../../src/mesa/tnl/t_pipeline.c:163
#8 0xb2b0607a in intelRunPipeline (ctx=0x88edb20) at intel_tris.c:1086
#9 0xb280f3b3 in _tnl_draw_prims (ctx=0x88edb20, arrays=0xbfffe4f8, prim=0xbfffe634,
nr_prims=1, ib=0xbfffe57c, min_index=0, max_index=2998)
at ../../../src/mesa/tnl/t_draw.c:524
#10 0xb280f145 in _tnl_vbo_draw_prims (ctx=0x88edb20, prim=0xbfffe634, nr_prims=1,
ib=0xbfffe57c, index_bounds_valid=1 '\001', min_index=0, max_index=2998,
tfb_vertcount=0x0) at ../../../src/mesa/tnl/t_draw.c:424
#11 0xb27f6ebe in flush (copy=0xbfffdd1c) at ../../../src/mesa/vbo/vbo_split_copy.c:197
#12 0xb27f71f7 in end (copy=0xbfffdd1c, end_flag=0 '\000')
at ../../../src/mesa/vbo/vbo_split_copy.c:319
#13 0xb27f7573 in replay_elts (copy=0xbfffdd1c) at ../../../src/mesa/vbo/vbo_split_copy.c:410
#14 0xb27f7de0 in vbo_split_copy (ctx=0x88edb20, arrays=0x8928a48, prim=0xbfffeb60,
nr_prims=1, ib=0xbfffeb78, draw=0xb280f0b8 <_tnl_vbo_draw_prims>, limits=0xbfffe9d8)
at ../../../src/mesa/vbo/vbo_split_copy.c:633
#15 0xb27f6ab4 in vbo_split_prims (ctx=0x88edb20, arrays=0x8928a48, prim=0xbfffeb60,
nr_prims=1, ib=0xbfffeb78, min_index=0, max_index=19799,
draw=0xb280f0b8 <_tnl_vbo_draw_prims>, limits=0xbfffe9d8)
at ../../../src/mesa/vbo/vbo_split.c:137
#16 0xb280f29f in _tnl_draw_prims (ctx=0x88edb20, arrays=0x8928a48, prim=0xbfffeb60,
nr_prims=1, ib=0xbfffeb78, min_index=0, max_index=19799)
at ../../../src/mesa/tnl/t_draw.c:485
#17 0xb280f145 in _tnl_vbo_draw_prims (ctx=0x88edb20, prim=0xbfffeb60, nr_prims=1,
ib=0xbfffeb78, index_bounds_valid=0 '\000', min_index=0, max_index=19799,
tfb_vertcount=0x0) at ../../../src/mesa/tnl/t_draw.c:424
#18 0xb27f20bf in vbo_handle_primitive_restart (ctx=0x88edb20, prim=0xbfffeb60, nr_prims=1,
ib=0xbfffeb78, index_bounds_valid=0 '\000', min_index=4294967295, max_index=4294967295)
at ../../../src/mesa/vbo/vbo_exec_array.c:570
#19 0xb27f2594 in vbo_validated_drawrangeelements (ctx=0x88edb20, mode=4,
index_bounds_valid=0 '\000', start=4294967295, end=4294967295, count=29400, type=5123,
indices=0x0, basevertex=0, numInstances=1, baseInstance=0)
at ../../../src/mesa/vbo/vbo_exec_array.c:867
#20 0xb27f2863 in vbo_exec_DrawElements (mode=4, count=29400, type=5123, indices=0x0)
at ../../../src/mesa/vbo/vbo_exec_array.c:997
#21 0xb578305b in ?? () from /usr/lib/i386-linux-gnu/libcogl.so.11
#22 0xb5921ea6 in glDrawElements () from /usr/lib/i386-linux-gnu/libcogl-gles2.so.11
#23 0xb729a00f in WebCore::GraphicsContext3D::drawElements(unsigned int, int, unsigned int, long) () from /usr/lib/libwebkit_clutter-0.so.0
#24 0xb72843bd in WebCore::WebGLRenderingContext::drawElements(unsigned int, int, unsigned int, long long, int&) () from /usr/lib/libwebkit_clutter-0.so.0
#25 0xb758062e in WebCore::jsWebGLRenderingContextPrototypeFunctionDrawElements(JSC::ExecState*) () from /usr/lib/libwebkit_clutter-0.so.0
#26 0xa66f538f in ?? ()
#27 0xb78e74eb in JSC::Interpreter::executeCall(JSC::ExecState*, JSC::JSObject*, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) ()
from /usr/lib/libwebkit_clutter-0.so.0
#28 0xb79d9c02 in JSC::call(JSC::ExecState*, JSC::JSValue, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) () from /usr/lib/libwebkit_clutter-0.so.0
#29 0xb67c7205 in WebCore::JSEventListener::handleEvent(WebCore::ScriptExecutionContext*, WebCore::Event*) () from /usr/lib/libwebkit_clutter-0.so.0
#30 0xb699fded in WebCore::EventTarget::fireEventListeners(WebCore::Event*, WebCore::EventTargetData*, WTF::Vector<WebCore::RegisteredEventListener, 1u>&) ()
from /usr/lib/libwebkit_clutter-0.so.0
#31 0xb699ff40 in WebCore::EventTarget::fireEventListeners(WebCore::Event*) ()
from /usr/lib/libwebkit_clutter-0.so.0
#32 0xb6d3b7dd in WebCore::DOMWindow::dispatchEvent(WTF::PassRefPtr<WebCore::Event>, WTF::PassRefPtr<WebCore::EventTarget>) () from /usr/lib/libwebkit_clutter-0.so.0
#33 0xb6d3b9a6 in WebCore::DOMWindow::dispatchLoadEvent() ()
from /usr/lib/libwebkit_clutter-0.so.0
#34 0xb69608ae in WebCore::Document::dispatchWindowLoadEvent() ()
from /usr/lib/libwebkit_clutter-0.so.0
#35 0xb6964e23 in WebCore::Document::implicitClose() ()
from /usr/lib/libwebkit_clutter-0.so.0
#36 0xb6cb4344 in WebCore::FrameLoader::checkCallImplicitClose() ()
from /usr/lib/libwebkit_clutter-0.so.0
#37 0xb6cb91ed in WebCore::FrameLoader::checkCompleted() ()
from /usr/lib/libwebkit_clutter-0.so.0
#38 0xb6cb93ac in WebCore::FrameLoader::finishedParsing() ()
from /usr/lib/libwebkit_clutter-0.so.0
#39 0xb695ee8a in WebCore::Document::finishedParsing() ()
from /usr/lib/libwebkit_clutter-0.so.0
#40 0xb6b7fa96 in WebCore::HTMLTreeBuilder::finished() ()
from /usr/lib/libwebkit_clutter-0.so.0
#41 0xb6b60f81 in WebCore::HTMLDocumentParser::end() ()
from /usr/lib/libwebkit_clutter-0.so.0
#42 0xb6b60fd8 in WebCore::HTMLDocumentParser::attemptToRunDeferredScriptsAndEnd() ()
from /usr/lib/libwebkit_clutter-0.so.0
#43 0xb6b61075 in WebCore::HTMLDocumentParser::prepareToStopParsing() ()
from /usr/lib/libwebkit_clutter-0.so.0
#44 0xb6b614c5 in WebCore::HTMLDocumentParser::endIfDelayed() ()
from /usr/lib/libwebkit_clutter-0.so.0
#45 0xb6b6150a in WebCore::HTMLDocumentParser::resumeParsingAfterYield() ()
from /usr/lib/libwebkit_clutter-0.so.0
#46 0xb6b6e235 in WebCore::HTMLParserScheduler::continueNextChunkTimerFired(WebCore::Timer<WebCore::HTMLParserScheduler>*) () from /usr/lib/libwebkit_clutter-0.so.0
#47 0xb6b6e4c5 in ?? () from /usr/lib/libwebkit_clutter-0.so.0
#48 0xb6e71d7a in WebCore::ThreadTimers::sharedTimerFiredInternal() ()
from /usr/lib/libwebkit_clutter-0.so.0
#49 0xb6e71df5 in WebCore::ThreadTimers::sharedTimerFired() ()
from /usr/lib/libwebkit_clutter-0.so.0
#50 0xb665e05b in ?? () from /usr/lib/libwebkit_clutter-0.so.0
#51 0xb5bdaf6f in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0
#52 0xb5bda276 in g_main_context_dispatch () from /lib/i386-linux-gnu/libglib-2.0.so.0
#53 0xb5bda615 in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0
#54 0xb5bdaa5b in g_main_loop_run () from /lib/i386-linux-gnu/libglib-2.0.so.0
#55 0xb5e071f5 in clutter_main () from /usr/lib/i386-linux-gnu/libclutter-1.0.so.0
#56 0xb5efa18c in mx_application_run () from /usr/lib/libmx-1.0.so.2
#57 0x0804ad1e in main (argc=2, argv=0xbffff624) at ../Tools/ClutterLauncher/mxmain.c:623
Version: git