Hello,
I'm using the C++ API to write an RPC server, following the provided
example code:
```
std::string server_address("0.0.0.0:50051");
GreeterServiceImpl service;
ServerBuilder builder;
builder.AddListeningPort(server_address,
grpc::InsecureServerCredentials());
builder.RegisterService(&service);
std::unique_ptr<Server> server(builder.BuildAndStart());
server->Wait();
```
whenever another process is already using the above address, this code
results in a segfault, with this error being printed out:
E1031 13:01:42.858837542 17537 server_chttp2.cc:40]
{"created":"@1541005302.858452834","description":"No address added out of
total 1
resolved","file":"/home2/shenderson/GRPC/Google/grpc/git/grpc/src/core/ext/transport/chttp2/server/chttp2_server.cc","file_line":307,"referenced_errors":[{"created":"@1541005302.858443799","description":"Failed
to add any wildcard
listeners","file":"/home2/shenderson/GRPC/Google/grpc/git/grpc/src/core/lib/iomgr/tcp_server_posix.cc","file_line":324,"referenced_errors":[{"created":"@1541005302.858395680","description":"Unable
to configure
socket","fd":5,"file":"/home2/shenderson/GRPC/Google/grpc/git/grpc/src/core/lib/iomgr/tcp_server_utils_posix_common.cc","file_line":214,"referenced_errors":[{"created":"@1541005302.858378854","description":"OS
Error","errno":98,"file":"/home2/shenderson/GRPC/Google/grpc/git/grpc/src/core/lib/iomgr/tcp_server_utils_posix_common.cc","file_line":187,"os_error":"Address
already in
use","syscall":"bind"}]},{"created":"@1541005302.858442040","description":"Unable
to configure
socket","fd":5,"file":"/home2/shenderson/GRPC/Google/grpc/git/grpc/src/core/lib/iomgr/tcp_server_utils_posix_common.cc","file_line":214,"referenced_errors":[{"created":"@1541005302.858431608","description":"OS
Error","errno":98,"file":"/home2/shenderson/GRPC/Google/grpc/git/grpc/src/core/lib/iomgr/tcp_server_utils_posix_common.cc","file_line":187,"os_error":"Address
already in use","syscall":"bind"}]}]}]}
Segmentation fault (core dumped)
I understand that the error stems from an unsuccessful socket bind. What I
don't understand is whether I should check some error condition in my own
code above, or whether it's the gRPC implementation that wrongly ignores
this error internally, later causing the crash.
I'm running gRPC 1.14.0 (on Linux).
Is this a known issue ?
Thanks,
Stefan
--
You received this message because you are subscribed to the Google Groups
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit
https://groups.google.com/d/msgid/grpc-io/a4ff5efa-4dfc-41de-9464-0e477e3feca5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.