Skip to content
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.promises.readFile" results in an abort #37905

Closed
zyscoder opened this issue Mar 25, 2021 · 1 comment
Closed

"fs.promises.readFile" results in an abort #37905

zyscoder opened this issue Mar 25, 2021 · 1 comment
Labels
duplicate Issues and PRs that are duplicates of other issues or PRs.

Comments

@zyscoder
Copy link

What steps will reproduce the bug?

Setup a node instance,

» node

and run the following javascript code.

fs.promises.readFile("",{encoding:"base64",flag:1000000000000})

Then an abort occurs.

How often does it reproduce? Is there a required condition?

This abort can always be triggered following the steps above.

What is the expected behavior?

If any error occurs, an exception or other similar error-reporting stuff should be thrown. There is no reason to abort the whole node process.

What do you see instead?

» node
Welcome to Node.js v14.15.1.
Type ".help" for more information.
> fs.promises.readFile("",{encoding:"base64",flag:1000000000000})
node[250175]: ../src/node_file.cc:1746:void node::fs::OpenFileHandle(const v8::FunctionCallbackInfo<v8::Value>&): Assertion `args[1]->IsInt32()' failed.
 1: 0xa03530 node::Abort() [node]
 2: 0xa035ae  [node]
 3: 0xa0a27a  [node]
 4: 0xbe369b  [node]
 5: 0xbe4c46  [node]
 6: 0xbe52c6 v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) [node]
 7: 0x13ff259  [node]
[1]    250175 abort (core dumped)  node

Additional information

@aduh95
Copy link
Contributor

aduh95 commented Mar 25, 2021

Duplicate of #37430.
Fixed by #37480, fix will be released with Node.js v16.0.0.

@aduh95 aduh95 closed this as completed Mar 25, 2021
@aduh95 aduh95 added the duplicate Issues and PRs that are duplicates of other issues or PRs. label Mar 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate Issues and PRs that are duplicates of other issues or PRs.
Projects
None yet
Development

No branches or pull requests

2 participants