Skip to content

Conversation

@Gabriel39
Copy link
Contributor

@Gabriel39 Gabriel39 commented Jul 21, 2025

What problem does this PR solve?

==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
#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
#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
#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
#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
#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
#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
#7 0x55795da78d1d in doris::cloud::run_bthread_work(void*) /root/doris/be/src/cloud/cloud_meta_mgr.cpp:74:5
#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)
#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)
#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
#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
#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
#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
#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
#6 0x55795c7787f6 in doris::pipeline::OlapScanLocalState::_sync_cloud_tablets(doris::RuntimeState*) /root/doris/be/src/pipeline/exec/olap_scan_operator.cpp:466:20
#7 0x55795c777e7d in doris::pipeline::OlapScanLocalState::init(doris::RuntimeState*, doris::pipeline::LocalStateInfo&) /root/doris/be/src/pipeline/exec/olap_scan_operator.cpp:51:5
#8 0x55795b459bf9 in doris::pipeline::OperatorXdoris::pipeline::OlapScanLocalState::setup_local_state(doris::RuntimeState*, doris::pipeline::LocalStateInfo&) /root/doris/be/src/pipeline/exec/operator.cpp:486:5
#9 0x55795d9c9a36 in doris::pipeline::PipelineTask::prepare(std::vector<doris::TScanRangeParams, std::allocatordoris::TScanRangeParams> const&, int, doris::TDataSink const&) /root/doris/be/src/pipeline/pipeline_task.cpp:118:9

Check List (For Author)

  • Test

    • 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
  • Behavior changed:

    • No.
    • Yes.
  • Does this need documentation?

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

@Gabriel39
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

TPC-H: Total hot run time: 34212 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 9fd474b47359c6a7eaf505a1b727e7746cbc6054, data reload: false

------ Round 1 ----------------------------------
q1	17641	5237	5098	5098
q2	1934	299	192	192
q3	10285	1321	708	708
q4	10271	999	541	541
q5	8333	2431	2320	2320
q6	227	170	142	142
q7	928	754	628	628
q8	9352	1347	1100	1100
q9	7342	5144	5367	5144
q10	6909	2388	1995	1995
q11	488	306	292	292
q12	362	373	233	233
q13	17778	3648	3053	3053
q14	237	248	241	241
q15	586	514	519	514
q16	434	444	413	413
q17	597	880	361	361
q18	7525	7291	7097	7097
q19	1439	982	584	584
q20	342	357	238	238
q21	3733	2546	2353	2353
q22	1084	1037	965	965
Total cold run time: 107827 ms
Total hot run time: 34212 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5170	5132	5136	5132
q2	258	343	239	239
q3	2196	2708	2273	2273
q4	1324	1791	1347	1347
q5	4348	4429	4444	4429
q6	215	172	135	135
q7	2046	1937	1767	1767
q8	2644	2519	2492	2492
q9	7257	7333	7334	7333
q10	3081	3289	2925	2925
q11	587	532	498	498
q12	717	813	608	608
q13	3641	4003	3398	3398
q14	291	291	309	291
q15	539	491	516	491
q16	446	505	446	446
q17	1219	1758	1435	1435
q18	7962	7776	7635	7635
q19	849	945	940	940
q20	1961	2120	1912	1912
q21	5134	4610	4332	4332
q22	1111	1048	1028	1028
Total cold run time: 52996 ms
Total hot run time: 51086 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 189958 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit 9fd474b47359c6a7eaf505a1b727e7746cbc6054, data reload: false

