Skip to content

Conversation

@github-actions
Copy link
Contributor

Cherry-picked from #47860

…7860)

Related PR: #47610

Problem Summary:
SIGSEGV address not mapped to object (@0x0) received by PID 340906 (TID
341622 OR 0x7f7f38784640) from PID 0; stack trace: ***
0# doris::signal::(anonymous namespace)::FailureSignalHandler(int,
siginfo_t*, void*) at
/home/zcp/repo_center/doris_branch-3.0/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# 0x00007F80B37D0520 in /lib/x86_64-linux-gnu/libc.so.6
4# doris::MemTableWriter::_flush_memtable_async() at
/home/zcp/repo_center/doris_branch-3.0/doris/be/src/olap/memtable_writer.cpp:157
5# doris::MemTableWriter::flush_async() at
/home/zcp/repo_center/doris_branch-3.0/doris/be/src/olap/memtable_writer.cpp:187
6# doris::MemTableMemoryLimiter::_flush_active_memtables(long) at
/home/zcp/repo_center/doris_branch-3.0/doris/be/src/olap/memtable_memory_limiter.cpp:190
7# doris::MemTableMemoryLimiter::handle_memtable_flush() at
/home/zcp/repo_center/doris_branch-3.0/doris/be/src/olap/memtable_memory_limiter.cpp:144
8# doris::LoadChannelMgr::add_batch(doris::PTabletWriterAddBlockRequest
const&, doris::PTabletWriterAddBlockResult*) at
/home/zcp/repo_center/doris_branch-3.0/doris/be/src/runtime/load_channel_mgr.cpp:154
9# std::_Function_handler<void (),
doris::PInternalService::tablet_writer_add_block(google::protobuf::RpcController*,
doris::PTabletWriterAddBlockRequest const*,
doris::PTabletWriterAddBlockResult*,
google::protobuf::Closure*)::$_0>::_M_invoke(std::_Any_data const&) at
/var/local/ldb-toolchain/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/std_function.h:291
10# doris::WorkThreadPool<false>::work_thread(int) at
/home/zcp/repo_center/doris_branch-3.0/doris/be/src/util/work_thread_pool.hpp:159
11# execute_native_thread_routine at
../../../../../libstdc++-v3/src/c++11/thread.cc:84
12# start_thread at ./nptl/pthread_create.c:442
13# 0x00007F80B38B4850 at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:83

This PR addresses potential null pointer dereference crashes that could
occur when write operations fail and the memtable is reset. The changes
add defensive null checks to ensure safe handling of the _mem_table
state during flush memtable.
@Thearas
Copy link
Contributor

Thearas commented Feb 13, 2025

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@dataroaring dataroaring reopened this Feb 13, 2025
@Thearas
Copy link
Contributor

Thearas commented Feb 13, 2025

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17604	7370	7239	7239
q2	2050	170	165	165
q3	10621	1100	1164	1100
q4	10505	793	715	715
q5	7745	2840	2845	2840
q6	239	156	152	152
q7	984	633	620	620
q8	9413	2047	2106	2047
q9	6662	6467	6482	6467
q10	7079	2312	2354	2312
q11	474	262	265	262
q12	402	212	215	212
q13	17795	3010	3044	3010
q14	248	204	212	204
q15	559	515	528	515
q16	656	586	580	580
q17	975	534	573	534
q18	7251	6724	6652	6652
q19	1408	1061	1111	1061
q20	495	204	201	201
q21	4021	3365	3226	3226
q22	1123	992	998	992
Total cold run time: 108309 ms
Total hot run time: 41106 ms

----- Round 2, with runtime_filter_mode=off -----
q1	7231	7205	7173	7173
q2	330	237	228	228
q3	2958	2939	2992	2939
q4	2063	1766	1783	1766
q5	5721	5738	5716	5716
q6	222	145	151	145
q7	2249	1786	1821	1786
q8	3339	3564	3540	3540
q9	8825	8905	8853	8853
q10	3618	3589	3581	3581
q11	618	519	492	492
q12	820	619	618	618
q13	10229	3152	3130	3130
q14	322	278	279	278
q15	581	534	529	529
q16	684	651	663	651
q17	1831	1649	1614	1614
q18	8236	7763	7630	7630
q19	1667	1569	1492	1492
q20	2146	1877	1892	1877
q21	5456	5443	5251	5251
q22	1128	1064	1019	1019
Total cold run time: 70274 ms
Total hot run time: 60308 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 199326 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 fa39bcb77b868394402946b2d935ba9d89f03a76, data reload: false

