This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch opt_memtable_speed
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/opt_memtable_speed by this 
push:
     new 1ddfdab494 [fix](hash join) fix heap-use-after-free of HashJoinNode 
(#23094)
1ddfdab494 is described below

commit 1ddfdab4943bd5dcf4ca67feb3b6473e9bc82a4e
Author: TengJianPing <[email protected]>
AuthorDate: Thu Aug 17 16:29:47 2023 +0800

    [fix](hash join) fix heap-use-after-free of HashJoinNode (#23094)
---
 be/src/vec/exec/join/vhash_join_node.cpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/be/src/vec/exec/join/vhash_join_node.cpp 
b/be/src/vec/exec/join/vhash_join_node.cpp
index 4494ec80d2..7aaddf4b2a 100644
--- a/be/src/vec/exec/join/vhash_join_node.cpp
+++ b/be/src/vec/exec/join/vhash_join_node.cpp
@@ -777,11 +777,10 @@ bool 
HashJoinNode::_is_hash_join_early_start_probe_eos(RuntimeState* state) cons
 }
 
 void HashJoinNode::_probe_side_open_thread(RuntimeState* state, 
std::promise<Status>* promise) {
-    Defer defer {[&]() { _probe_open_finish = true; }};
-
     SCOPED_ATTACH_TASK(state);
     auto st = child(0)->open(state);
     if (!st.ok()) {
+        _probe_open_finish = true;
         promise->set_value(st);
         return;
     }
@@ -796,17 +795,20 @@ void HashJoinNode::_probe_side_open_thread(RuntimeState* 
state, std::promise<Sta
                               _children[0], std::placeholders::_1, 
std::placeholders::_2,
                               std::placeholders::_3));
             if (!st.ok()) {
+                _probe_open_finish = true;
                 promise->set_value(st);
                 return;
             }
 
             st = push(state, &_probe_block, _probe_eos);
             if (!st.ok()) {
+                _probe_open_finish = true;
                 promise->set_value(st);
                 return;
             }
         }
     }
+    _probe_open_finish = true;
     promise->set_value(Status::OK());
 }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to