Differing values of Math.asin(Math.tanh(1)) within buildPar

RESOLVED FIXED in mozilla33

Status

()

Core
JavaScript Engine: JIT
--
critical
RESOLVED FIXED
4 years ago
3 years ago

People

(Reporter: gkw, Assigned: shu)

Tracking

(Blocks: 2 bugs, {regression, testcase})

Trunk
mozilla33
x86_64
Mac OS X
regression, testcase
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [fuzzblocker])

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

4 years ago
var a = Array.buildPar(999, function() {
    return (Math.asin(Math.tanh(1)))
});
var count = 0;
for (let e of a) {
    count++;
    print(count);
    assertEq(e, a[0])
}

$ ./js-opt-32-dm-ts-darwin-349a2f003529 --fuzzing-safe --ion-parallel-compile=off 22168.js

/snip off count values

22168.js:8:4 Error: Assertion failed: got 0.8657694832396585, expected 0.8657694832396586

Sometimes the values of variable a are 0.8657694832396585, sometimes 0.8657694832396586 instead (note the last number).

My configure flags are:

LD=ld CROSS_COMPILE=1 CC="clang -Qunused-arguments -msse2 -mfpmath=sse -arch i386" RANLIB=ranlib CXX="clang++ -Qunused-arguments -msse2 -mfpmath=sse -arch i386" AS=$CC AR=ar STRIP="strip -x -S" HOST_CC="clang -Qunused-arguments -msse2 -mfpmath=sse" HOST_CXX="clang++ -Qunused-arguments -msse2 -mfpmath=sse" sh /Users/skywalker/trees/mozilla-central/js/src/configure --target=i386-apple-darwin9.2.0 --enable-macos-target=10.5 --enable-optimize --disable-debug --enable-profiling --enable-gczeal --enable-debug-symbols --disable-tests --enable-more-deterministic --with-ccache --enable-threadsafe <other NSPR options>

Regression window (cannot be smaller due to build failure):

http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=f6d51fa4f476&tochange=5c9119729bbf

Shu-yu, you worked on buildPar before - do you happen to know what's going on here?

Setting fuzzblocker since this blocks differential testing with Array.buildPar.
Flags: needinfo?(shu)
(Assignee)

Comment 1

4 years ago
Last time something like this happens it was because of racing on the math cache. Maybe that again? I'll take a look tomorrow.
(Assignee)

Comment 2

4 years ago
I can't reproduce this on my Linux machine. Tried 32/64 as well as debug/opt combinations.
Flags: needinfo?(shu)
(Reporter)

Comment 3

4 years ago
(In reply to Shu-yu Guo [:shu] from comment #2)
> I can't reproduce this on my Linux machine. Tried 32/64 as well as debug/opt
> combinations.

How about Mac? I tested this on Mac 10.9.3.
Flags: needinfo?(shu)
(Assignee)

Comment 4

4 years ago
Created attachment 8438286 [details] [diff] [review]
Fix FPU in PJS worker threads.

I just don't know sometimes.
Attachment #8438286 - Flags: review?(jwalden+bmo)
(Assignee)

Updated

4 years ago
Assignee: nobody → shu
Status: NEW → ASSIGNED
(Assignee)

Updated

4 years ago
Flags: needinfo?(shu)
(Assignee)

Comment 5

4 years ago
Created attachment 8438288 [details] [diff] [review]
Fix FPU in PJS worker threads.

Fix comment typo.
Attachment #8438288 - Flags: review?(jwalden+bmo)
(Assignee)

Updated

4 years ago
Attachment #8438286 - Attachment is obsolete: true
Attachment #8438286 - Flags: review?(jwalden+bmo)
Comment on attachment 8438288 [details] [diff] [review]
Fix FPU in PJS worker threads.

Review of attachment 8438288 [details] [diff] [review]:
-----------------------------------------------------------------

Based on my understanding of these things, this looks reasonable, but this isn't a 100% confident review, exactly.
Attachment #8438288 - Flags: review?(jwalden+bmo) → review+

Comment 7

4 years ago
https://hg.mozilla.org/mozilla-central/rev/96ee31651f6a
Status: ASSIGNED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla33
Blocks: 1112616
You need to log in before you can comment on or make changes to this bug.