-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
fs: throw more synchronous errors in JS land #19041
Conversation
size_t len; | ||
int64_t pos; | ||
const int argc = args.Length(); | ||
CHECK_GE(argc, 4); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
5
Landed in 7cadb57...f7e5b38 with @targos 's comment addressed. Thanks! |
PR-URL: #19041 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #19041 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #19041 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #19041 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #19041 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #19041 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #19041 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This PR landed with a full red Windows CI and has broken master. Should we revert or is it something simple to fix? |
@joaocgreis The windows CI seems to be broken by this
Not sure how it is related to this PR... |
@joyeecheung e.g., https://ci.nodejs.org/job/node-test-binary-windows/15333/COMPILED_BY=vs2017,RUNNER=win10,RUN_SUBSET=0/console Building addons
C:\Windows\SYSTEM32\cmd.exe[3240]: src\node_file.cc:1286: Assertion `(argc) == (7)' failed.
1: node::DecodeWrite
2: node::DecodeWrite
3: v8::internal::ParseInfo::character_stream
4: v8::internal::wasm::NativeModuleDeserializer::DeserializeFullBuffer
5: v8::internal::LocalEmbedderHeapTracer::RequiresImmediateWrapperProcessing
6: v8::internal::LocalEmbedderHeapTracer::RequiresImmediateWrapperProcessing
7: v8::internal::LocalEmbedderHeapTracer::RequiresImmediateWrapperProcessing
8: 000003FE44E04201 |
@richardlau Ah, so the I think I have found the culprit..fix coming up. |
The binding writeBuffer has been changed in nodejs#19041 and it now requires the last argument to be a context object. makeSyncWrite was not updated accordingly, resulting assertions on Windows. This patch fixes the usage of writeBuffer there.
Fix in #19103 |
The binding writeBuffer has been changed in #19041 and it now requires the last argument to be a context object. makeSyncWrite was not updated accordingly, resulting assertions on Windows. This patch fixes the usage of writeBuffer there. Also fix errors.uvException() so error.message are no longer enumerable, this fixes the deepStrictEqual assertion on the error object in test-stdout-close-catch. PR-URL: #19103 Refs: #19041 Reviewed-By: Anna Henningsen <anna@addaleax.net>
SYNC_REQ has been removed. See nodejs/node#18297 nodejs/node#19041
SYNC_REQ has been removed. See nodejs/node#18297 nodejs/node#19041
PR-URL: nodejs#19041 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: nodejs#19041 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: nodejs#19041 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: nodejs#19041 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: nodejs#19041 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: nodejs#19041 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: nodejs#19041 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
The binding writeBuffer has been changed in nodejs#19041 and it now requires the last argument to be a context object. makeSyncWrite was not updated accordingly, resulting assertions on Windows. This patch fixes the usage of writeBuffer there. Also fix errors.uvException() so error.message are no longer enumerable, this fixes the deepStrictEqual assertion on the error object in test-stdout-close-catch. PR-URL: nodejs#19103 Refs: nodejs#19041 Reviewed-By: Anna Henningsen <anna@addaleax.net>
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
fs
After this PR, all synchronous errors in node_file.cc are migrated into JS land, and they all have error tests in
test-fs-error-messages.js
(the asynchronous errors are tested as well).The only synchronous errors left in
fs
is being fixed in #17851