首批通过分布式安全可靠测评,为关键业务系统打造
如何快速确认 core 是否是由于爆栈导致
更新时间:2024-01-16 11:56
说明
该内容适用于 OceanBase 数据库 V2.x 和 V3.x 版本。
获取 crash 堆栈信息,类似如下内容:
CRASH ERROR!!! sig=11, sig_code=2, sig_addr=7ff5000eaff8, timestamp=1664366994522192, tid=3441460, tname=TNT_L0_1002, trace_id=1237827481****-166138027986****, extra_info=((null)), lbt=0xa13ecfb 0xa13a737 0x7ff884d2a5cf 0x9502e0b 0x958ff33 0x95847aa 0x95847fc 0x95847fc 0x95847fc 0x95847fc 0x95847fc 0x95847fc 0x95847fc 0x95847fc 0x95847fc 0x95847fc 0x95847fc 0x95847fc 0x95847fc 0x95847fc 0x95847fc 0x95847fc 0x95847fc 0x95847fc这段信息是一个程序崩溃时的堆栈信息,其中包含了以下内容:
- sig=11:程序崩溃时捕获到的信号编号,这里是11,通常表示访问了非法的内存地址。
- sig_code=2:信号的错误代码,这里是2,具体含义需要结合信号编号来解释。
- sig_addr=7ff5000eaff8:信号发生的地址,这里是一个十六进制的地址。
- timestamp=1664366994522192:崩溃发生的时间戳。
- tid=3441460:崩溃时所在的线程 ID。
- tname=TNT_L0_1002:线程的名称。
- trace_id=12378274812623-1661380279865382:崩溃发生时的追踪 ID。
- extra_info=((null)):额外的信息,在这里是空的。
- lbt=...:堆栈信息,列出了多个内存地址,通常是调用栈的信息,可以用来分析程序崩溃时的调用链。
观察最后的几个栈地址,当最后几个栈地址重复度非常高时,大概率是递归函数导致的爆栈,类似如下内容:
[root@ob12 log]# addr2line -pCfe /home/admin/oceanbase/bin/observer 0xa13ecfb 0xa13a737 0x7ff884d2a5cf 0x9502e0b 0x958ff33 0x95847aa 0x95847fc 0x95847fc 0x95847fc 0x95847fc 0x95847fc 0x95847fc 0x95847fc 0x95847fc 0x95847fc 0x95847fc 0x95847fc 0x95847fc 0x95847fc 0x95847fc 0x95847fc 0x95847fc 0x95847fc 0x95847fc safe_backtrace at ??:? oceanbase::common::coredump_cb(int, siginfo_t*) at ??:? ?? ??:0 oceanbase::sql::ObDMLStmt::get_child_stmts(oceanbase::common::ObIArray<oceanbase::sql::ObSelectStmt*>&) const at ??:? oceanbase::sql::ObSelectStmt::get_child_stmts(oceanbase::common::ObIArray<oceanbase::sql::ObSelectStmt*>&) const at ??:? oceanbase::sql::ObSelectStmt::check_table_be_modified(unsigned long) const at ??:? oceanbase::sql::ObSelectStmt::check_table_be_modified(unsigned long) const at ??:? oceanbase::sql::ObSelectStmt::check_table_be_modified(unsigned long) const at ??:? oceanbase::sql::ObSelectStmt::check_table_be_modified(unsigned long) const at ??:? oceanbase::sql::ObSelectStmt::check_table_be_modified(unsigned long) const at ??:? oceanbase::sql::ObSelectStmt::check_table_be_modified(unsigned long) const at ??:? oceanbase::sql::ObSelectStmt::check_table_be_modified(unsigned long) const at ??:? oceanbase::sql::ObSelectStmt::check_table_be_modified(unsigned long) const at ??:? oceanbase::sql::ObSelectStmt::check_table_be_modified(unsigned long) const at ??:? oceanbase::sql::ObSelectStmt::check_table_be_modified(unsigned long) const at ??:? oceanbase::sql::ObSelectStmt::check_table_be_modified(unsigned long) const at ??:? oceanbase::sql::ObSelectStmt::check_table_be_modified(unsigned long) const at ??:? oceanbase::sql::ObSelectStmt::check_table_be_modified(unsigned long) const at ??:? oceanbase::sql::ObSelectStmt::check_table_be_modified(unsigned long) const at ??:? oceanbase::sql::ObSelectStmt::check_table_be_modified(unsigned long) const at ??:? oceanbase::sql::ObSelectStmt::check_table_be_modified(unsigned long) const at ??:? oceanbase::sql::ObSelectStmt::check_table_be_modified(unsigned long) const at ??:? oceanbase::sql::ObSelectStmt::check_table_be_modified(unsigned long) const at ??:? oceanbase::sql::ObSelectStmt::check_table_be_modified(unsigned long) const at ??:? [root@ob12 log]#