提交 5895e3cc 编写于 作者: X xuhuleon 提交者: LINGuanRen

support check stack overflow for asan

上级 abd9aad3
......@@ -102,11 +102,17 @@ inline int call_with_new_stack(SContext& sctx)
ret; \
})
#else
#define SMART_CALL(func) \
({ \
int ret = OB_SUCCESS; \
ret = func; \
ret; \
#define SMART_CALL(func) \
({ \
int ret = OB_SUCCESS; \
bool is_overflow = false; \
if (OB_FAIL(check_stack_overflow(is_overflow, STACK_RESERVED_SIZE))) { \
} else if (!is_overflow) { \
ret = func; \
} else { \
ret = OB_STACK_OVERFLOW; \
} \
ret; \
})
#endif
} // end of namespace common
......
......@@ -3318,6 +3318,16 @@ static struct ObStrErrorInit
ORACLE_ERRNO[-OB_CLUSTER_NAME_HASH_CONFLICT] = 600;
ORACLE_STR_ERROR[-OB_CLUSTER_NAME_HASH_CONFLICT] = "ORA-00600: internal error code, arguments: -4378, cluster name conflict";
ORACLE_STR_USER_ERROR[-OB_CLUSTER_NAME_HASH_CONFLICT] = "ORA-00600: internal error code, arguments: -4378, cluster name conflict";
ERROR_NAME[-OB_STACK_OVERFLOW] = "OB_STACK_OVERFLOW";
ERROR_CAUSE[-OB_STACK_OVERFLOW] = "Internal Error";
ERROR_SOLUTION[-OB_STACK_OVERFLOW] = "Contact OceanBase Support";
MYSQL_ERRNO[-OB_STACK_OVERFLOW] = -1;
SQLSTATE[-OB_STACK_OVERFLOW] = "HY000";
STR_ERROR[-OB_STACK_OVERFLOW] = "stack overflow";
STR_USER_ERROR[-OB_STACK_OVERFLOW] = "stack overflow";
ORACLE_ERRNO[-OB_STACK_OVERFLOW] = 600;
ORACLE_STR_ERROR[-OB_STACK_OVERFLOW] = "ORA-00600: internal error code, arguments: -4385, stack overflow";
ORACLE_STR_USER_ERROR[-OB_STACK_OVERFLOW] = "ORA-00600: internal error code, arguments: -4385, stack overflow";
ERROR_NAME[-OB_IMPORT_NOT_IN_SERVER] = "OB_IMPORT_NOT_IN_SERVER";
ERROR_CAUSE[-OB_IMPORT_NOT_IN_SERVER] = "Internal Error";
ERROR_SOLUTION[-OB_IMPORT_NOT_IN_SERVER] = "Contact OceanBase Support";
......@@ -423,6 +423,7 @@ DEFINE_ERROR(OB_DISK_ERROR, -4375, -1, "HY000", "observer has disk error");
DEFINE_ORACLE_ERROR(OB_UNIMPLEMENTED_FEATURE, -4376, -1, "HY000", "unimplemented feature", 3001, "unimplemented feature");
DEFINE_ERROR_EXT(OB_ERR_DEFENSIVE_CHECK, -4377, -1, "HY000", "fatal internal error", "fatal internal error in [%.*s]");
DEFINE_ERROR(OB_CLUSTER_NAME_HASH_CONFLICT, -4378, -1, "HY000", "cluster name conflict");
DEFINE_ERROR(OB_STACK_OVERFLOW, -4385, -1, "HY000", "stack overflow");
////////////////////////////////////////////////////////////////
//error code for root server & server management -4500 ---- -5000
......
......@@ -238,6 +238,7 @@ constexpr int OB_DISK_ERROR = -4375;
constexpr int OB_UNIMPLEMENTED_FEATURE = -4376;
constexpr int OB_ERR_DEFENSIVE_CHECK = -4377;
constexpr int OB_CLUSTER_NAME_HASH_CONFLICT = -4378;
constexpr int OB_STACK_OVERFLOW = -4385;
constexpr int OB_IMPORT_NOT_IN_SERVER = -4505;
constexpr int OB_CONVERT_ERROR = -4507;
constexpr int OB_BYPASS_TIMEOUT = -4510;
......@@ -1572,6 +1573,7 @@ constexpr int OB_ERR_INVALID_DATE_MSG_FMT_V2 = -4219;
#define OB_UNIMPLEMENTED_FEATURE__USER_ERROR_MSG "unimplemented feature"
#define OB_ERR_DEFENSIVE_CHECK__USER_ERROR_MSG "fatal internal error in [%.*s]"
#define OB_CLUSTER_NAME_HASH_CONFLICT__USER_ERROR_MSG "cluster name conflict"
#define OB_STACK_OVERFLOW__USER_ERROR_MSG "stack overflow"
#define OB_IMPORT_NOT_IN_SERVER__USER_ERROR_MSG "Import not in service"
#define OB_CONVERT_ERROR__USER_ERROR_MSG "Convert error"
#define OB_BYPASS_TIMEOUT__USER_ERROR_MSG "Bypass timeout"
......@@ -3029,6 +3031,7 @@ constexpr int OB_ERR_INVALID_DATE_MSG_FMT_V2 = -4219;
#define OB_UNIMPLEMENTED_FEATURE__ORA_USER_ERROR_MSG "ORA-03001: unimplemented feature"
#define OB_ERR_DEFENSIVE_CHECK__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -4377, fatal internal error in [%.*s]"
#define OB_CLUSTER_NAME_HASH_CONFLICT__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -4378, cluster name conflict"
#define OB_STACK_OVERFLOW__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -4385, stack overflow"
#define OB_IMPORT_NOT_IN_SERVER__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -4505, Import not in service"
#define OB_CONVERT_ERROR__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -4507, Convert error"
#define OB_BYPASS_TIMEOUT__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -4510, Bypass timeout"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册