C++ GRPC服务器无法启动(迎宾服务器示例)

C++ GRPC服务器无法启动(迎宾服务器示例),c++,protocol-buffers,grpc,C++,Protocol Buffers,Grpc,根据安装文档()安装了GRPC(C++)。构建成功。但是,在构建并执行helloworld示例(examples/cpp/helloworld/)之后,greeter\u服务器将挂起。记录如下: GRPC_VERBOSITY=DEBUG ./greeter_server D1116 13:26:27.355365283 6807 ev_posix.cc:174] Using polling engine: epollex D1116 13:26:27.35

根据安装文档()安装了GRPC(C++)。构建成功。但是,在构建并执行helloworld示例(
examples/cpp/helloworld/
)之后,
greeter\u服务器将挂起。记录如下:

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
预期的行为是,
greeter\u客户端
显示
greeter received:Hello world

使用调试信息构建、使用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
线程3(线程0x7FFFEFF700(LWP 2561)):
#0 futex_wait_cancelable(private=0,expected=0,futex_word=0x555559cef0)位于../sysdeps/unix/sysv/linux/futex internal.h:88
#1在pthread_cond_wait_公用(abstime=0x0,mutex=0x555559ce90,cond=0x555559cec8)的pthread_cond_wait.c:502
#在pthread_cond_wait处有2个线程cond_wait(cond=0x555559ce8,mutex=0x555559ce90)。c:655
#来自/usr/local/lib/libgrpc.so.9的gpr_cv_wait()中的3 0x00007ffff7daf392
#来自/usr/local/lib/libgrpc++.so.1的grpc_core::Executor::ThreadMain(void*)()中的4 0x00007ffff7f27930
#5 0x00007FF7DB0ED3英寸??()来自/usr/local/lib/libgrpc.so.9
#在pthread_create.c:486的start_线程(arg=)中的6 0x00007FF701CFA3
#位于../sysdeps/unix/sysv/linux/x86_64/clone.S:95的克隆()中的7 0x00007FF71404cf
线程2(线程0x7ffff6e81700(LWP 2560)):
#0 futex_wait_cancelable(private=0,expected=0,futex_word=0x55555a0e20)位于../sysdeps/unix/sysv/linux/futex internal.h:88
#1在pthread_cond_wait_公用(abstime=0x0,mutex=0x55555a0dc0,cond=0x55555a0df8)的pthread_cond_wait_公用。c:502
#在pthread_cond_wait处有2个pthread_cond_wait(cond=0x55555a0df8,mutex=0x55555a0dc0)。c:655
#来自/usr/local/lib/libgrpc.so.9的gpr_cv_wait()中的3 0x00007ffff7daf392
#来自/usr/local/lib/libgrpc++.so.1的grpc_core::Executor::ThreadMain(void*)()中的4 0x00007ffff7f27930
#5 0x00007FF7DB0ED3英寸??()来自/usr/local/lib/libgrpc.so.9
#在pthread_create.c:486的start_线程(arg=)中的6 0x00007FF701CFA3
#位于../sysdeps/unix/sysv/linux/x86_64/clone.S:95的克隆()中的7 0x00007FF71404cf
线程1(线程0x7ffff6e84cc0(LWP 2554)):
#0\u strcmp\u avx2()位于../sysdeps/x86\u 64/multiarch/strcmp-avx2.S:737
#1 0x00007FF7F5AAAC位于/usr/local/lib/libgrpc++.so.1中的grpc_core::TraceFlagList::Set(char const*,bool)()中
#来自/usr/local/lib/libgrpc++.so.1的grpc_tracer_init()()中的2 0x00007ff7f5abbe
#来自/usr/local/lib/libgrpc.so.9的grpc_init()中的3 0x00007ffff7cc9361
#grpc::GrpcLibraryCodegen::GrpcLibraryCodegen(this=0x555559BD30,call_grpc_init=true)中的4 0x000055555564e36位于/usr/local/include/grpcpp/impl/codegen/grpc_library.h:45
#在/usr/local/lib/libgrpc++.so.1的grpc_impl::ServerBuilder::BuildAndStart()中的5 0x00007ffff7edf49e
#6 0x000055555575C29位于greeter_服务器上的RunServer()中。cc:61
#在迎宾_服务器的主服务器(argc=1,argv=0x7fffffffdb78)中有7个0x000055555575d7d。cc:71

确保不要将库grpc\u unsecure与其他grpc库链接在一起


@rustyx希望服务器侦听连接(在打印
服务器侦听之后)。将问题隔离到
builder.BuildAndStart()
函数(执行此函数时服务器阻塞)看来这是一个未解决的问题:已修复!看起来libgrpc存在多个版本的问题。清除它们并重新安装。当前安装似乎正常。您能在本文中提供信息吗?该链接在将来可能会失效,但该信息可能仍与某些用户相关。