KVstorageBaseRaft-cpp
KVstorageBaseRaft-cpp copied to clipboard
CLion编译完成后在远程主机端运行bin目录下可执行文件报错:段错误 (核心已转储)。 附部分gdb调试信息,求解答
yzz@yzz:~/home/raftKV/KVstorageBaseRaft-cpp/bin$ ls callerMain consumer provider raftCoreRun test.conf yzz@yzz:~/home/raftKV/KVstorageBaseRaft-cpp/bin$ cd .. yzz@yzz:~/home/raftKV/KVstorageBaseRaft-cpp$ ls bin cmake-build-remotedebug docs format.sh main.cpp src tmp cmake-build-debug-remote-host CMakeLists.txt example lib README.md test yzz@yzz:~/home/raftKV/KVstorageBaseRaft-cpp$ cd bin yzz@yzz:~/home/raftKV/KVstorageBaseRaft-cpp/bin$ ls callerMain consumer provider raftCoreRun test.conf yzz@yzz:~/home/raftKV/KVstorageBaseRaft-cpp/bin$ ./provider 段错误 (核心已转储) yzz@yzz:~/home/raftKV/KVstorageBaseRaft-cpp/bin$ ./consumer 段错误 (核心已转储) yzz@yzz:~/home/raftKV/KVstorageBaseRaft-cpp/bin$ ./raftCoreRun 段错误 (核心已转储) yzz@yzz:~/home/raftKV/KVstorageBaseRaft-cpp/bin$ ./callerMain 段错误 (核心已转储) yzz@yzz:~/home/raftKV/KVstorageBaseRaft-cpp/bin$ vi test.conf yzz@yzz:~/home/raftKV/KVstorageBaseRaft-cpp/bin$ yzz@yzz:~/home/raftKV/KVstorageBaseRaft-cpp/bin$ yzz@yzz:~/home/raftKV/KVstorageBaseRaft-cpp/bin$
yzz@yzz:~/home/raftKV/KVstorageBaseRaft-cpp/bin$ gdb ./provider GNU gdb (Ubuntu 9.2-0ubuntu1~20.04.2) 9.2 Copyright (C) 2020 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: http://www.gnu.org/software/gdb/bugs/. Find the GDB manual and other documentation resources online at: http://www.gnu.org/software/gdb/documentation/.
For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from ./provider... (gdb) run Starting program: /home/yzz/home/raftKV/KVstorageBaseRaft-cpp/bin/provider [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Program received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
(gdb) l
24 void GetFriendsList(::google::protobuf::RpcController *controller, const ::fixbug::GetFriendsListRequest *request,
25 ::fixbug::GetFriendsListResponse *response, ::google::protobuf::Closure *done) {
26 uint32_t userid = request->userid();
27 std::vectorstd::string friendsList = GetFriendsList(userid);
28 response->mutable_result()->set_errcode(0);
29 response->mutable_result()->set_errmsg("");
30 for (std::string &name : friendsList) {
31 std::string *p = response->add_friends();
32 p = name;
33 }
(gdb) bt
#0 0x0000000000000000 in ?? ()
#1 0x00007ffff7db2223 in ?? () from /lib/x86_64-linux-gnu/libprotobuf.so.17
#2 0x00007ffff7db2660 in google::protobuf::internal::InitSCCImpl(google::protobuf::internal::SCCInfoBase) ()
from /lib/x86_64-linux-gnu/libprotobuf.so.17
#3 0x00007ffff7b51455 in google::protobuf::internal::InitSCC (scc=