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

RESOLVED WORKSFORME

Status

()

RESOLVED WORKSFORME
7 years ago
6 years ago

People

(Reporter: Ehsan, Unassigned)

Tracking

({regression})

Trunk
x86_64
Linux
regression
Points:
---

Firefox Tracking Flags

(firefox15-, firefox16-)

Details

Attachments

(1 attachment, 1 obsolete attachment)

152 bytes, text/html
Details
(Reporter)

Description

7 years ago
Created attachment 632410 [details]
Testcase

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.
(Reporter)

Updated

7 years ago
Blocks: 710398
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?
(Reporter)

Comment 2

7 years ago
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?
(Reporter)

Comment 4

7 years ago
I just reproduced under a fresh build off of the latest mozilla-central.
OK. Is it reproducible reliably, or just happens sort of randomly?
(Reporter)

Comment 6

7 years ago
Bisection shows that this is a regression from the patch for bug 748266.  It happens reliably.
Blocks: 748266
Keywords: regression
(Reporter)

Updated

7 years ago
tracking-firefox15: --- → +
tracking-firefox16: --- → +
(Reporter)

Comment 7

7 years ago
Created attachment 632776 [details]
Minimized test case
Attachment #632410 - Attachment is obsolete: true
(Reporter)

Comment 8

7 years ago
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: 574346
No longer blocks: 710398, 748266
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → WORKSFORME
(Reporter)

Comment 9

7 years ago
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).
(Reporter)

Comment 11

7 years ago
(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.
tracking-firefox15: + → -
tracking-firefox16: + → -
(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.