grpc::AsyncGenericService在RequestCall方法上给出分段错误



我正在处理的程序(C++(是用于服务代理的。它在实现中使用了grpc的AsyncGenericService。程序在调用RequestCall((方法后崩溃(分段错误(。

一些代码行如下:

::grpc::AsyncGenericService service_; // a member variable
auto req = std::make_shared<Request>(); // Request is a struct with context and stream members
service_.RequestCall(&req->getContext(), &req->getStream(), cqueue_.get(), cqueue_.get(), tag); // the program is giving seg fault at this line

尝试:

我排除了代理的错误服务导致这种情况的可能性。

我想知道在那之后如何进行调试。由于RequestCall()在GRPC内部,所以我想问下一步该如何接近这个bug。

更新:

堆叠轨道与观察到的碰撞对齐。正如您在第1帧中看到的,它正在调用RequestCall((。在框架1下方,是程序内部功能。

(gdb) bt
#0  0x00007ffff37c61c6 in grpc::ServerInterface::GenericAsyncRequest::GenericAsyncRequest(grpc::ServerInterface*, grpc::GenericServerContext*, grpc::internal::ServerAsyncStreamingInterface*, grpc_impl::CompletionQueue*, grpc_impl::ServerCompletionQueue*, void*, bool) () from /opt/third/grpc/1.28.1/lib/libgrpc++.so.1
#1  0x00007ffff37b58c5 in grpc::AsyncGenericService::RequestCall(grpc::GenericServerContext*, grpc_impl::ServerAsyncReaderWriter<grpc::ByteBuffer, grpc::ByteBuffer>*, grpc_impl::CompletionQueue*, grpc_impl::ServerCompletionQueue*, void*) ()
from /opt/third/grpc/1.28.1/lib/libgrpc++.so.1

有一个崩溃的调用堆栈将有助于了解问题所在。

最新更新