query1	1291	919	895	895
query2	6254	2153	2103	2103
query3	10980	4468	4408	4408
query4	62138	29336	23572	23572
query5	5120	480	481	480
query6	408	185	189	185
query7	5458	316	316	316
query8	320	227	227	227
query9	8604	2716	2739	2716
query10	459	275	265	265
query11	17933	15327	15831	15327
query12	160	108	111	108
query13	1422	469	451	451
query14	10836	7062	7347	7062
query15	201	183	185	183
query16	7240	477	492	477
query17	1179	598	576	576
query18	1860	309	307	307
query19	211	156	157	156
query20	119	107	108	107
query21	207	102	102	102
query22	4534	4645	4638	4638
query23	34971	34165	34221	34165
query24	6167	2969	2973	2969
query25	523	408	413	408
query26	661	178	179	178
query27	1803	351	369	351
query28	4056	2481	2470	2470
query29	704	452	463	452
query30	250	173	168	168
query31	998	836	826	826
query32	71	60	59	59
query33	456	307	302	302
query34	941	516	525	516
query35	889	764	743	743
query36	1081	987	989	987
query37	124	81	77	77
query38	4101	4194	4078	4078
query39	1529	1662	1459	1459
query40	217	104	108	104
query41	51	53	53	53
query42	119	103	103	103
query43	553	519	509	509
query44	1238	865	845	845
query45	193	173	173	173
query46	1154	758	727	727
query47	2042	1921	1920	1920
query48	486	398	386	386
query49	736	436	404	404
query50	857	444	435	435
query51	7312	7112	7257	7112
query52	105	98	94	94
query53	275	195	197	195
query54	607	477	485	477
query55	82	80	81	80
query56	276	266	280	266
query57	1296	1203	1170	1170
query58	222	203	211	203
query59	3391	3062	3028	3028
query60	268	250	256	250
query61	107	120	124	120
query62	848	737	736	736
query63	212	187	189	187
query64	1361	668	633	633
query65	3279	3210	3199	3199
query66	696	306	302	302
query67	15889	15648	15554	15554
query68	4039	583	579	579
query69	436	267	269	267
query70	1204	1076	1105	1076
query71	378	263	265	263
query72	6371	4040	3993	3993
query73	753	347	360	347
query74	10135	9404	9349	9349
query75	3331	2662	2691	2662
query76	1892	1012	1003	1003
query77	479	283	274	274
query78	10627	9643	9617	9617
query79	1335	609	614	609
query80	868	466	440	440
query81	521	244	241	241
query82	1311	119	119	119
query83	242	145	150	145
query84	292	84	78	78
query85	898	339	295	295
query86	349	295	297	295
query87	4487	4440	4293	4293
query88	3716	2398	2361	2361
query89	430	306	300	300
query90	2013	192	195	192
query91	184	150	146	146
query92	62	55	53	53
query93	1694	555	552	552
query94	761	305	305	305
query95	344	270	266	266
query96	611	282	282	282
query97	3275	3188	3167	3167
query98	218	202	199	199
query99	2056	1424	1458	1424
Total cold run time: 315443 ms
Total hot run time: 199326 ms

@doris-robot
Copy link

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

query1	0.04	0.03	0.03
query2	0.07	0.03	0.02
query3	0.23	0.07	0.06
query4	1.62	0.10	0.10
query5	0.52	0.52	0.52
query6	1.14	0.72	0.72
query7	0.03	0.02	0.02
query8	0.04	0.03	0.04
query9	0.58	0.51	0.49
query10	0.56	0.54	0.55
query11	0.14	0.09	0.11
query12	0.15	0.12	0.11
query13	0.61	0.61	0.60
query14	2.76	2.74	2.83
query15	0.90	0.82	0.83
query16	0.39	0.38	0.37
query17	0.99	1.06	1.07
query18	0.25	0.22	0.23
query19	1.82	1.72	2.07
query20	0.01	0.01	0.01
query21	15.36	0.57	0.57
query22	2.91	1.91	1.84
query23	16.96	1.01	0.83
query24	2.62	1.23	0.66
query25	0.22	0.07	0.05
query26	0.53	0.13	0.13
query27	0.04	0.04	0.03
query28	11.17	1.10	1.07
query29	12.57	3.28	3.27
query30	0.25	0.06	0.06
query31	2.87	0.39	0.37
query32	3.27	0.45	0.46
query33	2.96	3.01	3.04
query34	17.12	4.57	4.50
query35	4.60	4.46	4.60
query36	0.65	0.48	0.49
query37	0.09	0.06	0.07
query38	0.05	0.04	0.03
query39	0.03	0.02	0.02
query40	0.17	0.12	0.12
query41	0.07	0.02	0.02
query42	0.04	0.02	0.02
query43	0.03	0.03	0.03
Total cold run time: 107.43 s
Total hot run time: 32.35 s

Copy link
Contributor

@dataroaring dataroaring left a comment

Choose a reason for hiding this comment

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

LGTM

@dataroaring dataroaring merged commit b5896dd into branch-3.0 Feb 13, 2025
21 of 24 checks passed
@github-actions github-actions bot deleted the auto-pick-47860-branch-3.0 branch February 13, 2025 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants