Closed Bug 764166 Opened 12 years ago Closed 12 years ago

All of the WebGL constant values on a context turn to 0x100 in debug builds

Categories

(Core :: Graphics: CanvasWebGL, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME
Tracking Status
firefox15 - ---
firefox16 - ---

People

(Reporter: ehsan.akhgari, Unassigned)

References

Details

(Keywords: regression)

Attachments

(1 file, 1 obsolete file)

Attached file Testcase (obsolete) —
Load the attached test case in a debug build (on Linux).  you'll see these values:

JavaScript warning: file:///media/storage/moz/emscripten/tests/out.html, line 6523: WebGL: bindBuffer: target: invalid enum value 0x100
JavaScript warning: file:///media/storage/moz/emscripten/tests/out.html, line 6523: WebGL: bufferData: target: invalid enum value 0x100

The 0x100 value is things like Module.ctx.ARRAY_BUFFER and Module.ctx.ELEMENT_ARRAY_BUFFER.  Module.ctx is a WebGL context.
Blocks: gecko-games
Hmm.  I'm not seeing this on Mac, but that sounds like a pretty weird bindings issue....  or a JS issue.

Is this happening in debug builds only?
Yes, I only saw this on a debug build.  And I only tested it on Linux.  Honestly this is very weird.  It happens for all of the constants that I tested.  I'm worried that this might be a memory corruption of some sort... :(
Can you reproduce this, or did it just happen the one time?
I just reproduced under a fresh build off of the latest mozilla-central.
OK. Is it reproducible reliably, or just happens sort of randomly?
Bisection shows that this is a regression from the patch for bug 748266.  It happens reliably.
Blocks: 748266
Keywords: regression
Attached file Minimized test case
Attachment #632410 - Attachment is obsolete: true
OK, this is clang miscompiling WebGLRenderingContextBinding.cpp.  Specifically, the static initializer for sConstants_specs is miscompiled, and all of the UINT_TO_JSVAL functions are called with a value of 0x100.  My current clang is based on revision 145546.  I'll upgrade my clang to see whether that fixes this problem.
Blocks: clang-macosx
No longer blocks: gecko-games, 748266
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → WORKSFORME
I can confirm that the bug is fixed in clang ToT.
(In reply to Ehsan Akhgari [:ehsan] from comment #9)
> I can confirm that the bug is fixed in clang ToT.

Is it fixed it 158158 or should we upgrade the bots to something newer? (see bug 761421).
(In reply to Rafael Ávila de Espíndola (:espindola) from comment #10)
> (In reply to Ehsan Akhgari [:ehsan] from comment #9)
> > I can confirm that the bug is fixed in clang ToT.
> 
> Is it fixed it 158158 or should we upgrade the bots to something newer? (see
> bug 761421).

This bug is fixed in clang revision 158158, so no need to upgrade the bots to something newer.
[Triage Comment]
Removing tracking due to bug resolved wontfix.
(In reply to Lukas Blakk [:lsblakk] from comment #12)
> [Triage Comment]
> Removing tracking due to bug resolved wontfix.

Saved too fast, I meant 'worksforme'.
You need to log in before you can comment on or make changes to this bug.