github-actions[bot] commented on code in PR #62155:
URL: https://github.com/apache/doris/pull/62155#discussion_r3044364526
##########
be/src/exec/pipeline/pipeline_task.cpp:
##########
@@ -1048,6 +1048,13 @@ Status PipelineTask::wake_up(Dependency* dep,
std::unique_lock<std::mutex>& /* d
// call by dependency
DCHECK_EQ(_blocked_dep, dep) << "dep : " << dep->debug_string(0) << "task:
" << debug_string();
_blocked_dep = nullptr;
+ // When _wake_up_early is set, a delayed wake_up() can arrive after the
task has already
+ // terminated. We must not transition state or resubmit: finalize() has
already cleared
+ // _sink/_operators, and submit() would dereference them (e.g. via
is_blockable()) causing SIGSEGV.
+ // _state_transition() would also incorrectly update the profile's
TaskState to RUNNABLE.
+ if (_exec_state == State::FINISHED || _exec_state == State::FINALIZED) {
Review Comment:
This check only covers the steady-state case. There is still a TOCTOU window
between this load of `_exec_state` and `submit(holder)`: another thread can run
`close()`/`finalize()` in that gap, set the task to `FINALIZED`, clear
`_sink/_operators`, and then `HybridTaskScheduler::submit()` will still call
`task->is_blockable()`, which dereferences `_sink` without synchronization. So
the original SIGSEGV is still reachable if `Dependency::set_ready()` races with
teardown; the new unit test does not cover this interleaving. Please harden the
submit/is_blockable path or add synchronization that spans the finalized check
through scheduler submission.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]