GRPC版本:
v1.30.0 c++
uname -a:
Linux localhost.localdomain 4.14.0-115.el7a.0.1.aarch64 #1 SMP Sun Nov 25 20:54:21 UTC 2018 aarch64 aarch64 aarch64 GNU/Linux
操作系统:
CentOS Linux release 7.6.1810 (AltArch)
问题描述:
int RunServer(std::string stdAddr)
{
std::string server_address(stdAddr);
grpcServiceImpl service;
ServerBuilder builder;
builder.AddListeningPort(server_address, grpc::InsecureServerCredentials());
builder.RegisterService(&service);
std::unique_ptr<Server> server(builder.BuildAndStart());
LOG(INFO) << "GRPC RunServer";
server->Wait();
return 0;
}
解决方案:
修改grpc源码:grpc\src\core\lib\debug\trace.cc 中的void TraceFlagList::Add(TraceFlag* flag)函数。
void TraceFlagList::Add(TraceFlag* flag) {
for (TraceFlag* t = root_tracer_; t != nullptr; t = t->next_tracer_) {
if (t == flag) {
return;
}
}
flag->next_tracer_ = root_tracer_;
root_tracer_ = flag;
}
修改完后,重新编译grpc库即可。