Last Comment Bug 681400 - assertion failure in win debug in WebGL test drawingbuffer-static-canvas-test.html
: assertion failure in win debug in WebGL test drawingbuffer-static-canvas-test...
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Canvas: WebGL (show other bugs)
: unspecified
: x86_64 Windows 7
: -- normal (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
Mentors:
https://cvs.khronos.org/svn/repos/reg...
Depends on:
Blocks: 679864 679884 webgl-conformance
  Show dependency treegraph
 
Reported: 2011-08-23 11:08 PDT by Benoit Jacob [:bjacob] (mostly away)
Modified: 2011-08-30 09:04 PDT (History)
1 user (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
fix invalid assert in ANGLE about resizing surfaces (2.77 KB, patch)
2011-08-23 11:23 PDT, Benoit Jacob [:bjacob] (mostly away)
no flags Details | Diff | Splinter Review
fix invalid assert in ANGLE about resizing surfaces (1.86 KB, patch)
2011-08-23 11:28 PDT, Benoit Jacob [:bjacob] (mostly away)
jacob.benoit.1: review+
Details | Diff | Splinter Review

Description Benoit Jacob [:bjacob] (mostly away) 2011-08-23 11:08:16 PDT
I get a ANGLE assertion failure in this test, in Windows debug builds:

https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/sdk/tests/conformance/canvas/drawingbuffer-static-canvas-test.html

Call stack:

 	msvcr100d.dll!_NMSG_WRITE(int rterrnum)  Line 217	C
 	msvcr100d.dll!abort()  Line 61 + 0x7 bytes	C
 	msvcr100d.dll!_wassert(const wchar_t * expr, const wchar_t * filename, unsigned int lineno)  Line 336	C
>	libEGL.dll!egl::Surface::resetSwapChain(int backbufferWidth, int backbufferHeight)  Line 218 + 0x5c bytes	C++
 	libEGL.dll!egl::Surface::resetSwapChain()  Line 136 + 0x16 bytes	C++
 	libEGL.dll!egl::Surface::initialize()  Line 75 + 0x8 bytes	C++
 	libEGL.dll!egl::Display::createOffscreenSurface(void * config, void * shareHandle, const int * attribList)  Line 570 + 0x8 bytes	C++
 	libEGL.dll!eglCreatePbufferSurface(void * dpy, void * config, const int * attrib_list)  Line 365 + 0x12 bytes	C++
 	xul.dll!mozilla::gl::GLContextEGL::CreatePBufferSurfaceTryingPowerOfTwo(void * config, unsigned int bindToTextureFormat, nsIntSize & pbsize)  Line 956 + 0x20 bytes	C++
 	xul.dll!mozilla::gl::GLContextEGL::ResizeOffscreen(const nsIntSize & aNewSize)  Line 1038 + 0x43 bytes	C++
 	xul.dll!mozilla::WebGLContext::SetDimensions(int width, int height)  Line 530 + 0x44 bytes	C++
 	xul.dll!nsHTMLCanvasElement::UpdateContext(nsIPropertyBag * aNewContextOptions)  Line 596 + 0x24 bytes	C++
 	xul.dll!nsHTMLCanvasElement::SetAttr(int aNameSpaceID, nsIAtom * aName, nsIAtom * aPrefix, const nsAString_internal & aValue, int aNotify)  Line 146 + 0xa bytes	C++
 	xul.dll!nsGenericHTMLElement::SetAttr(int aNameSpaceID, nsIAtom * aName, const nsAString_internal & aValue, int aNotify)  Line 177	C++
 	xul.dll!nsGenericHTMLElement::SetUnsignedIntAttr(nsIAtom * aAttr, unsigned int aValue)  Line 2254 + 0x1a bytes	C++
 	xul.dll!nsHTMLCanvasElement::SetWidth(unsigned int aValue)  Line 132 + 0x19 bytes	C++
 	xul.dll!nsIDOMHTMLCanvasElement_SetWidth(JSContext * cx, JSObject * obj, jsid id, int strict, jsval_layout * vp)  Line 22324 + 0x15 bytes	C++
 	mozjs.dll!js::CallJSPropertyOpSetter(JSContext * cx, int (JSContext *, JSObject *, jsid, int, js::Value *)* op, JSObject * obj, jsid id, int strict, js::Value * vp)  Line 344 + 0x17 bytes	C++
 	mozjs.dll!js::Shape::set(JSContext * cx, JSObject * obj, bool strict, js::Value * vp)  Line 303 + 0x56 bytes	C++
 	mozjs.dll!js_SetPropertyHelper(JSContext * cx, JSObject * obj, jsid id, unsigned int defineHow, js::Value * vp, int strict)  Line 5565 + 0x1f bytes	C++
 	mozjs.dll!js::Interpret(JSContext * cx, js::StackFrame * entryFrame, js::InterpMode interpMode)  Line 3822 + 0x35 bytes	C++
 	mozjs.dll!js::RunScript(JSContext * cx, JSScript * script, js::StackFrame * fp)  Line 614 + 0xf bytes	C++
 	mozjs.dll!js::ExecuteKernel(JSContext * cx, JSScript * script, JSObject & scopeChain, const js::Value & thisv, js::ExecuteType type, js::StackFrame * evalInFrame, js::Value * result)  Line 911 + 0x11 bytes	C++
 	mozjs.dll!js::Execute(JSContext * cx, JSScript * script, JSObject & scopeChainArg, js::Value * rval)  Line 947 + 0x1d bytes	C++
 	mozjs.dll!EvaluateUCScriptForPrincipalsCommon(JSContext * cx, JSObject * obj, JSPrincipals * principals, const wchar_t * chars, unsigned int length, const char * filename, unsigned int lineno, jsval_layout * rval, JSVersion compileVersion)  Line 4927 + 0x1e bytes	C++
 	mozjs.dll!JS_EvaluateUCScriptForPrincipalsVersion(JSContext * cx, JSObject * obj, JSPrincipals * principals, const wchar_t * chars, unsigned int length, const char * filename, unsigned int lineno, jsval_layout * rval, JSVersion version)  Line 4943 + 0x2e bytes	C++
 	xul.dll!nsJSContext::EvaluateString(const nsAString_internal & aScript, void * aScopeObject, nsIPrincipal * aPrincipal, const char * aURL, unsigned int aLineNo, unsigned int aVersion, nsAString_internal * aRetValue, int * aIsUndefined)  Line 1451 + 0x4c bytes	C++
 	xul.dll!nsScriptLoader::EvaluateScript(nsScriptLoadRequest * aRequest, const nsString & aScript)  Line 906 + 0x7a bytes	C++
 	xul.dll!nsScriptLoader::ProcessRequest(nsScriptLoadRequest * aRequest)  Line 799 + 0x13 bytes	C++
 	xul.dll!nsScriptLoader::ProcessScriptElement(nsIScriptElement * aElement)  Line 745 + 0x17 bytes	C++
 	xul.dll!nsScriptElement::MaybeProcessScript()  Line 182 + 0x13 bytes	C++
 	xul.dll!nsHTMLScriptElement::MaybeProcessScript()  Line 333 + 0x8 bytes	C++
 	xul.dll!nsHTMLScriptElement::DoneAddingChildren(int aHaveNotified)  Line 260 + 0x11 bytes	C++
 	xul.dll!nsHtml5TreeOpExecutor::RunScript(nsIContent * aScriptElement)  Line 733 + 0x12 bytes	C++
 	xul.dll!nsHtml5TreeOpExecutor::RunFlushLoop()  Line 532	C++
 	xul.dll!nsHtml5ExecutorReflusher::Run()  Line 92	C++
 	xul.dll!nsThread::ProcessNextEvent(int mayWait, int * result)  Line 631 + 0x19 bytes	C++
 	xul.dll!NS_ProcessNextEvent_P(nsIThread * thread, int mayWait)  Line 245 + 0x16 bytes	C++
 	xul.dll!mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate * aDelegate)  Line 110 + 0xe bytes	C++
 	xul.dll!MessageLoop::RunInternal()  Line 209	C++
 	xul.dll!MessageLoop::RunHandler()  Line 202	C++
 	xul.dll!MessageLoop::Run()  Line 176	C++
 	xul.dll!nsBaseAppShell::Run()  Line 191	C++
 	xul.dll!nsAppShell::Run()  Line 261 + 0x9 bytes	C++
 	xul.dll!nsAppStartup::Run()  Line 224 + 0x1c bytes	C++
 	xul.dll!XRE_main(int argc, char * * argv, const nsXREAppData * aAppData)  Line 3545 + 0x25 bytes	C++
 	firefox.exe!do_main(const char * exePath, int argc, char * * argv)  Line 198 + 0x12 bytes	C++
 	firefox.exe!NS_internal_main(int argc, char * * argv)  Line 281 + 0x14 bytes	C++
 	firefox.exe!wmain(int argc, wchar_t * * argv)  Line 107 + 0xd bytes	C++
 	firefox.exe!__tmainCRTStartup()  Line 552 + 0x19 bytes	C
 	firefox.exe!wmainCRTStartup()  Line 371	C
 	kernel32.dll!74f13677() 	
 	[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]	
 	ntdll.dll!77529f02() 	
 	ntdll.dll!77529ed5() 	


The assertion is at gfx/angle/src/libEGL/Surface.cpp line 218:

    if (mWindow)
    {
        result = device->CreateAdditionalSwapChain(&presentParameters, &mSwapChain);
    } else {
        HANDLE *pShareHandle = NULL;
        if (mDisplay->isD3d9ExDevice()) {
            pShareHandle = &mShareHandle;
        }

        result = device->CreateTexture(presentParameters.BackBufferWidth, presentParameters.BackBufferHeight, 1, D3DUSAGE_RENDERTARGET,
                                       presentParameters.BackBufferFormat, D3DPOOL_DEFAULT, &mOffscreenTexture, pShareHandle);
    }

    if (FAILED(result))
    {
        ASSERT(result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY); //<-- failure here

        ERR("Could not create additional swap chains or offscreen surfaces: %08lX", result);
        release();
        return error(EGL_BAD_ALLOC, false);
    }
Comment 1 Benoit Jacob [:bjacob] (mostly away) 2011-08-23 11:09:37 PDT
The value of |result| at this point is	-2005530516 which suggests it's uninitialized.
Comment 2 Benoit Jacob [:bjacob] (mostly away) 2011-08-23 11:12:26 PDT
Ah no, this is 0x8876086C in hex, which means "Unable to create Direct3D device"
Comment 3 Benoit Jacob [:bjacob] (mostly away) 2011-08-23 11:14:25 PDT
This is triggered with backbufferWidth==32768 and backbufferHeight==150 which is a case of too large width without triggering a OOM condition. It seems like the present error code just needs to be added to the assertion i.e. the bug is in the assertion.
Comment 4 Benoit Jacob [:bjacob] (mostly away) 2011-08-23 11:18:07 PDT
0x8876086C is the value of D3DERR_INVALIDCALL
Comment 5 Benoit Jacob [:bjacob] (mostly away) 2011-08-23 11:23:14 PDT
Created attachment 555142 [details] [diff] [review]
fix invalid assert in ANGLE about resizing surfaces
Comment 6 Benoit Jacob [:bjacob] (mostly away) 2011-08-23 11:28:48 PDT
Created attachment 555145 [details] [diff] [review]
fix invalid assert in ANGLE about resizing surfaces

Filed upstream bug:
http://code.google.com/p/angleproject/issues/detail?id=199
Comment 7 Benoit Jacob [:bjacob] (mostly away) 2011-08-24 08:14:42 PDT
Comment on attachment 555145 [details] [diff] [review]
fix invalid assert in ANGLE about resizing surfaces

This has been accepted upstream as ANGLE r739.
Comment 8 Benoit Jacob [:bjacob] (mostly away) 2011-08-24 08:34:01 PDT
http://hg.mozilla.org/mozilla-central/rev/d1228b8cedc6
Comment 9 Ed Morley [:emorley] 2011-08-30 09:00:42 PDT
I think this may have caused a 5% Win7 and 9% WinXP Ts regression:
http://graphs-new.mozilla.org/graph.html#tests=[[16,1,1],[16,1,12]]&sel=1312457804516.0918,1314719913607&displayrange=90&datatype=running

...unless I'm reading something incorrectly?
Comment 10 Ed Morley [:emorley] 2011-08-30 09:04:55 PDT
My apologies, it appears the jemalloc change result was collapsed into this one, please ignore comment 9:
https://groups.google.com/forum/#!topic/mozilla.dev.tree-management/sTgi5j2u0qM

Note You need to log in before you can comment on or make changes to this bug.