New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ufuzz failure #3736
Comments
@kzc most likely a V8 bug − can't reproduce on Node.js 12, the reduced test case always gives me var _calls_ = 10, a = 0, c = 0;
function f0() {
var brake1 = 5;
do {
var brake3 = 5;
do {
for (var brake4 = 5; [ a++ + (a /= (1 ^ -1) % ([ , 0 ].length === 2)) ] && brake4; --brake4) {
var expr13 = a + this;
for (var key13 in expr13) {
c = 1 + c;
}
}
} while (a + (--_calls_ >= 0 && f0()) && --brake3);
} while (--brake1);
}
f0();
console.log(c); |
The original uglified code produces the correct result on all node versions. As you say, has to be a V8 bug. |
Where did this test case come from? Are you sure it's not the fake evaluate xor bug? |
It's from GitHub Actions of my fork, which is an identical copy of this repository. |
So wait, it doesn't give any reduced test case for you when you do |
No test cases produced on latest master with any NodeJS version I tried:
Which makes sense because the initial uglified code above also produces the same result as the original. Do you see a different result? |
$ uglifyjs original.js -c --reduce-test
// Node.js v0.10.48 on win32 x64
// Can't reproduce test failure with minify options provided:
// {
// "compress": true,
// "mangle": false
// } $ uglifyjs original.js -c --reduce-test
// Node.js v0.12.18 on win32 x64
// Can't reproduce test failure with minify options provided:
// {
// "compress": true,
// "mangle": false
// } $ uglifyjs original.js -c --reduce-test
// Node.js v4.9.1 on win32 x64
// Can't reproduce test failure with minify options provided:
// {
// "compress": true,
// "mangle": false
// } $ uglifyjs original.js -c --reduce-test
// Node.js v6.17.1 on win32 x64
// Can't reproduce test failure with minify options provided:
// {
// "compress": true,
// "mangle": false
// } $ uglifyjs original.js -c --reduce-test
// Node.js v8.17.0 on win32 x64
// Can't reproduce test failure with minify options provided:
// {
// "compress": true,
// "mangle": false
// } $ uglifyjs original.js -c --reduce-test
// Node.js v10.19.0 on win32 x64
// reduce test pass 1, iteration 0: 4741 bytes
// reduce test pass 1, iteration 25: 2121 bytes
// reduce test pass 1, iteration 50: 2077 bytes
// reduce test pass 1, iteration 75: 2055 bytes
// reduce test pass 1, iteration 100: 2047 bytes
// reduce test pass 1, iteration 125: 2013 bytes
// reduce test pass 1, iteration 150: 1886 bytes
// reduce test pass 1, iteration 175: 1806 bytes
// reduce test pass 1, iteration 200: 1155 bytes
// reduce test pass 1, iteration 225: 1144 bytes
// reduce test pass 1, iteration 250: 1121 bytes
// reduce test pass 1, iteration 275: 1118 bytes
// reduce test pass 1, iteration 300: 1080 bytes
// reduce test pass 1, iteration 325: 1078 bytes
// reduce test pass 1, iteration 350: 725 bytes
// reduce test pass 1, iteration 375: 616 bytes
// reduce test pass 1, iteration 400: 521 bytes
// reduce test pass 1, iteration 425: 392 bytes
// reduce test pass 1: 364 bytes
// reduce test pass 2: 292 bytes
// reduce test pass 3: 277 bytes
var _calls_ = 10, a = 0, c = 0;
function f0() {
var brake3 = 5;
do {
for (var brake4 = 5; [ a++ + (a /= (1 ^ -1) % ([ , 0 ].length === 2)) ] && brake4; --brake4) {
switch (0) {
default:
var expr13 = a + this;
for (var key13 in expr13) {
var expr14 = (c = 1 + c, [ 0 ] - 0);
}
0;
}
}
} while ({
"-2": --_calls_ >= 0 && f0()
} && --brake3);
}
f0();
console.log(c);
// output: 6472
//
// minify: 6490
//
// options: {
// "compress": true,
// "mangle": false
// } $ uglifyjs original.js -c --reduce-test
// Node.js v12.16.1 on win32 x64
// Can't reproduce test failure with minify options provided:
// {
// "compress": true,
// "mangle": false
// } |
Wow that's messed up 👻 $ node -v
v10.19.0
$ cat reduced.js | node
6490
$ cat reduced.js | node
6478
$ cat reduced.js | node
6484
$ cat reduced.js | node
6490
$ cat reduced.js | node
6484
$ cat reduced.js | node
6478
$ cat reduced.js | node
6490
$ cat reduced.js | node
6490
$ cat reduced.js | node
6490
$ cat reduced.js | node
6484
$ cat reduced.js | node
6478
$ cat reduced.js | node
6484
$ cat reduced.js | node
6490
$ cat reduced.js | node
6490
$ cat reduced.js | node
6490
$ cat reduced.js | node
6487 |
The globals must have changed between node-v10.4.1 and Node.js v10.19.0 - and later versions. |
Interesting - same version of Node 10 produces different results. Some random transient global(s) or perhaps a non-deterministic for-in order for globals? |
But we aren't probing the content of the global object though - that |
Side note - if a given version of NodeJS produces a different result each time, then all bets are off for the reduced test case. It breaks a basic assumption of the reduce test algo. |
Fully explains why it gave difference reduced test cases between Github Actions and locally. |
Good point. Odd. |
Do you see anything odd on Node 10 if you apply the following patch to the reduced test case? var expr13 = a + this;
+ console.error("expr13:", expr13); |
That's how I work out what |
In case of an extraneous space might need |
So the sign is not deterministic? |
That seems to be the issue, yes. |
Just curious why you prefer Node v10.19.0 for ufuzz over v12? Is it faster? |
I assumed letting |
The text was updated successfully, but these errors were encountered: