镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

fs.closeSync results in an abort in v10.x #38193

Description

@zyscoder

What steps will reproduce the bug?

Setup a node instance,

» node

and run the following javascript code.

fs.closeSync(2147483648)

Then the node instance occurs an abort.
In my practice, v12.x and v14.x would not trigger this abort.

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
> fs.closeSync(2147483648)
/home/zys/Toolchains/node-v10.24.0/node[37421]: ../src/node_file.cc:823:void node::fs::Close(const FunctionCallbackInfo<v8::Value> &): Assertion `args[0]->IsInt32()' failed.
 1: 0x17c3524 node::DumpBacktrace(_IO_FILE*) [/home/zys/Toolchains/node-v10.24.0/node]
 2: 0x1818dbe node::Abort() [/home/zys/Toolchains/node-v10.24.0/node]
 3: 0x1816245  [/home/zys/Toolchains/node-v10.24.0/node]
 4: 0x18a0900 node::fs::Close(v8::FunctionCallbackInfo<v8::Value> const&) [/home/zys/Toolchains/node-v10.24.0/node]
 5: 0x1ec8fe9 v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo*) [/home/zys/Toolchains/node-v10.24.0/node]
 6: 0x1ec67fa  [/home/zys/Toolchains/node-v10.24.0/node]
 7: 0x1ec4538  [/home/zys/Toolchains/node-v10.24.0/node]
 8: 0x7e8f435dbf3d 
[1]    37421 abort (core dumped)  /home/zys/Toolchains/node-v10.24.0/node                                                                                                                                                                                                 

Additional information

Activity

  1. added
    fsIssues and PRs related to file-system APIs and the fs module.
    on Apr 11, 2021
  2. Ayase-252 commented on Apr 11, 2021

    @Ayase-252
    Member

    Fixed in #28984, but it has not been backported to v10.x yet

  3. Ayase-252 commented on Apr 11, 2021

    @Ayase-252
    Member

    Same issue as #37912 under the hood. it needs same solution.

  4. targos commented on Apr 11, 2021

    @targos
    Member

    @zyscoder we appreciate you opening these issues, but they are not going to be fixed for Node.js v10.x. That release line is in Maintenance and can only get critical bug fixes and security patches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    fsIssues and PRs related to file-system APIs and the fs module.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions