Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BugFix] Fix the mem_tracker use-after-free of UDF (#41710)
## Why I'm doing: ``` *** Aborted at 1686120661 (unix time) try "date -d @1686120661" if you are using GNU date *** PC: @ 0x2ce0b61 starrocks::MemTracker::consume() *** SIGSEGV (@0x0) received by PID 117789 (TID 0x7f9cd0728700) from PID 0; stack trace: *** @ 0x58f9dc2 google::(anonymous namespace)::FailureSignalHandler() @ 0x7f9d147ae362 (unknown) @ 0x7f9d147b28b9 JVM_handle_linux_signal @ 0x7f9d147a5f78 (unknown) @ 0x7f9d13ce1390 (unknown) @ 0x2ce0b61 starrocks::MemTracker::consume() @ 0x486d328 _ZNSt17_Function_handlerIFvvEZN9starrocks24call_function_in_pthreadEPNS1_12RuntimeStateERKSt8functionIFNS1_6StatusEvEEEUlvE_E9_M_invokeERKSt9_Any_data @ 0x475fbe0 starrocks::PriorityThreadPool::work_thread() @ 0x58b97e7 thread_proxy @ 0x7f9d13cd76ba start_thread @ 0x7f9d132f841d clone @ 0x0 (unknown) ``` After `promise->set_value`, if runtime state of query is first destructed, then release the memory, the mem_tracker has already been free, so it will be crash here. ## What I'm doing: Release the mem first, and then set promise value. Signed-off-by: trueeyu <lxhhust350@qq.com> (cherry picked from commit e36a684)
- Loading branch information