Status: Untriaged
Owner: ----
CC: [email protected]
Labels: Type-Bug Priority-Medium HW-IA32 OS-Windows

New issue 4369 by [email protected]: Wrong execution result (around computation involving Math.floor(-0), maybe?)
https://code.google.com/p/v8/issues/detail?id=4369

Version: V8 4.5.103.14 (Chrome 45.0.2454.26 beta-m 32-bits)
OS: Windows7 x64

Version: V8 4.6.62 (Chrome 46.0.2478.0 canary 32-bits)
OS: Windows7 x64

It did not reproduce on 64-bits Chrome on MacOSX and Linux.
I haven't checked 64-bits Windows Chrome yet.

What steps will reproduce the problem?
1. Open the attached HTML file in Chrome.
2. Open JavaScript console. (Ctrl-Shift-J)
3. Reload (F5) several times.

What is the expected output?
The console should show "(3000x) true".

What do you see instead?
Something like "(187x) true" "false" "(2812x) true".



The reproduction code (quoted below) is a smallest reduction I could get from my real JS app. It should always be the case that q.y == -(1-1) == -0 but it sometimes (once per hundreds of runs) keeps being 1.

function f(p) {
  var yy = -(p.y - 1);
var xx = Math.floor(yy) - 2; // This line should be no-op, but needed to reproduce the issue.
  p.y = yy;
}
function test() {
  var y = 1;
  var q = {y: y};
  f(q);
  console.log(q.y != 1);
}
for(var n=0; n!=3000; ++n)
  test();

I tried several variations of the code above, and as far as I tested all the cases I got such wrong values involved computing Math.floor(-0). So it may be something around there, but it's just my wild guess.

+yangguo, according to this issue tracker log you look familiar around Math.floor stuff. Could you help triaging the issue?

Attachments:
        floor.html  325 bytes

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to