query1	1017	395	420	395
query2	6561	1729	1743	1729
query3	6756	220	224	220
query4	26367	23399	23140	23140
query5	4509	732	596	596
query6	346	252	226	226
query7	4653	522	308	308
query8	375	348	327	327
query9	8594	2931	2928	2928
query10	538	364	314	314
query11	16173	15027	14817	14817
query12	197	134	128	128
query13	1692	569	461	461
query14	9968	6109	5956	5956
query15	204	204	190	190
query16	7660	628	463	463
query17	1318	723	595	595
query18	2061	429	330	330
query19	216	209	181	181
query20	145	145	132	132
query21	232	145	133	133
query22	4100	4199	4175	4175
query23	34204	33128	33119	33119
query24	8079	2430	2374	2374
query25	554	503	425	425
query26	1252	285	168	168
query27	2722	522	357	357
query28	4391	2215	2159	2159
query29	793	599	466	466
query30	296	234	205	205
query31	984	880	778	778
query32	90	87	86	86
query33	578	394	359	359
query34	807	843	529	529
query35	858	912	824	824
query36	963	1000	928	928
query37	135	116	99	99
query38	4307	4229	4123	4123
query39	1536	1503	1452	1452
query40	233	141	134	134
query41	104	98	98	98
query42	134	126	120	120
query43	537	508	488	488
query44	1388	865	867	865
query45	195	189	179	179
query46	858	1019	645	645
query47	1802	1840	1833	1833
query48	420	443	349	349
query49	818	551	466	466
query50	667	723	433	433
query51	5544	5478	5468	5468
query52	124	123	119	119
query53	252	287	207	207
query54	616	626	548	548
query55	99	97	98	97
query56	369	354	330	330
query57	1212	1245	1164	1164
query58	317	306	313	306
query59	2634	2744	2567	2567
query60	374	371	375	371
query61	154	146	153	146
query62	823	776	682	682
query63	278	221	212	212
query64	4286	1044	739	739
query65	4303	4181	4211	4181
query66	1251	586	503	503
query67	15963	15861	15376	15376
query68	8266	905	555	555
query69	513	351	306	306
query70	1238	1199	1167	1167
query71	503	360	344	344
query72	5668	4753	4886	4753
query73	732	658	373	373
query74	8941	9337	8697	8697
query75	3917	3189	2711	2711
query76	3723	1149	733	733
query77	847	455	383	383
query78	10077	10248	9311	9311
query79	2188	965	599	599
query80	649	591	563	563
query81	493	277	241	241
query82	445	152	113	113
query83	281	282	280	280
query84	253	119	102	102
query85	810	396	357	357
query86	376	314	291	291
query87	4538	4534	4415	4415
query88	3449	2391	2325	2325
query89	406	337	311	311
query90	1998	232	235	232
query91	156	153	128	128
query92	93	87	80	80
query93	1412	953	601	601
query94	703	423	311	311
query95	405	335	322	322
query96	502	590	292	292
query97	2731	2770	2711	2711
query98	256	232	224	224
query99	1366	1477	1306	1306
Total cold run time: 279921 ms
Total hot run time: 189958 ms

@doris-robot
Copy link

ClickBench: Total hot run time: 33.19 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 9fd474b47359c6a7eaf505a1b727e7746cbc6054, data reload: false

query1	0.04	0.04	0.04
query2	0.08	0.04	0.05
query3	0.25	0.08	0.07
query4	1.62	0.11	0.11
query5	0.43	0.42	0.43
query6	1.18	0.64	0.67
query7	0.02	0.02	0.02
query8	0.05	0.04	0.04
query9	0.59	0.53	0.53
query10	0.59	0.57	0.58
query11	0.16	0.12	0.12
query12	0.16	0.12	0.12
query13	0.63	0.62	0.61
query14	0.81	0.82	0.82
query15	0.89	0.88	0.89
query16	0.39	0.40	0.41
query17	1.05	1.11	1.13
query18	0.23	0.21	0.21
query19	2.06	1.86	1.89
query20	0.01	0.01	0.01
query21	15.36	0.86	0.53
query22	0.78	1.03	0.73
query23	15.10	1.39	0.64
query24	7.01	1.47	0.97
query25	0.50	0.18	0.22
query26	0.52	0.16	0.15
query27	0.05	0.05	0.06
query28	10.06	0.93	0.44
query29	12.62	3.89	3.28
query30	3.21	3.11	3.08
query31	2.84	0.60	0.39
query32	3.24	0.55	0.48
query33	3.09	3.12	3.11
query34	15.84	5.43	4.80
query35	4.85	4.81	4.89
query36	0.70	0.52	0.50
query37	0.10	0.08	0.07
query38	0.07	0.05	0.05
query39	0.04	0.04	0.03
query40	0.19	0.16	0.16
query41	0.08	0.04	0.04
query42	0.04	0.04	0.04
query43	0.04	0.04	0.05
Total cold run time: 107.57 s
Total hot run time: 33.19 s

@Gabriel39 Gabriel39 requested a review from w41ter as a code owner July 21, 2025 05:06
@Gabriel39
Copy link
Contributor Author

