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: error when fd = -0 #37122

Closed
RaisinTen opened this issue Jan 29, 2021 · 1 comment · Fixed by #37123
Closed

fs: error when fd = -0 #37122

RaisinTen opened this issue Jan 29, 2021 · 1 comment · Fixed by #37123
Labels
confirmed-bug Issues with confirmed bugs. fs Issues and PRs related to the fs subsystem / file system.

Comments

@RaisinTen
Copy link
Contributor

  • Version: v15.2.0
  • Platform: Ubuntu-18.04
  • Subsystem: fs

What steps will reproduce the bug?

node -p 'fs.fstatSync(-0)'
node[10415]: ../src/node_file.cc:1077:void node::fs::FStat(const v8::FunctionCallbackInfo<v8::Value>&): Assertion `args[0]->IsInt32()' failed.
 1: 0xb0c720 node::Abort() [node]
 2: 0xb0c7a1  [node]
 3: 0xb1944f  [node]
 4: 0xdb938c  [node]
 5: 0xdbb317 v8::internal::Builtin_HandleApiCall(int, unsigned int*, v8::internal::Isolate*) [node]
 6: 0x16e6017  [node]
 7: 0x168b379  [node]
 8: 0x1684cf2  [node]
 9: 0x168b379  [node]
10: 0x168949a  [node]
11: 0x16892bb  [node]
12: 0xece07e  [node]
13: 0xecf072 v8::internal::Execution::Call(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, int, v8::internal::Handle<v8::internal::Object>*) [node]
14: 0xd40619 v8::Script::Run(v8::Local<v8::Context>) [node]
15: 0xafc6d3 node::contextify::ContextifyScript::EvalMachine(node::Environment*, long long, bool, bool, bool, std::shared_ptr<v8::MicrotaskQueue>, v8::FunctionCallbackInfo<v8::Value> const&) [node]
16: 0xafceb1 node::contextify::ContextifyScript::RunInThisContext(v8::FunctionCallbackInfo<v8::Value> const&) [node]
17: 0xdb938c  [node]
18: 0xdbb317 v8::internal::Builtin_HandleApiCall(int, unsigned int*, v8::internal::Isolate*) [node]
19: 0x16e6017  [node]
20: 0x168b379  [node]
21: 0x168b379  [node]
22: 0x168b379  [node]
23: 0x168b379  [node]
24: 0x168b379  [node]
25: 0x168b379  [node]
26: 0x168949a  [node]
27: 0x16892bb  [node]
28: 0xece07e  [node]
29: 0xecf072 v8::internal::Execution::Call(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, int, v8::internal::Handle<v8::internal::Object>*) [node]
30: 0xd504c1 v8::Function::Call(v8::Local<v8::Context>, v8::Local<v8::Value>, int, v8::Local<v8::Value>*) [node]
31: 0xacbcdf node::ExecuteBootstrapper(node::Environment*, char const*, std::vector<v8::Local<v8::String>, std::allocator<v8::Local<v8::String> > >*, std::vector<v8::Local<v8::Value>, std::allocator<v8::Local<v8::Value> > >*) [node]
32: 0xacc007  [node]
33: 0xacd5ef node::StartExecution(node::Environment*, std::function<v8::MaybeLocal<v8::Value> (node::StartExecutionCallbackInfo const&)>) [node]
34: 0xa51397 node::LoadEnvironment(node::Environment*) [node]
35: 0xb5bd4e node::NodeMainInstance::Run(node::EnvSerializeInfo const*) [node]
36: 0xacfec9 node::Start(int, char**) [node]
37: 0xa46c39 main [node]
38: 0xb7a31f21 __libc_start_main [/lib/i386-linux-gnu/libc.so.6]
[1]    10415 abort (core dumped)  node -p 'fs.fstatSync(-0)'

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

Always.

What is the expected behavior?

No error.

RaisinTen added a commit to RaisinTen/node that referenced this issue Jan 29, 2021
@RaisinTen RaisinTen added the fs Issues and PRs related to the fs subsystem / file system. label Jan 29, 2021
@Lxxyx Lxxyx added the confirmed-bug Issues with confirmed bugs. label Jan 29, 2021
@juanarbol
Copy link
Member

Let me work on this.

juanarbol added a commit to juanarbol/node that referenced this issue Jan 29, 2021
RaisinTen added a commit to RaisinTen/node that referenced this issue Feb 5, 2021
@Trott Trott closed this as completed in 6b8b165 Feb 6, 2021
danielleadams pushed a commit that referenced this issue Feb 16, 2021
Fixes: #37122

PR-URL: #37123
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed-bug Issues with confirmed bugs. fs Issues and PRs related to the fs subsystem / file system.
Projects
None yet
3 participants