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

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


The following commit(s) were added to refs/heads/spill_and_reserve by this push:
     new 34414ee9e3a [fix](spill) coredump caused by spill (#47180)
34414ee9e3a is described below

commit 34414ee9e3aef2721f825050b26a428b097a5bf6
Author: Jerry Hu <hushengg...@selectdb.com>
AuthorDate: Fri Jan 17 20:41:19 2025 +0800

    [fix](spill) coredump caused by spill (#47180)
    
    ### What problem does this PR solve?
    
    Issue Number: close #xxx
    
    Related PR: #xxx
    
    Problem Summary:
    
    ```
    *** Query id: ca962b960d1c4cc7-9780016c24b8b12a ***
    *** is nereids: 1 ***
    *** tablet id: 0 ***
    *** Aborted at 1737007364 (unix time) try "date -d @1737007364" if you are 
using GNU date ***
    *** Current BE git commitID: 1984506b6c ***
    *** SIGSEGV address not mapped to object (@0x278) received by PID 169202 
(TID 171117 OR 0x7f416b5ec640) from PID 632; stack trace: ***
     0# doris::signal::(anonymous namespace)::FailureSignalHandler(int, 
siginfo_t*, void*) at /root/doris/be/src/common/signal_handler.h:421
     1# PosixSignals::chained_handler(int, siginfo*, void*) [clone .part.0] in 
/usr/lib/jvm/java-17-openjdk-amd64/lib/server/libjvm.so
     2# JVM_handle_linux_signal in 
/usr/lib/jvm/java-17-openjdk-amd64/lib/server/libjvm.so
     3# 0x00007F451E62D520 in /lib/x86_64-linux-gnu/libc.so.6
     4# doris::vectorized::Block::rows() const at 
/root/doris/be/src/vec/core/block.cpp:349
     5# 
doris::pipeline::HashJoinProbeOperatorX::need_more_input_data(doris::RuntimeState*)
 const at /root/doris/be/src/pipeline/exec/hashjoin_probe_operator.cpp:439
     6# doris::pipeline::PipelineTask::_is_blocked() at 
/root/doris/be/src/pipeline/pipeline_task.cpp:293
     7# doris::pipeline::PipelineTask::execute(bool*) at 
/root/doris/be/src/pipeline/pipeline_task.cpp:364
     8# doris::pipeline::TaskScheduler::_do_work(int) at 
/root/doris/be/src/pipeline/task_scheduler.cpp:145
     9# doris::ThreadPool::dispatch_thread() in 
/mnt/hdd01/PERFORMANCE_ENV/be/lib/doris_be
    10# doris::Thread::supervise_thread(void*) at 
/root/doris/be/src/util/thread.cpp:499
    11# start_thread at ./nptl/pthread_create.c:442
    12# 0x00007F451E711850 at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:83
    ```
    
    None
    
    ### Check List (For Author)
    
    - Test <!-- At least one of them must be included. -->
        - [ ] Regression test
        - [ ] Unit Test
        - [ ] Manual test (add detailed scripts or steps below)
        - [ ] No need to test or manual test. Explain why:
    - [ ] This is a refactor/code format and no logic has been changed.
            - [ ] Previous test can cover this change.
            - [ ] No code files have been changed.
            - [ ] Other reason <!-- Add your reason?  -->
    
    - Behavior changed:
        - [ ] No.
        - [ ] Yes. <!-- Explain the behavior change -->
    
    - Does this need documentation?
        - [ ] No.
    - [ ] Yes. <!-- Add document PR link here. eg:
    https://github.com/apache/doris-website/pull/1214 -->
    
    ### Check List (For Reviewer who merge this PR)
    
    - [ ] Confirm the release note
    - [ ] Confirm test cases
    - [ ] Confirm document
    - [ ] Add branch pick label <!-- Add branch pick label that this PR
    should merge into -->
---
 .../exec/partitioned_hash_join_sink_operator.cpp   | 47 ++++++++++------------
 1 file changed, 22 insertions(+), 25 deletions(-)

diff --git a/be/src/pipeline/exec/partitioned_hash_join_sink_operator.cpp 
b/be/src/pipeline/exec/partitioned_hash_join_sink_operator.cpp
index 3546818a1a9..9ae263bc5c8 100644
--- a/be/src/pipeline/exec/partitioned_hash_join_sink_operator.cpp
+++ b/be/src/pipeline/exec/partitioned_hash_join_sink_operator.cpp
@@ -517,43 +517,40 @@ Status 
PartitionedHashJoinSinkOperatorX::open(RuntimeState* state) {
 Status 
PartitionedHashJoinSinkOperatorX::_setup_internal_operator(RuntimeState* state) 
{
     auto& local_state = get_local_state(state);
 
-    local_state._shared_state->inner_runtime_state = 
RuntimeState::create_unique(
+    auto inner_runtime_state = RuntimeState::create_unique(
             state->fragment_instance_id(), state->query_id(), 
state->fragment_id(),
             state->query_options(), TQueryGlobals {}, state->exec_env(), 
state->get_query_ctx());
-    
local_state._shared_state->inner_runtime_state->set_task(state->get_task());
-    local_state._shared_state->inner_runtime_state->set_task_execution_context(
-            state->get_task_execution_context().lock());
-    
local_state._shared_state->inner_runtime_state->set_be_number(state->be_number());
+    inner_runtime_state->set_task(state->get_task());
+    
inner_runtime_state->set_task_execution_context(state->get_task_execution_context().lock());
+    inner_runtime_state->set_be_number(state->be_number());
 
-    
local_state._shared_state->inner_runtime_state->set_desc_tbl(&state->desc_tbl());
-    
local_state._shared_state->inner_runtime_state->resize_op_id_to_local_state(-1);
-    local_state._shared_state->inner_runtime_state->set_runtime_filter_mgr(
-            state->local_runtime_filter_mgr());
+    inner_runtime_state->set_desc_tbl(&state->desc_tbl());
+    inner_runtime_state->resize_op_id_to_local_state(-1);
+    
inner_runtime_state->set_runtime_filter_mgr(state->local_runtime_filter_mgr());
 
-    local_state._shared_state->inner_shared_state = 
std::dynamic_pointer_cast<HashJoinSharedState>(
+    auto inner_shared_state = std::dynamic_pointer_cast<HashJoinSharedState>(
             _inner_sink_operator->create_shared_state());
-    LocalSinkStateInfo info {0,  local_state._internal_runtime_profile.get(),
-                             -1, 
local_state._shared_state->inner_shared_state.get(),
-                             {}, {}};
+    LocalSinkStateInfo info {
+            0, local_state._internal_runtime_profile.get(), -1, 
inner_shared_state.get(), {}, {}};
 
-    RETURN_IF_ERROR(_inner_sink_operator->setup_local_state(
-            local_state._shared_state->inner_runtime_state.get(), info));
-    auto* sink_local_state = 
local_state._shared_state->inner_runtime_state->get_sink_local_state();
+    
RETURN_IF_ERROR(_inner_sink_operator->setup_local_state(inner_runtime_state.get(),
 info));
+    auto* sink_local_state = inner_runtime_state->get_sink_local_state();
     DCHECK(sink_local_state != nullptr);
 
-    LocalStateInfo state_info {local_state._internal_runtime_profile.get(),
-                               {},
-                               
local_state._shared_state->inner_shared_state.get(),
-                               {},
-                               0};
+    LocalStateInfo state_info {
+            local_state._internal_runtime_profile.get(), {}, 
inner_shared_state.get(), {}, 0};
 
-    RETURN_IF_ERROR(_inner_probe_operator->setup_local_state(
-            local_state._shared_state->inner_runtime_state.get(), state_info));
-    auto* probe_local_state = 
local_state._shared_state->inner_runtime_state->get_local_state(
-            _inner_probe_operator->operator_id());
+    RETURN_IF_ERROR(
+            
_inner_probe_operator->setup_local_state(inner_runtime_state.get(), 
state_info));
+    auto* probe_local_state =
+            
inner_runtime_state->get_local_state(_inner_probe_operator->operator_id());
     DCHECK(probe_local_state != nullptr);
     RETURN_IF_ERROR(probe_local_state->open(state));
     RETURN_IF_ERROR(sink_local_state->open(state));
+
+    /// Set these two values after all the work is ready.
+    local_state._shared_state->inner_shared_state = 
std::move(inner_shared_state);
+    local_state._shared_state->inner_runtime_state = 
std::move(inner_runtime_state);
     return Status::OK();
 }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to