grpc-node: Failure in environments without IPv6 support
Problem description
Tried to implement GRPC on a project using FreeBSD 11.2 and it throw a core dump, then decided to try the demo project from the grpc repository, core dump, updated the packages to the latest versions, core dump… It compiles with node-gyp without errors apparently. The same steps on Linux works.
Reproduction steps
git clone https://github.com/grpc/grpc cd grpc/examples/node npm install cd dynamic_codegen node greeter_server.js
Environment
- OS name, version and architecture: FreeBSD 11.2-RELEASE-p4
- Node version: v8.12.0
- Node installation method: pkg install node8
- If applicable, compiler version: clang 6.0.0
- Package name and version: gRPC@1.17.0-pre1
Additional context
user@server:/home/user/grpc/examples/node/static_codegen % node greeter_server.js
Segmentation fault (core dumped)
ls -la
-rw------- 1 user user 64303104 Nov 29 22:22 node.core
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 7
- Comments: 27 (13 by maintainers)
Right, I know what’s going on here. We’re supposed to be creating dual stack sockets first, and then fallback on IPv4 only if this failed. But since we’re not checking the result, we never realize that the dual stack socket creation failed.
This is a genuine bug.
I wouldn’t expect a fix in the near future. The
grpc
package is going to be deprecated in April 2021, so I suggest switching to@grpc/grpc-js
, which will be actively developed going forward.It’s actually simple to reproduce under plain Linux: