程序崩溃时, 会有核心转储文件生成, 方便定位有异常的栈.
该命令用来显示异常栈.
下面这个例子中, #6
位置有空指针, 所以异常.
$gdb binary/home/admin/d2_runtime/bin/sap_server_d suez_worker/core-500-sap_server_d-3504-1553079090
(gdb) bt
#0 0x00007f71ae6fc5f7 in raise () from /usr/lib64/libc.so.6
#1 0x00007f71ae6fdce8 in abort () from /usr/lib64/libc.so.6
#2 0x00007f719c8925b9 in os::abort (dump_core=true) at /home/admin/JVM/JVM_Building/jdk7/jvm/building/jvm_source_git/hotspot-jdk7u/src/os/linux/vm/os_linux.cpp:1617
#3 0x00007f719ca0098b in VMError::report_and_die (this=0x7f717efbf8e0) at /home/admin/JVM/JVM_Building/jdk7/jvm/building/jvm_source_git/hotspot-jdk7u/src/share/vm/utilities/vmError.cpp:1033
#4 0x00007f719c89671e in JVM_handle_linux_signal (sig=11, info=0x7f717efbfab0, ucVoid=0x7f717efbf980, abort_if_unrecognized=)
at /home/admin/JVM/JVM_Building/jdk7/jvm/building/jvm_source_git/hotspot-jdk7u/src/os_cpu/linux_x86/vm/os_linux_x86.cpp:531
#5
#6 basic_engine::sorter_type_combo_priority::TypeComboPrioritySorter::sort (this=0x0, match_docs=...) at build/release64/basic_engine/sorter/type_combo_priority/TypeComboPrioritySorter.cpp:197
#7 0x00007f71a7cf8e70 in d2::search::JoinSearcher::doSearch (this=0x1129a7f0, match_docs=0x1129a228, error_msg=...) at build/release64/d2_framework/search/JoinSearcher.cpp:162
#8 0x00007f71a7d77d26 in d2::search::BaseSearcher::search (this=0x1129a7f0, match_docs=0x1129a228, error_msg=...) at build/release64/d2_framework/search/Searcher.cpp:96
#9 0x00007f71a7d7721b in d2::search::QueryExecutor::execute (this=0x0, this@entry=0x7f717efc2150, table_query_ptr=0x114de8e0, table_query_ptr@entry=0x7f713a903510, allocator=..., match_docs=0x8, error_msg=...)
at build/release64/d2_framework/search/QueryExecutor.cpp:53
#10 0x00007f713ab74609 in basic_engine::basic_module::SearchProcessor::executeQuery (this=0x7f713a903460, query=0x7f713a903510, search_result=0x7f713a904078, mem_pool=, reporter=)
at build/release64/basic_engine/processor/search/SearchProcessor.cpp:188
#11 0x00007f713ab75228 in basic_engine::basic_module::SearchProcessor::processImpl (this=0x7f713a903460, context=0x7f717efc8640, search_result=@0x7f717efc4238: 0x7f713a904078, mem_pool=0xceb7640)
at build/release64/basic_engine/processor/search/SearchProcessor.cpp:172
#12 0x00007f713ab75335 in basic_engine::basic_module::SearchProcessor::process (this=, context=0x7f717efc8640, result=0x7f713a903248, mem_pool=)
at build/release64/basic_engine/processor/search/SearchProcessor.cpp:131
#13 0x00007f71a7c4e3ce in d2::framework::ServiceChain::processChain (this=0x7f713a903380, rule_list=..., pool=0xceb7640, context=0x7f717efc8640, result=0x7f713a903248) at build/release64/d2_framework/framework/ServiceChain.cpp:277
#14 0x00007f71a7c4ee3c in d2::framework::ServiceChain::process (this=0x0, context=0x114de8e0, result=0x1, pool=0x8) at build/release64/d2_framework/framework/ServiceChain.cpp:143
#15 0x00007f71a7c5794a in d2::framework::ServiceChainProcessor::doProcessImpl (this=0x7f713a903028, context=0x7f717efc8640, result_str=...) at build/release64/d2_framework/framework/ServiceChainProcessor.cpp:219
#16 0x00007f71a7c57d40 in d2::framework::ServiceChainProcessor::doProcess (this=0x0, this@entry=0x7f713a903028, context=0x114de8e0, context@entry=0x7f717efc8640, kvpairs=..., result_str=...)
at build/release64/d2_framework/framework/ServiceChainProcessor.cpp:153
#17 0x00007f71a7c58473 in d2::framework::ServiceChainProcessor::process (this=this@entry=0x7f713a903028, request=..., result_str=..., service_name=...) at build/release64/d2_framework/framework/ServiceChainProcessor.cpp:81
#18 0x00007f71a7c368b5 in d2::service::SearchRequestHandler::search (this=this@entry=0x2fea870, request=..., response=..., service_name=...) at build/release64/d2_framework/service/searcher/SearchRequestHandler.cpp:65
#19 0x00007f71a7c36ee5 in d2::service::SearchServiceImpl::doSearch (this=this@entry=0x15d7c20, service_snapshot=..., request=..., response=..., service_name=...) at build/release64/d2_framework/service/searcher/SearchServiceImpl.cpp:258
#20 0x00007f71a7c379a0 in d2::service::SearchServiceImpl::sapSearch (this=0x15d7c20, context=...) at build/release64/d2_framework/service/searcher/SearchServiceImpl.cpp:182
#21 0x000000000048115b in sap::ServerWorker::doProcess() ()
#22 0x00000000004787c7 in sap::EasyThreadPool::runTask(sap::Runnable*) ()
#23 0x000000000044cfb2 in sap::EasyThreadPoolWithQueue::process_cb(ev_loop*, ev_async*, int) ()
#24 0x00007f71b0022014 in v1_ev_invoke_pending (loop=loop@entry=0x1c6a800) at ev.c:2104
#25 0x00007f71b000c6ea in easy_baseth_pool_invoke (loop=0x1c6a800) at easy_baseth_pool.c:217
#26 0x00007f71b0026776 in v1_ev_run (loop=0x1c6a800, flags=0) at ev.c:2456
#27 0x000000000044cd94 in sap::EasyThreadPoolWithQueue::thread_on_start(void*) ()
#28 0x00007f71b0b60dc5 in start_thread () from /usr/lib64/libpthread.so.0
#29 0x00007f71ae7bdced in clone () from /usr/lib64/libc.so.6