Crash [@ @0x0 strlen | nsICanvasRenderingContextWebGL_CompileShader] [@ strlen | nsICanvasRenderingContextWebGL_CompileShader ]

RESOLVED FIXED

Status

()

--
critical
RESOLVED FIXED
8 years ago
7 years ago

People

(Reporter: katestarbird, Assigned: vlad)

Tracking

Trunk
x86
Windows 7
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(2 attachments, 1 obsolete attachment)

(Reporter)

Description

8 years ago
User-Agent:       Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5; rv:2.0b4pre) Gecko/20100808 Minefield/4.0b4pre
Build Identifier: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5; rv:2.0b4pre) Gecko/20100808 Minefield/4.0b4pre

This webgl o3d development site, which has been functioning pretty well, now crashes every time. All you have to do is navigate there. Though I'm getting lots of crashes with today's build - so this may be a more general issue than o3d webgl.

Reproducible: Always

Steps to Reproduce:
1. http://www.cs.colorado.edu/~starbird/avatar_code/avatar_webgl.html
2.
3.
Actual Results:  
crash

Expected Results:  
functional o3d demo
Repro on Mozilla/5.0 (Windows NT 6.0; WOW64; rv:2.0b4pre) Gecko/20100809

bp-f65872a4-a7e2-4b5d-966c-584082100809
Status: UNCONFIRMED → NEW
Component: General → Canvas: WebGL
Ever confirmed: true
Product: Firefox → Core
QA Contact: general → canvas.webgl
Version: unspecified → Trunk

Comment 2

8 years ago
I've been crashing whenever I load a page using WebGL, here's one stack.

bp-585b45ab-2524-4f52-b291-48d0e2100808
No crash on linux x86-64 / nvidia driver / mozilla-central from today
Strange, the back-trace looks a lot like bug 579191 which was fixed 2 weeks ago.
ok, this crash is on ANGLE-using code, so I guess the reason why I'm not getting it is that ANGLE is not enabled on linux x86-64. See bug 578877.

if anyone wants to help debug this: at WebGLContextGL.cpp:2867, please print the value of |ShGetInfoLog(compiler)|. I would guess that it returns a null pointer for some reason...

Updated

8 years ago
Duplicate of this bug: 585613

Comment 7

8 years ago
Created attachment 464099 [details] [diff] [review]
Patch v1

The retval from ShGetInfoLog needs to be checked since nsDependentCString does not accept NULL buffers - we end up calling strlen(NULL).

ShGetInfoLog appears to be failing because the process hasn't been initialized...
Assignee: nobody → wesongathedeveloper
Status: NEW → ASSIGNED
So, do you confirm it was actually returning NULL?

Next question: if the reason why it's returning NULL is that something earlier hasn't been initialized, perhaps *this* is what should be fixed?
adding Vlad in CC.
Another crash URL

http://www.peternitsch.net/demo/webgl/index.html
OS: Mac OS X → Windows 7
Summary: formerly functional webgl-o3d example crashes → Crash [@ @0x0 strlen | nsICanvasRenderingContextWebGL_CompileShader]

Comment 11

8 years ago
(In reply to comment #8)
> So, do you confirm it was actually returning NULL?
> 

Yes, it was actually returning NULL.

> Next question: if the reason why it's returning NULL is that something earlier
> hasn't been initialized, perhaps *this* is what should be fixed?


The problem here is that http://mxr.mozilla.org/mozilla-central/source/content/canvas/src/WebGLContextValidate.cpp#450 checks the mShaderValidation while it is still false and therefore doesn't call ShInitialize before returning to http://mxr.mozilla.org/mozilla-central/source/content/canvas/src/WebGLContext.cpp#299 which then proceeds to set mShaderValidation to true (from the pref in http://mxr.mozilla.org/mozilla-central/source/content/canvas/src/WebGLContext.cpp#350).

This needs to be fixed, but it's probably better to leave the null check in as well.

Comment 12

8 years ago
Created attachment 464123 [details] [diff] [review]
Patch
Attachment #464099 - Attachment is obsolete: true
Attachment #464123 - Flags: review?(vladimir)
Created attachment 464148 [details] [diff] [review]
fix

So, we really want validation enabled everywhere, even on mobile (because mobile might accept a more liberal syntax due to extensions).  This simplifies things a bit, and we check the pref in Initialize etc.
Assignee: wesongathedeveloper → vladimir
Attachment #464148 - Flags: review?(bjacob)
Attachment #464148 - Flags: review?(bjacob) → review+
Adding the other stack so it gets picked up in crash stats.
Summary: Crash [@ @0x0 strlen | nsICanvasRenderingContextWebGL_CompileShader] → Crash [@ @0x0 strlen | nsICanvasRenderingContextWebGL_CompileShader] [@ strlen | nsICanvasRenderingContextWebGL_CompileShader ]
http://hg.mozilla.org/mozilla-central/rev/8767a9c9a4bd
Status: ASSIGNED → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → FIXED

Updated

8 years ago
Depends on: 586588

Updated

8 years ago
No longer depends on: 586588

Updated

8 years ago
Blocks: 593106

Updated

8 years ago
No longer blocks: 593106
You need to log in before you can comment on or make changes to this bug.