-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 #5217
Comments
@kzc this one's perplexing. For starters I cannot reproduce any failures locally using the exact same version of Node.js (albeit on Windows − job ran on macOS). |
It's 100% reproducible and 100% strange.
After 30 minutes
I think it's a NodeJS bug that has something to do with the rate input is sent to its parser. |
Interesting − so looks like it's harder to hit this bug on Windows (or my specific set of hardware), but not entirely impossible: > ver
Microsoft Windows [Version 10.0.14393]
> node -v
v17.2.0 > node bin\uglifyjs 5217.js --reduce-test
// Node.js v17.2.0 on win32 x64
// Can't reproduce test failure
// minify options: {
// "compress": false,
// "mangle": false
// } > node bin\uglifyjs 5217.js -c reduce_vars=0,merge_vars=0,collapse_vars=0,unused=0,booleans=0,conditionals=0,join_vars=0 --reduce-test
// Node.js v17.2.0 on win32 x64
// Can't reproduce test failure
// minify options: {
// "compress": {
// "reduce_vars": 0,
// "merge_vars": 0,
// "collapse_vars": 0,
// "unused": 0,
// "booleans": 0,
// "conditionals": 0,
// "join_vars": 0
// },
// "mangle": false
// } So far so "good" − however: > type 5217.js | node
null NaN 6 3 Infinity NaN undefined > type 5217.js | node bin\uglifyjs | node
null NaN 6 3 Infinity NaN undefined
node:internal/process/task_queues:78
callback();
^
TypeError: callback is not a function
at processTicksAndRejections (node:internal/process/task_queues:78:11)
Node.js v17.2.0 |
I tried command line utilities to slow down catting to NodeJS but the code ran correctly. But those utilities were line-based rather than character based. I think the NodeJS and/or V8 parser has a bug near or slightly after the 2048 byte mark. |
Ripping out the new language features, this bug seems to go all the way back to Node.js v10: > node -v
v8.17.0
> node bin\uglifyjs test.js | node
null NaN 6 3 Infinity NaN undefined > node -v
v10.24.1
> node bin\uglifyjs test.js | node
null NaN 6 3 Infinity NaN undefined
RangeError [ERR_INVALID_ASYNC_ID]: Invalid asyncId value: undefined
at validateAsyncId (internal/async_hooks.js:122:16)
at emitBeforeScript (internal/async_hooks.js:344:3)
at process._tickCallback (internal/process/next_tick.js:46:9)
at evalScript (internal/bootstrap/node.js:593:13)
at Socket.<anonymous> (internal/bootstrap/node.js:323:15)
at Socket.emit (events.js:203:15)
at endReadableNT (_stream_readable.js:1145:12)
at process._tickCallback (internal/process/next_tick.js:63:19) > node -v
v12.22.7
> node bin\uglifyjs test.js | node
null NaN 6 3 Infinity NaN undefined
internal/process/task_queues.js:79
callback();
^
TypeError: callback is not a function
at processTicksAndRejections (internal/process/task_queues.js:79:11) > node -v
v14.18.2
> node bin\uglifyjs test.js | node
null NaN 6 3 Infinity NaN undefined
internal/process/task_queues.js:77
callback();
^
TypeError: callback is not a function
at processTicksAndRejections (internal/process/task_queues.js:77:11) > node -v
v16.13.1
> node bin\uglifyjs test.js | node
null NaN 6 3 Infinity NaN undefined
node:internal/process/task_queues:78
callback();
^
TypeError: callback is not a function
at processTicksAndRejections (node:internal/process/task_queues:78:11) > node -v
v17.2.0
> node bin\uglifyjs test.js | node
null NaN 6 3 Infinity NaN undefined
node:internal/process/task_queues:78
callback();
^
TypeError: callback is not a function
at processTicksAndRejections (node:internal/process/task_queues:78:11)
Node.js v17.2.0
|
Another possibility might be the TTY modes when piping one |
This bug is only peripherally related to uglify. Uglify happens to emit output at the exact rate needed to trigger the bug in NodeJS. If tests run on my Mac are any indication, I'm sure if you do the following on Windows, the NodeJS bug will not be triggered:
|
Indeed they seem to work on both Node.js v16 & v17: > node -v
v16.13.1
> type 5217.js | node
null NaN 6 3 Infinity NaN undefined
> type 5217.js | node bin\uglifyjs > 0.js
> type 0.js | node
null NaN 6 3 Infinity NaN undefined
> node 0.js
null NaN 6 3 Infinity NaN undefined > node -v
v17.2.0
> type 5217.js | node
null NaN 6 3 Infinity NaN undefined
> type 5217.js | node bin\uglifyjs > 0.js
> type 0.js | node
null NaN 6 3 Infinity NaN undefined
> node 0.js
null NaN 6 3 Infinity NaN undefined |
The text was updated successfully, but these errors were encountered: