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

Node 14 ArrayBuffer changes causes grpc to crash. #1407

Closed
strigona-worksight opened this issue May 6, 2020 · 13 comments
Closed

Node 14 ArrayBuffer changes causes grpc to crash. #1407

strigona-worksight opened this issue May 6, 2020 · 13 comments

Comments

@strigona-worksight
Copy link

Problem description

Node 14 has some breaking changes regarding ArrayBuffers as noted here nodejs/node#30782 and https://nodejs.org/en/blog/release/v14.0.0/

Multiple ArrayBuffers pointing to the same base address are no longer allowed by V8. This may impact native addons.

Reproduction steps

I don't have solid/standalone reproduction steps as of yet, but there is a relevant issue here with the same stacktrace that we received: pulumi/pulumi#4258 (comment)

Environment

  • OS name, version and architecture: Ubuntu 19.10
  • Node version: 14.0.0
  • Node installation method: nvm
  • If applicable, compiler version:
  • Package name and version: gRPC@1.24.2

Additional context

nodejs/node#32463

@murgatroid99
Copy link
Member

Thank you for the information. I will try to fix this; any additional information will help.

I suggest switching to @grpc/grpc-js. We will be concentrating most of our development efforts on that library going forward.

@strigona-worksight
Copy link
Author

Thanks for your reply! We'll look into switching over to the grpc-js.

@strigona-worksight
Copy link
Author

strigona-worksight commented Jun 9, 2020

We had to hold off on switching to grpc-js as the healthcheck is still using the native grpc.

We tried out grpc 1.24.3 with node v14.4.0 and haven't had any issues yet. The release says Node 14 support was added, though I couldn't find any commits tied to that claim. Not sure if this is safe to close or not.

@hugebdu
Copy link
Contributor

hugebdu commented Sep 6, 2020

Same here

#
# Fatal error in , line 0
# Check failed: result.second.
#
#
#
#FailureMessage Object: 0x7ffeefbfe100
 1: 0x100112612 node::NodePlatform::GetStackTracePrinter()::$_3::__invoke() [/Users/daniels/.nvm/versions/node/v14.9.0/bin/node]
 2: 0x10100c7b2 V8_Fatal(char const*, ...) [/Users/daniels/.nvm/versions/node/v14.9.0/bin/node]
 3: 0x1004d37b4 v8::internal::GlobalBackingStoreRegistry::Register(std::__1::shared_ptr<v8::internal::BackingStore>) [/Users/daniels/.nvm/versions/node/v14.9.0/bin/node]
 4: 0x1001f9436 v8::ArrayBuffer::GetBackingStore() [/Users/daniels/.nvm/versions/node/v14.9.0/bin/node]
 5: 0x10006cfa5 node::ArrayBufferViewContents<char, 64ul>::Read(v8::Local<v8::ArrayBufferView>) [/Users/daniels/.nvm/versions/node/v14.9.0/bin/node]
 6: 0x10008684c void node::Buffer::(anonymous namespace)::StringSlice<(node::encoding)1>(v8::FunctionCallbackInfo<v8::Value> const&) [/Users/daniels/.nvm/versions/node/v14.9.0/bin/node]
 7: 0x1002582e8 v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo) [/Users/daniels/.nvm/versions/node/v14.9.0/bin/node]
 8: 0x10025787c v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<false>(v8::internal::Isolate*, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::FunctionTemplateInfo>, v8::internal::Handle<v8::internal::Object>, v8::internal::BuiltinArguments) [/Users/daniels/.nvm/versions/node/v14.9.0/bin/node]
 9: 0x100256fa2 v8::internal::Builtin_Impl_HandleApiCall(v8::internal::BuiltinArguments, v8::internal::Isolate*) [/Users/daniels/.nvm/versions/node/v14.9.0/bin/node]
10: 0x100a780b9 Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit [/Users/daniels/.nvm/versions/node/v14.9.0/bin/node]
11: 0x100a11382 Builtins_InterpreterEntryTrampoline [/Users/daniels/.nvm/versions/node/v14.9.0/bin/node]

Process finished with exit code 132 (interrupted by signal 4: SIGILL)

cannot switch to @grpc/grpc-js due to missing deadlines/cancellations support

