Closed Bug 681400 Opened 13 years ago Closed 13 years ago

assertion failure in win debug in WebGL test drawingbuffer-static-canvas-test.html

Categories

(Core :: Graphics: CanvasWebGL, defect)

x86_64
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: bjacob, Unassigned)

References

()

Details

Attachments

(1 file, 1 obsolete file)

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);
    }
The value of |result| at this point is	-2005530516 which suggests it's uninitialized.
Ah no, this is 0x8876086C in hex, which means "Unable to create Direct3D device"
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.
0x8876086C is the value of D3DERR_INVALIDCALL
Attachment #555142 - Flags: review?(jmuizelaar)
Filed upstream bug:
http://code.google.com/p/angleproject/issues/detail?id=199
Attachment #555142 - Attachment is obsolete: true
Attachment #555142 - Flags: review?(jmuizelaar)
Attachment #555145 - Flags: review?(jmuizelaar)
Blocks: 679884
Blocks: 679864
Comment on attachment 555145 [details] [diff] [review]
fix invalid assert in ANGLE about resizing surfaces

This has been accepted upstream as ANGLE r739.
Attachment #555145 - Flags: review?(jmuizelaar) → review+
http://hg.mozilla.org/mozilla-central/rev/d1228b8cedc6
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
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?
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
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: