TNonblockingIOThread :: notify中的节俭分段错误(TNonblockingServer :: TConnection * conn)

时间:2018-10-31 02:26:16

标签: c++ server segmentation-fault thrift

bt日志:

signal 11 (Segmentation fault), address is (nil) from 0x7f0280708196
[bt]: (1) /lib/x86_64-linux-gnu/libc.so.6(abort+0x2d6) [0x7f0280708196]
[bt]: (2) /lib/x86_64-linux-gnu/libc.so.6(abort+0x2d6) [0x7f0280708196]
[bt]: (3) /lib/x86_64-linux-gnu/libc.so.6(+0x777ea) [0x7f02807487ea]
[bt]: (4) /lib/x86_64-linux-gnu/libc.so.6(__fortify_fail+0x5c) 
[0x7f02807ea15c]
[bt]: (5) /lib/x86_64-linux-gnu/libc.so.6(+0x117160) [0x7f02807e8160]
[bt]: (6) /lib/x86_64-linux-gnu/libc.so.6(+0x1190a7) [0x7f02807ea0a7]
[bt]: (7) ./bazel-bin/weardex-search-replica(_ZN6apache6thrift6server20TNonblockingIOThread6notifyEPNS1_18TNonblockingServer11TConnectionE+0x95) [0x18b4aa5]
[bt]: (8) ./bazel-bin/weardex-search-replica(_ZN6apache6thrift6server18TNonblockingServer11TConnection4Task3runEv+0x2a7) [0x18bc2a7]
[bt]: (9) ./bazel-bin/weardex-search-replica(_ZN6apache6thrift11concurrency13ThreadManager6Worker3runEv+0x512) [0x189cdc2]
[bt]: (10) ./bazel-bin/weardex-search-replica(_ZN6apache6thrift11concurrency13PthreadThread10threadMainEPv+0xd6) [0x18aff26]
[bt]: (11) /lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba) [0x7f0281d0d6ba]
[bt]: (12) /lib/x86_64-linux-gnu/libc.so.6(clone+0x6d) [0x7f02807d841d]

启动服务器的代码:

std::shared_ptr<ReplicaIndexingServiceHandler> handler(new ReplicaIndexingServiceHandler(raft));
std::shared_ptr<TProcessor> processor(new ReplicaIndexingServiceProcessor(handler));
std::shared_ptr<TProtocolFactory> protocolFactory(new TBinaryProtocolFactory());
std::shared_ptr<TNonblockingServerTransport> transport(new TNonblockingServerSocket(FLAGS_thrift_port));

std::shared_ptr<ThreadManager> threadManager = ThreadManager::newSimpleThreadManager(FLAGS_thrift_worker_count);
std::shared_ptr<PosixThreadFactory> threadFactory = std::shared_ptr<PosixThreadFactory>(new PosixThreadFactory());
threadManager->threadFactory(threadFactory);
threadManager->start();

_server = std::make_shared<TNonblockingServer>(processor, protocolFactory, transport, threadManager);

LOG(INFO) << "thrift server going to start at port: " << FLAGS_thrift_port;
try {
    _server->serve();
} catch (std::exception& tx) {
    LOG(ERROR) << "thrift server exception, err: " << tx.what();
}

我尝试过节俭0.9.3和0.11.0,但它们都在同一地方失败了。

我有数百台旧服务器,例如1%的服务器将始终在此位置崩溃。

1 个答案:

答案 0 :(得分:0)

升级到V0.12.0已解决了分段错误,但V0.12.0仍未正式发布。我发现相关票证已更改崩溃的错误:THRIFT-4618