-
Notifications
You must be signed in to change notification settings - Fork 30k
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
Suspect signed/unsigned bug in the fs module of Node 6 and up on Windows #16496
Comments
Probably need something like #12614 for v6.x since it could be that an incomplete backport was done to v6.x at some point. |
FYI it also happens with https://github.com/erikkemperman/windows-stats-quirk/blob/master/test/quirk.js#L23 All of these fail on Appveyor but pass on Travis. Also, I think it might be possible for something like this to happen for other fields than |
Including: * Move async *stat() functions to FillStatsArray() now used by the sync *stat() functions * Avoid creating fs.Stats instances for implicit async/sync *stat() calls used in various fs functions * Store reference to Float64Array data on C++ side for easier/faster access, instead of passing from JS to C++ on every async/sync *stat() call Backport-PR-URL: nodejs#11665 Fixes: nodejs#16496
The `dev_t` is unsigned on Linux, use Integer::NewFromUnsigned to fix cast overflow Fixes: nodejs#16496
The `dev_t` is unsigned on Linux, use Integer::NewFromUnsigned to fix cast overflow PR-URL: #16705 Fixes: #16496 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Khaidi Chu <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
The `dev_t` is unsigned on Linux, use Integer::NewFromUnsigned to fix cast overflow PR-URL: #16705 Fixes: #16496 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Khaidi Chu <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
link #12419 |
I believe this has been fixed by #16705. |
There seems to be a signed/unsigned bug in the
fs
module of Node 6 and higher on Windows.Specifically, I see different values in
fs.Stats.dev
for the synchronous and asynchronous versionsfs.stat()
andfs.statSync()
(for the same file, obviously).This only happens on Windows (well, technically Appveyor, I am unable to try it locally because I don't have a Windows machine at hand) and only in Node 6 and up.
I've created a minimal repository demonstrating this bug, here.
The assertion that fails on Appveyor Node >= 6 but passes on Node < 6, is here:
https://github.com/erikkemperman/windows-stats-quirk/blob/master/test/quirk.js#L11
As you see in the logs, it got
stat.dev == -726974396
from the async call, but it gotstat.dev == 3567992900
from the sync call!This happens to be what you get if you cast the former, in C, from
int32_t
touint32_t
, so I suspect something like that must be going wrong in Node/LibUV.The older Node versions, up to 5, are fine, and so are all of the versions on Travis.
Thanks for taking the time, hopefully this bug report will be somewhat helpful in improving an already pretty awesome platform!
The text was updated successfully, but these errors were encountered: