Commit 8ddc32a
committed
[fix](cloud) Fix lifecycle in lambda function (apache#53605)
==15185==ERROR: AddressSanitizer: heap-use-after-free on address
0x7da44ced96d0 at pc 0x55795dac5f46 bp 0x7bc26b9a3e50 sp 0x7bc26b9a3e48
READ of size 8 at 0x7da44ced96d0 thread T1357
#0 0x55795dac5f45 in std::_Function_base::_M_empty() const
/usr/local/ldb-toolchain-v0.25/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/std_function.h:249:37
apache#1 0x55795dac5f45 in std::function<doris::Status ()>::operator()() const
/usr/local/ldb-toolchain-v0.25/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/std_function.h:591:6
apache#2 0x55795dac5f45 in
doris::cloud::bthread_fork_join(std::vector<std::function<doris::Status
()>, std::allocator<std::function<doris::Status ()>>> const&,
int)::$_0::operator()() const
/root/doris/be/src/cloud/cloud_meta_mgr.cpp:106:23
apache#3 0x55795dac5f45 in void std::_invoke_impl<void,
doris::cloud::bthread_fork_join(std::vector<std::function<doris::Status
()>, std::allocator<std::function<doris::Status ()>>> const&,
int)::$_0&>(std::_invoke_other,
doris::cloud::bthread_fork_join(std::vector<std::function<doris::Status
()>, std::allocator<std::function<doris::Status ()>>> const&,
int)::$_0&)
/usr/local/ldb-toolchain-v0.25/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/invoke.h:63:14
apache#4 0x55795dac5f45 in std::enable_if<is_invocable_r_v<void,
doris::cloud::bthread_fork_join(std::vector<std::function<doris::Status
()>, std::allocator<std::function<doris::Status ()>>> const&,
int)::$0&>, void>::type std::_invoke_r<void,
doris::cloud::bthread_fork_join(std::vector<std::function<doris::Status
()>, std::allocator<std::function<doris::Status ()>>> const&,
int)::$_0&>(doris::cloud::bthread_fork_join(std::vector<std::function<doris::Status
()>, std::allocator<std::function<doris::Status ()>>> const&,
int)::$_0&)
/usr/local/ldb-toolchain-v0.25/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/invoke.h:113:2
apache#5 0x55795dac5f45 in std::_Function_handler<void (),
doris::cloud::bthread_fork_join(std::vector<std::function<doris::Status
()>, std::allocator<std::function<doris::Status ()>>> const&,
int)::$_0>::_M_invoke(std::_Any_data const&)
/usr/local/ldb-toolchain-v0.25/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/std_function.h:292:9
apache#6 0x55795da78d1d in std::function<void ()>::operator()() const
/usr/local/ldb-toolchain-v0.25/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/std_function.h:593:9
apache#7 0x55795da78d1d in doris::cloud::run_bthread_work(void*)
/root/doris/be/src/cloud/cloud_meta_mgr.cpp:74:5
apache#8 0x55795f3da334 in bthread::TaskGroup::task_runner(long)
(/home/work/unlimit_teamcity/TeamCity/Agents/20250718121603agent_172.16.0.202_1/work/60183217f6ee2a9c/output/be/lib/doris_be+0x50a4e334)
apache#9 0x55795f3ccc80 in bthread_make_fcontext
(/home/work/unlimit_teamcity/TeamCity/Agents/20250718121603agent_172.16.0.202_1/work/60183217f6ee2a9c/output/be/lib/doris_be+0x50a40c80)
0x7da44ced96d0 is located 2640 bytes inside of 2688-byte region
[0x7da44ced8c80,0x7da44ced9700)
freed by thread T1431 here:
#0 0x5579380e1f12 in operator delete(void*, unsigned long)
(/home/work/unlimit_teamcity/TeamCity/Agents/20250718121603agent_172.16.0.202_1/work/60183217f6ee2a9c/output/be/lib/doris_be+0x29755f12)
previously allocated by thread T795 (brpc_light) here:
#0 0x5579380e12ad in operator new(unsigned long)
(/home/work/unlimit_teamcity/TeamCity/Agents/20250718121603agent_172.16.0.202_1/work/60183217f6ee2a9c/output/be/lib/doris_be+0x297552ad)
apache#1 0x55795c7b57ab in std::__new_allocator<std::function<doris::Status
()>>::allocate(unsigned long, void const*)
/usr/local/ldb-toolchain-v0.25/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/new_allocator.h:151:27
apache#2 0x55795c7b57ab in std::allocator<std::function<doris::Status
()>>::allocate(unsigned long)
/usr/local/ldb-toolchain-v0.25/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/allocator.h:203:32
apache#3 0x55795c7b57ab in
std::allocator_traits<std::allocator<std::function<doris::Status
()>>>::allocate(std::allocator<std::function<doris::Status ()>>&,
unsigned long)
/usr/local/ldb-toolchain-v0.25/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/alloc_traits.h:614:20
apache#4 0x55795c7b57ab in std::_Vector_base<std::function<doris::Status ()>,
std::allocator<std::function<doris::Status ()>>>::_M_allocate(unsigned
long)
/usr/local/ldb-toolchain-v0.25/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/stl_vector.h:387:20
apache#5 0x55795c7b57ab in std::vector<std::function<doris::Status ()>,
std::allocator<std::function<doris::Status ()>>>::reserve(unsigned long)
/usr/local/ldb-toolchain-v0.25/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/vector.tcc:79:22
apache#6 0x55795c7787f6 in
doris::pipeline::OlapScanLocalState::_sync_cloud_tablets(doris::RuntimeState*)
/root/doris/be/src/pipeline/exec/olap_scan_operator.cpp:466:20
apache#7 0x55795c777e7d in
doris::pipeline::OlapScanLocalState::init(doris::RuntimeState*,
doris::pipeline::LocalStateInfo&)
/root/doris/be/src/pipeline/exec/olap_scan_operator.cpp:51:5
apache#8 0x55795b459bf9 in
doris::pipeline::OperatorX<doris::pipeline::OlapScanLocalState>::setup_local_state(doris::RuntimeState*,
doris::pipeline::LocalStateInfo&)
/root/doris/be/src/pipeline/exec/operator.cpp:486:5
apache#9 0x55795d9c9a36 in
doris::pipeline::PipelineTask::prepare(std::vector<doris::TScanRangeParams,
std::allocator<doris::TScanRangeParams>> const&, int, doris::TDataSink
const&) /root/doris/be/src/pipeline/pipeline_task.cpp:118:91 parent 0e63e36 commit 8ddc32a
File tree
5 files changed
+13
-11
lines changed- be
- src
- cloud
- pipeline/exec
- test/cloud
5 files changed
+13
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
135 | | - | |
| 135 | + | |
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | | - | |
141 | | - | |
| 140 | + | |
| 141 | + | |
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
466 | 466 | | |
467 | 467 | | |
468 | 468 | | |
469 | | - | |
| 469 | + | |
470 | 470 | | |
471 | 471 | | |
472 | 472 | | |
| |||
475 | 475 | | |
476 | 476 | | |
477 | 477 | | |
478 | | - | |
| 478 | + | |
479 | 479 | | |
480 | 480 | | |
481 | 481 | | |
| |||
497 | 497 | | |
498 | 498 | | |
499 | 499 | | |
500 | | - | |
501 | | - | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
502 | 503 | | |
503 | 504 | | |
504 | 505 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | | - | |
106 | 105 | | |
107 | 106 | | |
108 | 107 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
| 56 | + | |
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
| |||
74 | 75 | | |
75 | 76 | | |
76 | 77 | | |
77 | | - | |
| 78 | + | |
| 79 | + | |
78 | 80 | | |
79 | 81 | | |
80 | 82 | | |
| |||
0 commit comments