:(

@strigona-worksight
Copy link
Author

@hugebdu What version of grpc and node are you using? We haven't had any crashes with the latest versions.

@hugebdu
Copy link
Contributor

hugebdu commented Sep 9, 2020

@strigona-worksight

grpc: 1.24.3
node: 14.9.0

happens only in gRPC server. client is fine.

#
# Fatal error in , line 0
# Check failed: result.second.
#
#
#
#FailureMessage Object: 0x7ffc3bbf0ed0
 1: 0xa6f5f1  [node]
 2: 0x19cb8c4 V8_Fatal(char const*, ...) [node]
 3: 0xe58379 v8::internal::GlobalBackingStoreRegistry::Register(std::shared_ptr<v8::internal::BackingStore>) [node]
 4: 0xba38a8 v8::ArrayBuffer::GetBackingStore() [node]
 5: 0x9dd394  [node]
 6: 0xbe254b  [node]
 7: 0xbe3af6  [node]
 8: 0xbe4176 v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) [node]
 9: 0x13fe0b9  [node]
sh: line 1: 19292 Illegal instruction     (core dumped)

@hugebdu
Copy link
Contributor

hugebdu commented Oct 27, 2020

minimal reproduction code I've managed to distill.
related to grpc.Metadata

https://github.com/hugebdu/node14-grpc-core-crashes

@murgatroid99
Copy link
Member

OK, knowing that the bug triggers from receiving metadata narrowed it down enough. I think the issue is with the use of this function. I think I can publish a patch soon to fix that.

@hugebdu
Copy link
Contributor

hugebdu commented Oct 27, 2020

that would be awesome!
unfortunately we cannot switch to js implementation and obviously want to upgrade to node 14 once LTS.

thanks a lot

@murgatroid99
Copy link
Member

I have published version 1.24.4 with a change to address this bug. Please try that out and tell us if you still have these problems.

@hugebdu
Copy link
Contributor

hugebdu commented Nov 16, 2020

@murgatroid99
works like a charm!
confirmed.

thanks a lot.

@murgatroid99
Copy link
Member

OK, I'm going to consider this fixed and close the issue. If anyone experiences this kind of error with version 1.24.4 or later, please comment and I will reopen the issue.

@bilihuang
Copy link

bilihuang commented Dec 7, 2021

@murgatroid99

Problem description

I ran into the same problem when I used egg.js. grpc error caused the process to exit.

Environment

  • OS name: Linux
  • Node version: 14.2.0
  • Package name and version: gRPC@1.24.11

Reproduction steps

I can’t reproduce the steps because I don’t know how to trigger this bug. The program crashed during normal operation due to grpc error

Additional context

 # Fatal error in , line 0
 # Check failed: result.second.
 #
 #
 #
 #FailureMessage Object: 0x7fffb1174d40
 1: 0xa95a01  [node]
 2: 0x19617d4 V8_Fatal(char const*, ...) [node]
 3: 0xe58149 v8::internal::GlobalBackingStoreRegistry::Register(std::shared_ptr<v8::internal::BackingStore>) [node]
 4: 0xbc5418 v8::ArrayBuffer::GetBackingStore() [node]
 5: 0xa08589 node::Buffer::New(node::Environment*, char*, unsigned long, void (*)(char*, void*), void*) [node]
 6: 0xa089f3 node::Buffer::New(v8::Isolate*, char*, unsigned long, void (*)(char*, void*), void*) [node]
 7: 0x7f90657b98a7  [/data/web/dist/.run/node_modules/grpc/src/node/extension_binary/node-v83-linux-x64-glibc/grpc_node.node]
 8: 0x7f90657bdcec  [/data/web/dist/.run/node_modules/grpc/src/node/extension_binary/node-v83-linux-x64-glibc/grpc_node.node]
 9: 0x7f90657bba8f  [/data/web/dist/.run/node_modules/grpc/src/node/extension_binary/node-v83-linux-x64-glibc/grpc_node.node]
 10: 0x7f90657c6463  [/data/web/dist/.run/node_modules/grpc/src/node/extension_binary/node-v83-linux-x64-glibc/grpc_node.node]
 11: 0x1327c89  [node]
 12: 0x1320e78 uv_run [node]
 13: 0xa6a334 node::NodeMainInstance::Run() [node]
 14: 0x9f9651 node::Start(int, char**) [node]
 15: 0x7f906834ec05 __libc_start_main [/lib64/libc.so.6]
 16: 0x992f0c  [node]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants