From 9912944ca84a693f835bc25b832c8f55c6aa0325 Mon Sep 17 00:00:00 2001 From: obdev Date: Sat, 7 Oct 2023 08:09:59 +0000 Subject: [PATCH] fix bug: use sqc handler after free --- src/sql/engine/px/ob_px_rpc_processor.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/sql/engine/px/ob_px_rpc_processor.cpp b/src/sql/engine/px/ob_px_rpc_processor.cpp index 6f7755975a..266d5c4636 100644 --- a/src/sql/engine/px/ob_px_rpc_processor.cpp +++ b/src/sql/engine/px/ob_px_rpc_processor.cpp @@ -112,15 +112,18 @@ int ObInitSqcP::process() UNSET_INTERRUPTABLE(arg.sqc_.get_interrupt_id().px_interrupt_id_); unregister_interrupt_ = false; } + + // + if (is_schema_error(ret)) { + ObInterruptUtil::update_schema_error_code(&(sqc_handler->get_exec_ctx()), ret); + } + int report_ret = OB_SUCCESS; + // DO NOT use sqc_handler after release_handler!!! ObPxSqcHandler::release_handler(sqc_handler, report_ret); arg_.sqc_handler_ = nullptr; } - // - if (OB_SUCCESS != ret && is_schema_error(ret) && OB_NOT_NULL(sqc_handler)) { - ObInterruptUtil::update_schema_error_code(&(sqc_handler->get_exec_ctx()), ret); - } // 非rpc框架的错误内容设置到response消息中 // rpc框架的错误码在process中返回OB_SUCCESS result_.rc_ = ret;