首批通过分布式安全可靠测评,为关键业务系统打造
如何确认 CORE 是由于递归函数导致的爆栈
更新时间:2026-06-04 09:56
本文讲述当出现 CORE 时,如何快速确认是由于递归函数导致的爆栈产生。 通过获取 CRASH 堆栈信息,当最后几个栈地址重复度非常高时,大概率是递归函数导致的爆栈。
适用版本
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=12378274812623-1661380279865382, 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观察最后的几个栈地址,当最后几个栈地址重复度非常高时,大概率是递归函数导致的爆栈,类似如下内容。
[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 ??:? ```