[英]GRPC server fails to launch (greeter server example)
Installed GRPC (C++) according to the installation docs ( https://grpc.io/docs/quickstart/cpp/ ).根据安装文档( https://grpc.io/docs/quickstart/cpp/ )安装了 GRPC (C++)。 The build went through successfully.
构建成功完成。 However, after building and executing the helloworld example (
examples/cpp/helloworld/
), the greeter_server
hangs.但是,在构建和执行 helloworld 示例 (
examples/cpp/helloworld/
) 之后, greeter_server
挂起。 Log below:日志如下:
GRPC_VERBOSITY=DEBUG ./greeter_server
D1116 13:26:27.355365283 6807 ev_posix.cc:174] Using polling engine: epollex
D1116 13:26:27.355788088 6807 dns_resolver_ares.cc:503] Using ares dns resolver
The expected behavior would be for the greeter_client
to display Greeter received: Hello world
.预期的行为是
greeter_client
显示Greeter received: Hello world
。
After building with debug info, running with GDB, and getting a thread dump:使用调试信息构建后,使用 GDB 运行并获得线程转储:
Thread 3 (Thread 0x7fffeffff700 (LWP 2561)):
#0 futex_wait_cancelable (private=0, expected=0, futex_word=0x55555559cef0) at ../sysdeps/unix/sysv/linux/futex-internal.h:88
#1 __pthread_cond_wait_common (abstime=0x0, mutex=0x55555559ce90, cond=0x55555559cec8) at pthread_cond_wait.c:502
#2 __pthread_cond_wait (cond=0x55555559cec8, mutex=0x55555559ce90) at pthread_cond_wait.c:655
#3 0x00007ffff7daf392 in gpr_cv_wait () from /usr/local/lib/libgrpc.so.9
#4 0x00007ffff7f27930 in grpc_core::Executor::ThreadMain(void*) () from /usr/local/lib/libgrpc++.so.1
#5 0x00007ffff7db0ed3 in ?? () from /usr/local/lib/libgrpc.so.9
#6 0x00007ffff701cfa3 in start_thread (arg=<optimized out>) at pthread_create.c:486
#7 0x00007ffff71404cf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
Thread 2 (Thread 0x7ffff6e81700 (LWP 2560)):
#0 futex_wait_cancelable (private=0, expected=0, futex_word=0x5555555a0e20) at ../sysdeps/unix/sysv/linux/futex-internal.h:88
#1 __pthread_cond_wait_common (abstime=0x0, mutex=0x5555555a0dc0, cond=0x5555555a0df8) at pthread_cond_wait.c:502
#2 __pthread_cond_wait (cond=0x5555555a0df8, mutex=0x5555555a0dc0) at pthread_cond_wait.c:655
#3 0x00007ffff7daf392 in gpr_cv_wait () from /usr/local/lib/libgrpc.so.9
#4 0x00007ffff7f27930 in grpc_core::Executor::ThreadMain(void*) () from /usr/local/lib/libgrpc++.so.1
#5 0x00007ffff7db0ed3 in ?? () from /usr/local/lib/libgrpc.so.9
#6 0x00007ffff701cfa3 in start_thread (arg=<optimized out>) at pthread_create.c:486
#7 0x00007ffff71404cf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
Thread 1 (Thread 0x7ffff6e84cc0 (LWP 2554)):
#0 __strcmp_avx2 () at ../sysdeps/x86_64/multiarch/strcmp-avx2.S:737
#1 0x00007ffff7f5aaac in grpc_core::TraceFlagList::Set(char const*, bool) () from /usr/local/lib/libgrpc++.so.1
#2 0x00007ffff7f5abbe in grpc_tracer_init() () from /usr/local/lib/libgrpc++.so.1
#3 0x00007ffff7cc9361 in grpc_init () from /usr/local/lib/libgrpc.so.9
#4 0x0000555555564e36 in grpc::GrpcLibraryCodegen::GrpcLibraryCodegen (this=0x55555559bd30, call_grpc_init=true) at /usr/local/include/grpcpp/impl/codegen/grpc_library.h:45
#5 0x00007ffff7edf49e in grpc_impl::ServerBuilder::BuildAndStart() () from /usr/local/lib/libgrpc++.so.1
#6 0x0000555555575c29 in RunServer () at greeter_server.cc:61
#7 0x0000555555575d7d in main (argc=1, argv=0x7fffffffdb78) at greeter_server.cc:71
make sure that you dont link the library grpc_unsecure along with other grpc libs..确保您没有将库 grpc_unsecure 与其他 grpc 库链接在一起。
https://github.com/grpc/grpc/issues/20757#issuecomment-545773014 https://github.com/grpc/grpc/issues/20757#issuecomment-545773014
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.