run buildall

}

Status bthread_fork_join(const std::vector<std::function<Status()>>& tasks, int concurrency,
Status bthread_fork_join(const std::vector<std::function<Status()>>&& tasks, int concurrency,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is modifier const necessary? it seems does not make sense.

@Gabriel39
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

TPC-H: Total hot run time: 34487 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit b8edc3023326c24d4403530f1bc5d6fd2ce66925, data reload: false

------ Round 1 ----------------------------------
q1	17594	5350	5140	5140
q2	1936	292	203	203
q3	10358	1309	720	720
q4	10305	1027	541	541
q5	8648	2423	2402	2402
q6	226	170	142	142
q7	952	799	639	639
q8	9346	1353	1113	1113
q9	7205	5142	5120	5120
q10	6934	2396	1976	1976
q11	506	315	287	287
q12	356	365	232	232
q13	17779	3707	3112	3112
q14	242	240	233	233
q15	602	537	518	518
q16	435	443	415	415
q17	608	880	363	363
q18	7501	7129	7214	7129
q19	1518	979	597	597
q20	345	340	239	239
q21	3896	3192	2366	2366
q22	1068	1061	1000	1000
Total cold run time: 108360 ms
Total hot run time: 34487 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5270	5308	5191	5191
q2	271	346	246	246
q3	2189	2642	2236	2236
q4	1363	1822	1344	1344
q5	4499	4376	4509	4376
q6	214	186	137	137
q7	1989	2038	1798	1798
q8	2628	2580	2536	2536
q9	7280	7208	7392	7208
q10	3109	3332	2956	2956
q11	605	541	515	515
q12	689	782	607	607
q13	3574	3966	3381	3381
q14	285	319	281	281
q15	551	522	510	510
q16	442	540	456	456
q17	1187	1610	1360	1360
q18	7911	7934	7549	7549
q19	880	897	942	897
q20	2042	2275	1894	1894
q21	5014	4716	4510	4510
q22	1116	1053	1016	1016
Total cold run time: 53108 ms
Total hot run time: 51004 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 191479 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit b8edc3023326c24d4403530f1bc5d6fd2ce66925, data reload: false

query1	1018	399	427	399
query2	6604	1767	1694	1694
query3	6755	227	228	227
query4	26880	23948	23488	23488
query5	4485	730	592	592
query6	331	221	213	213
query7	4648	518	311	311
query8	358	314	291	291
query9	8553	2908	2912	2908
query10	505	378	310	310
query11	16073	15201	14793	14793
query12	181	132	130	130
query13	1701	598	458	458
query14	8756	6222	6205	6205
query15	233	203	183	183
query16	7544	658	480	480
query17	1261	771	634	634
query18	2020	435	332	332
query19	214	193	171	171
query20	139	136	134	134
query21	230	141	128	128
query22	4151	4303	4168	4168
query23	34320	33379	33296	33296
query24	8168	2392	2399	2392
query25	570	495	423	423
query26	1230	278	165	165
query27	2718	536	362	362
query28	4353	2205	2188	2188
query29	776	603	482	482
query30	318	237	205	205
query31	961	911	797	797
query32	100	92	83	83
query33	591	412	369	369
query34	813	872	539	539
query35	826	827	779	779
query36	1031	1033	940	940
query37	135	119	102	102
query38	4118	4244	4104	4104
query39	1536	1495	1468	1468
query40	246	156	140	140
query41	117	107	106	106
query42	139	123	127	123
query43	507	520	497	497
query44	1407	890	876	876
query45	194	183	182	182
query46	869	1027	675	675
query47	1800	1875	1783	1783
query48	408	470	336	336
query49	825	595	506	506
query50	667	716	448	448
query51	5638	5527	5517	5517
query52	126	124	112	112
query53	261	280	220	220
query54	636	620	572	572
query55	99	99	99	99
query56	365	359	346	346
query57	1219	1251	1166	1166
query58	325	314	311	311
query59	2573	2689	2506	2506
query60	391	389	367	367
query61	154	151	156	151
query62	805	727	691	691
query63	284	222	215	215
query64	4393	1056	755	755
query65	4287	4202	4178	4178
query66	1333	640	540	540
query67	15836	15717	15587	15587
query68	8019	920	550	550
query69	511	341	372	341
query70	1295	1184	1217	1184
query71	478	352	342	342
query72	5593	4822	4844	4822
query73	760	687	381	381
query74	9054	9184	8907	8907
query75	3907	3145	2727	2727
query76	3658	1155	766	766
query77	858	467	392	392
query78	10134	10135	9385	9385
query79	3250	833	596	596
query80	692	588	526	526
query81	503	285	235	235
query82	472	154	119	119
query83	311	279	274	274
query84	300	113	99	99
query85	811	395	365	365
query86	369	333	324	324
query87	4453	4526	4296	4296
query88	3249	2427	2406	2406
query89	468	331	305	305
query90	1956	242	252	242
query91	157	163	132	132
query92	96	85	80	80
query93	1889	952	596	596
query94	739	407	319	319
query95	415	336	335	335
query96	511	598	292	292
query97	2747	2769	2690	2690
query98	260	232	233	232
query99	1508	1416	1271	1271
Total cold run time: 280531 ms
Total hot run time: 191479 ms

@doris-robot
Copy link

ClickBench: Total hot run time: 32.78 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit b8edc3023326c24d4403530f1bc5d6fd2ce66925, data reload: false

query1	0.05	0.03	0.03
query2	0.08	0.04	0.05
query3	0.26	0.07	0.07
query4	1.62	0.12	0.11
query5	0.43	0.43	0.42
query6	1.17	0.65	0.68
query7	0.02	0.02	0.02
query8	0.05	0.04	0.04
query9	0.60	0.52	0.51
query10	0.59	0.56	0.57
query11	0.16	0.12	0.11
query12	0.15	0.13	0.12
query13	0.65	0.62	0.61
query14	0.80	0.81	0.85
query15	0.90	0.88	0.86
query16	0.40	0.38	0.39
query17	1.09	1.04	1.06
query18	0.24	0.21	0.21
query19	2.04	1.87	1.96
query20	0.02	0.01	0.02
query21	15.35	0.90	0.54
query22	0.80	1.21	0.68
query23	14.88	1.37	0.62
query24	6.66	1.60	0.74
query25	0.47	0.18	0.15
query26	0.60	0.17	0.14
query27	0.08	0.05	0.06
query28	9.91	0.94	0.44
query29	12.57	3.90	3.25
query30	3.15	3.16	3.07
query31	2.82	0.59	0.40
query32	3.24	0.55	0.48
query33	3.07	3.16	3.13
query34	15.76	5.47	4.85
query35	4.89	4.86	4.89
query36	0.68	0.52	0.49
query37	0.10	0.07	0.08
query38	0.07	0.05	0.05
query39	0.04	0.03	0.03
query40	0.19	0.16	0.15
query41	0.09	0.04	0.04
query42	0.04	0.03	0.03
query43	0.05	0.05	0.05
Total cold run time: 106.83 s
Total hot run time: 32.78 s

@github-actions
Copy link
Contributor

PR approved by at least one committer and no changes requested.

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Jul 21, 2025
@github-actions
Copy link
Contributor

PR approved by anyone and no changes requested.

@doris-robot
Copy link

BE UT Coverage Report

Increment line coverage 28.57% (2/7) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 57.45% (15896/27670)
Line Coverage 46.25% (142833/308812)
Region Coverage 35.75% (107651/301108)
Branch Coverage 38.22% (47471/124206)

@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100.00% (7/7) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 81.06% (22012/27154)
Line Coverage 73.69% (227217/308346)
Region Coverage 61.36% (189512/308837)
Branch Coverage 65.04% (81685/125598)

@Gabriel39 Gabriel39 merged commit 9a6a412 into apache:master Jul 22, 2025
25 of 28 checks passed
@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100.00% (7/7) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 81.06% (22012/27154)
Line Coverage 73.69% (227217/308346)
Region Coverage 61.36% (189512/308837)
Branch Coverage 65.04% (81685/125598)

Gabriel39 added a commit to Gabriel39/incubator-doris that referenced this pull request Jul 22, 2025
==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:9
morrySnow pushed a commit that referenced this pull request Jul 23, 2025
…52879 #53605 (#53416)

pick #52879 #53605

With cloud mode on, remote tablets will be loaded into local storage
before execution. This will block execution thread now. If it's too
slow, pipeline execution thread may hang.
This PR makes remote tablets loading asynchronously.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. dev/3.1.0-merged reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants