Skip to content

Conversation

@xinyiZzz
Copy link
Contributor

@xinyiZzz xinyiZzz commented May 28, 2024

Proposed changes

Revert #13660

-l and dlopen load Dynamic Link Library, will use the Allocator of main program, Doris use Jemalloc by default.

but, dlopen load libjvm.so and use Jemalloc compiled with prefix, overwriting malloc/free will incompatible with libjvm.so. see #34578 for details.

In addition, jemalloc not recommend dlopen to load Dynamic Link Library, dlclose will memory leak in that case.
jemalloc/jemalloc#2404
jemalloc/jemalloc#1321
jemalloc/jemalloc#1890

export LD_PRELOAD to force libjvm.so use a separate jemalloc.so will not solve the problem, but may cause a new crash.

received by PID 2368 (TID 2391 OR 0x7f445cafb700) from PID 0; stack trace: ***
 0# doris::signal::(anonymous namespace)::FailureSignalHandler(int, siginfo_t*, void*) at /root/selectdb-core/be/src/common/signal_handler.h:421
 1# PosixSignals::chained_handler(int, siginfo*, void*) [clone .part.0] in /opt/jdk/lib/server/libjvm.so
 2# JVM_handle_linux_signal in /opt/jdk/lib/server/libjvm.so
 3# 0x00007F448DB40400 in /lib64/libc.so.6
 4# je_arena_dalloc_promoted at /root/selectdb-core/thirdparty/src/jemalloc-5.3.0/doris_build/../src/arena.c:1277
 5# je_free_default at /root/selectdb-core/thirdparty/src/jemalloc-5.3.0/doris_build/../src/jemalloc.c:3014
 6# __pthread_create_2_1 in /lib64/libpthread.so.0
 7# os::create_thread(Thread*, os::ThreadType, unsigned long) in /opt/jdk/lib/server/libjvm.so
 8# CompilerThread::CompilerThread(CompileQueue*, CompilerCounters*) in /opt/jdk/lib/server/libjvm.so
 9# CompileBroker::make_thread(CompileBroker::ThreadType, _jobject*, CompileQueue*, AbstractCompiler*, JavaThread*) [clone .constprop.0] in /opt/jdk/lib/server/libjvm.so
10# CompileBroker::possibly_add_compiler_threads(JavaThread*) in /opt/jdk/lib/server/libjvm.so
11# CompileBroker::compiler_thread_loop() in /opt/jdk/lib/server/libjvm.so
12# JavaThread::thread_main_inner() in /opt/jdk/lib/server/libjvm.so
13# Thread::call_run() in /opt/jdk/lib/server/libjvm.so
14# thread_native_entry(Thread*) in /opt/jdk/lib/server/libjvm.so
15# start_thread in /lib64/libpthread.so.0
16# clone in /lib64/libc.so.6

@doris-robot
Copy link

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

Since 2024-03-18, the Document has been moved to doris-website.
See Doris Document.

@xinyiZzz
Copy link
Contributor Author

run buildall

@github-actions
Copy link
Contributor

sh-checker report

To get the full details, please check in the job output.

shellcheck errors
'shellcheck ' found no issues.

shfmt errors

'shfmt ' returned error 1 finding the following formatting issues:

----------
--- bin/check_be_version.sh.orig
+++ bin/check_be_version.sh
@@ -91,4 +91,3 @@
 chmod 755 "${DORIS_HOME}/lib/doris_be"
 
 "${DORIS_HOME}"/lib/doris_be --version
-
--- tools/find_libjvm.sh.orig
+++ tools/find_libjvm.sh
----------

You can reformat the above files to meet shfmt's requirements by typing:

  shfmt  -w filename


@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17633	4325	4256	4256
q2	2032	202	189	189
q3	10546	1256	1169	1169
q4	10491	839	788	788
q5	7958	2711	2688	2688
q6	222	134	137	134
q7	973	615	619	615
q8	9616	2108	2086	2086
q9	9203	6637	6592	6592
q10	9482	3626	3720	3626
q11	447	253	240	240
q12	440	219	221	219
q13	17772	2990	2992	2990
q14	257	223	216	216
q15	515	467	467	467
q16	498	376	380	376
q17	968	674	727	674
q18	8209	7474	7402	7402
q19	4058	1528	1519	1519
q20	633	300	311	300
q21	5023	3885	3248	3248
q22	342	284	279	279
Total cold run time: 117318 ms
Total hot run time: 40073 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4341	4242	4259	4242
q2	370	257	267	257
q3	3001	2771	2696	2696
q4	1873	1586	1568	1568
q5	5262	5311	5300	5300
q6	209	124	126	124
q7	2140	1752	1742	1742
q8	3243	3321	3337	3321
q9	8327	8347	8358	8347
q10	3845	3698	3691	3691
q11	588	508	482	482
q12	781	626	586	586
q13	16329	3006	2993	2993
q14	307	259	255	255
q15	512	474	486	474
q16	482	417	422	417
q17	1774	1504	1469	1469
q18	7565	7578	7400	7400
q19	1656	1560	1583	1560
q20	1979	1785	1794	1785
q21	4941	4759	4774	4759
q22	590	493	492	492
Total cold run time: 70115 ms
Total hot run time: 53960 ms

@xinyiZzz xinyiZzz force-pushed the 20240520_fix_jemalloc_jvm branch from b1ec79d to f5a35d0 Compare May 28, 2024 14:36
@github-actions
Copy link
Contributor

sh-checker report

To get the full details, please check in the job output.

shellcheck errors
'shellcheck ' found no issues.

shfmt errors

'shfmt ' returned error 1 finding the following formatting issues:

----------
--- tools/find_libjvm.sh.orig
+++ tools/find_libjvm.sh
----------

You can reformat the above files to meet shfmt's requirements by typing:

  shfmt  -w filename


@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@doris-robot
Copy link

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

query1	925	385	369	369
query2	6482	2489	2381	2381
query3	6652	212	211	211
query4	19356	17250	17457	17250
query5	4130	422	448	422
query6	251	163	151	151
query7	4588	313	309	309
query8	258	208	189	189
query9	8630	2446	2462	2446
query10	455	278	269	269
query11	10667	10230	10008	10008
query12	137	92	88	88
query13	1639	373	366	366
query14	10228	6028	7602	6028
query15	239	166	172	166
query16	7967	269	266	266
query17	1842	529	519	519
query18	2026	276	276	276
query19	203	165	156	156
query20	94	88	92	88
query21	229	129	127	127
query22	4117	4020	3888	3888
query23	33844	33158	33064	33064
query24	12118	2823	2797	2797
query25	664	353	370	353
query26	1819	167	160	160
query27	2937	324	330	324
query28	7422	2110	2116	2110
query29	1117	640	624	624
query30	303	150	154	150
query31	999	759	752	752
query32	88	55	61	55
query33	797	270	265	265
query34	995	488	495	488
query35	748	622	593	593
query36	1084	902	916	902
query37	268	69	68	68
query38	2926	2757	2751	2751
query39	863	799	787	787
query40	276	128	127	127
query41	50	45	44	44
query42	108	97	98	97
query43	588	560	549	549
query44	1279	735	762	735
query45	176	167	164	164
query46	1065	756	712	712
query47	1856	1755	1765	1755
query48	366	299	307	299
query49	1209	379	390	379
query50	774	386	398	386
query51	6949	6825	6737	6737
query52	106	94	95	94
query53	357	290	335	290
query54	887	448	433	433
query55	74	73	72	72
query56	258	262	271	262
query57	1160	1061	1053	1053
query58	239	234	236	234
query59	3431	3008	3124	3008
query60	285	263	264	263
query61	92	90	90	90
query62	656	450	471	450
query63	316	289	289	289
query64	9812	2254	1732	1732
query65	3234	3132	3149	3132
query66	1380	337	328	328
query67	15148	14935	14794	14794
query68	4626	560	565	560
query69	442	278	272	272
query70	1122	1121	1158	1121
query71	418	280	278	278
query72	7629	5680	5461	5461
query73	726	334	330	330
query74	6039	5666	5624	5624
query75	3496	2670	2642	2642
query76	2809	1043	976	976
query77	436	275	279	275
query78	10203	9906	9844	9844
query79	2091	525	517	517
query80	1256	450	451	450
query81	534	225	225	225
query82	625	89	95	89
query83	245	172	172	172
query84	242	92	85	85
query85	1911	256	265	256
query86	512	296	322	296
query87	3285	3133	3081	3081
query88	4504	2454	2427	2427
query89	465	388	391	388
query90	2087	196	193	193
query91	130	112	98	98
query92	59	52	54	52
query93	2155	535	516	516
query94	1257	204	203	203
query95	411	396	326	326
query96	587	272	270	270
query97	3186	2997	2982	2982
query98	246	230	218	218
query99	1171	848	889	848
Total cold run time: 277143 ms
Total hot run time: 171799 ms

@doris-robot
Copy link

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

query1	0.04	0.03	0.04
query2	0.07	0.04	0.04
query3	0.24	0.06	0.06
query4	1.66	0.08	0.07
query5	0.51	0.47	0.51
query6	1.11	0.72	0.72
query7	0.03	0.02	0.01
query8	0.06	0.04	0.05
query9	0.54	0.50	0.47
query10	0.53	0.55	0.56
query11	0.16	0.11	0.12
query12	0.14	0.12	0.12
query13	0.60	0.59	0.61
query14	0.78	0.80	0.78
query15	0.83	0.81	0.81
query16	0.37	0.37	0.36
query17	1.01	0.95	0.95
query18	0.22	0.24	0.24
query19	1.91	1.75	1.81
query20	0.01	0.01	0.01
query21	15.55	0.69	0.66
query22	4.59	8.00	1.49
query23	18.30	1.36	1.30
query24	1.58	0.34	0.22
query25	0.13	0.10	0.08
query26	0.27	0.17	0.16
query27	0.08	0.08	0.08
query28	13.26	1.03	1.00
query29	13.15	3.28	3.34
query30	0.23	0.07	0.06
query31	2.85	0.39	0.38
query32	3.29	0.48	0.48
query33	2.92	2.84	2.93
query34	17.18	4.38	4.44
query35	4.48	4.50	4.51
query36	0.64	0.49	0.49
query37	0.18	0.15	0.16
query38	0.16	0.15	0.15
query39	0.05	0.04	0.04
query40	0.16	0.14	0.15
query41	0.09	0.05	0.05
query42	0.05	0.05	0.05
query43	0.05	0.04	0.03
Total cold run time: 110.06 s
Total hot run time: 30.19 s

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 35.78% (9004/25167)
Line Coverage: 27.39% (74563/272185)
Region Coverage: 26.61% (38581/144980)
Branch Coverage: 23.48% (19675/83778)
Coverage Report: http://coverage.selectdb-in.cc/coverage/b1ec79dac1a84b70965a3ed532a6c49405fb39da_b1ec79dac1a84b70965a3ed532a6c49405fb39da/report/index.html

@github-actions
Copy link
Contributor

PR approved by anyone and no changes requested.

@xinyiZzz xinyiZzz force-pushed the 20240520_fix_jemalloc_jvm branch from f5a35d0 to 2ba6a1a Compare May 29, 2024 08:52
@xinyiZzz
Copy link
Contributor Author

run buildall

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17608	4384	4240	4240
q2	2029	194	196	194
q3	10453	1270	1255	1255
q4	10210	895	764	764
q5	7488	2723	2659	2659
q6	225	129	134	129
q7	973	648	618	618
q8	9314	2150	2079	2079
q9	9539	6704	6731	6704
q10	9571	3916	3949	3916
q11	459	242	253	242
q12	471	224	219	219
q13	17513	3158	3268	3158
q14	260	211	215	211
q15	514	464	477	464
q16	514	407	416	407
q17	976	739	738	738
q18	8467	7718	7831	7718
q19	6026	1613	1534	1534
q20	661	315	314	314
q21	5261	3956	3890	3890
q22	351	271	280	271
Total cold run time: 118883 ms
Total hot run time: 41724 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4541	4397	4353	4353
q2	390	269	275	269
q3	3150	3037	2815	2815
q4	1846	1617	1677	1617
q5	5481	5506	5485	5485
q6	214	124	126	124
q7	2181	1867	1829	1829
q8	3196	3360	3373	3360
q9	8615	8655	8653	8653
q10	3920	3779	3851	3779
q11	613	500	492	492
q12	814	599	635	599
q13	16161	3135	3182	3135
q14	300	270	280	270
q15	526	504	470	470
q16	495	435	440	435
q17	1807	1494	1446	1446
q18	7799	7623	7345	7345
q19	1666	1558	1538	1538
q20	1987	1791	1784	1784
q21	7785	4767	4765	4765
q22	576	477	476	476
Total cold run time: 74063 ms
Total hot run time: 55039 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 173097 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 2ba6a1ab97424ba47a59f1990861733e687b20e7, data reload: false

query1	918	389	380	380
query2	6442	2473	2381	2381
query3	6648	210	206	206
query4	19388	17424	17394	17394
query5	4124	420	421	420
query6	245	169	152	152
query7	4588	298	287	287
query8	238	188	187	187
query9	8473	2360	2355	2355
query10	452	290	260	260
query11	10652	10278	10210	10210
query12	141	92	87	87
query13	1677	410	369	369
query14	10049	7650	7806	7650
query15	230	172	169	169
query16	7581	259	264	259
query17	1730	521	513	513
query18	1422	282	269	269
query19	200	160	153	153
query20	95	85	87	85
query21	196	130	130	130
query22	4258	4086	3946	3946
query23	33371	32967	32921	32921
query24	10854	2820	2879	2820
query25	563	347	357	347
query26	703	157	155	155
query27	2201	325	326	325
query28	5890	2085	2075	2075
query29	845	616	592	592
query30	242	148	151	148
query31	949	749	745	745
query32	93	53	55	53
query33	670	272	264	264
query34	851	479	490	479
query35	703	606	597	597
query36	1061	874	936	874
query37	103	65	67	65
query38	2876	2730	2776	2730
query39	842	794	796	794
query40	205	129	129	129
query41	49	48	75	48
query42	103	95	97	95
query43	596	555	560	555
query44	1072	746	759	746
query45	173	163	165	163
query46	1061	708	736	708
query47	1830	1770	1772	1770
query48	373	302	302	302
query49	853	381	401	381
query50	759	395	397	395
query51	6997	6773	6750	6750
query52	109	90	91	90
query53	353	289	282	282
query54	867	440	430	430
query55	85	74	73	73
query56	258	245	261	245
query57	1094	1027	1052	1027
query58	235	204	215	204
query59	3313	3090	3397	3090
query60	270	267	258	258
query61	91	87	87	87
query62	598	452	438	438
query63	314	289	291	289
query64	8457	2256	1732	1732
query65	3157	3090	3086	3086
query66	762	329	323	323
query67	15045	14784	14749	14749
query68	4469	542	530	530
query69	443	273	275	273
query70	1151	1101	1095	1095
query71	366	274	269	269
query72	7882	5347	5508	5347
query73	730	328	325	325
query74	6003	5567	5561	5561
query75	3280	2616	2678	2616
query76	2322	960	966	960
query77	406	270	270	270
query78	10120	9934	9947	9934
query79	1670	525	518	518
query80	1155	454	433	433
query81	534	237	223	223
query82	963	97	90	90
query83	246	173	166	166
query84	245	85	84	84
query85	1217	270	277	270
query86	398	278	289	278
query87	3290	3131	3111	3111
query88	3365	2455	2437	2437
query89	472	385	379	379
query90	1968	193	195	193
query91	136	109	107	107
query92	61	51	53	51
query93	1467	523	503	503
query94	1242	262	185	185
query95	396	312	309	309
query96	581	280	270	270
query97	3172	3019	2986	2986
query98	244	225	212	212
query99	1182	821	865	821
Total cold run time: 262819 ms
Total hot run time: 173097 ms

@doris-robot
Copy link

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

query1	0.03	0.03	0.03
query2	0.08	0.04	0.04
query3	0.23	0.04	0.05
query4	1.68	0.07	0.07
query5	0.51	0.49	0.48
query6	1.13	0.72	0.73
query7	0.02	0.02	0.01
query8	0.04	0.04	0.04
query9	0.54	0.48	0.48
query10	0.53	0.55	0.55
query11	0.17	0.10	0.12
query12	0.14	0.12	0.11
query13	0.58	0.59	0.60
query14	0.78	0.80	0.79
query15	0.82	0.81	0.79
query16	0.36	0.36	0.36
query17	1.02	0.94	0.96
query18	0.23	0.23	0.23
query19	1.89	1.77	1.68
query20	0.02	0.01	0.01
query21	15.74	0.68	0.67
query22	4.36	6.98	2.06
query23	18.30	1.31	1.31
query24	1.30	0.37	0.27
query25	0.13	0.08	0.08
query26	0.27	0.17	0.17
query27	0.07	0.09	0.07
query28	13.34	1.01	0.99
query29	13.37	3.33	3.29
query30	0.25	0.06	0.05
query31	2.86	0.40	0.37
query32	3.28	0.47	0.47
query33	2.89	2.88	2.93
query34	17.09	4.40	4.46
query35	4.44	4.48	4.57
query36	0.70	0.49	0.45
query37	0.18	0.15	0.15
query38	0.15	0.15	0.14
query39	0.04	0.03	0.03
query40	0.16	0.14	0.14
query41	0.09	0.05	0.05
query42	0.06	0.05	0.04
query43	0.04	0.04	0.04
Total cold run time: 109.91 s
Total hot run time: 30.66 s

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 35.91% (9123/25408)
Line Coverage: 27.37% (74956/273816)
Region Coverage: 26.62% (38819/145842)
Branch Coverage: 23.45% (19749/84224)
Coverage Report: http://coverage.selectdb-in.cc/coverage/2ba6a1ab97424ba47a59f1990861733e687b20e7_2ba6a1ab97424ba47a59f1990861733e687b20e7/report/index.html

@xinyiZzz xinyiZzz force-pushed the 20240520_fix_jemalloc_jvm branch from 2ba6a1a to 8f0d403 Compare May 29, 2024 13:40
@xinyiZzz
Copy link
Contributor Author

run buildall

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17874	4757	4235	4235
q2	2029	192	202	192
q3	10601	1217	1123	1123
q4	10791	812	695	695
q5	7520	2825	2678	2678
q6	229	135	137	135
q7	969	592	610	592
q8	9301	2124	2128	2124
q9	8896	6602	6586	6586
q10	9280	3791	3720	3720
q11	465	241	241	241
q12	506	218	213	213
q13	17774	2940	3027	2940
q14	282	219	221	219
q15	518	486	481	481
q16	515	392	372	372
q17	973	661	640	640
q18	8123	7381	7331	7331
q19	5482	1582	1577	1577
q20	658	302	314	302
q21	4989	3282	3893	3282
q22	382	320	327	320
Total cold run time: 118157 ms
Total hot run time: 39998 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4431	4230	4214	4214
q2	364	264	272	264
q3	2979	2771	2735	2735
q4	1854	1616	1588	1588
q5	5281	5323	5292	5292
q6	214	125	128	125
q7	2152	1770	1759	1759
q8	3221	3363	3348	3348
q9	8353	8340	8460	8340
q10	3850	3704	3706	3704
q11	582	481	484	481
q12	779	577	574	574
q13	17698	2975	2981	2975
q14	312	250	255	250
q15	514	480	476	476
q16	479	407	405	405
q17	1774	1482	1485	1482
q18	7573	7619	7554	7554
q19	1697	1564	1554	1554
q20	1962	1818	1830	1818
q21	4783	4715	4636	4636
q22	630	528	488	488
Total cold run time: 71482 ms
Total hot run time: 54062 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 170134 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 8f0d403e4c2cceb03024f9086ad916f3eaa29919, data reload: false

query1	936	378	371	371
query2	6448	2490	2228	2228
query3	6651	214	213	213
query4	20835	17356	17314	17314
query5	4251	427	429	427
query6	254	160	167	160
query7	4593	295	288	288
query8	310	278	287	278
query9	8641	2397	2377	2377
query10	468	282	270	270
query11	10510	10055	10023	10023
query12	141	91	98	91
query13	1654	366	362	362
query14	9784	7487	7648	7487
query15	259	185	185	185
query16	8029	268	256	256
query17	1848	515	511	511
query18	2060	269	287	269
query19	203	152	150	150
query20	93	88	92	88
query21	198	130	130	130
query22	4232	3924	3885	3885
query23	33716	33155	33370	33155
query24	12032	2818	2853	2818
query25	670	350	358	350
query26	1753	151	152	151
query27	2972	311	323	311
query28	7688	2030	2041	2030
query29	1045	616	595	595
query30	298	148	155	148
query31	993	782	734	734
query32	92	56	55	55
query33	767	264	258	258
query34	1076	464	487	464
query35	744	639	622	622
query36	1080	890	917	890
query37	275	66	69	66
query38	2908	2789	2740	2740
query39	894	775	784	775
query40	272	128	122	122
query41	53	51	51	51
query42	101	96	96	96
query43	608	551	543	543
query44	1176	739	750	739
query45	180	169	167	167
query46	1067	712	700	700
query47	1832	1738	1759	1738
query48	358	299	289	289
query49	1198	376	378	376
query50	765	380	381	380
query51	6982	6855	6884	6855
query52	107	88	94	88
query53	360	289	292	289
query54	980	441	424	424
query55	74	74	74	74
query56	292	239	245	239
query57	1148	1027	1032	1027
query58	247	214	206	206
query59	3316	3159	3257	3159
query60	268	258	264	258
query61	102	92	87	87
query62	643	438	459	438
query63	309	284	284	284
query64	9805	2268	1674	1674
query65	3191	3107	3121	3107
query66	1372	332	319	319
query67	15276	15120	15003	15003
query68	4511	530	517	517
query69	439	273	264	264
query70	1093	1090	1143	1090
query71	391	263	266	263
query72	7802	5304	2717	2717
query73	710	316	317	316
query74	6081	5602	5607	5602
query75	3446	2605	2636	2605
query76	2572	1017	1059	1017
query77	408	266	270	266
query78	10240	9806	9724	9724
query79	2441	507	507	507
query80	1092	424	426	424
query81	515	218	221	218
query82	859	97	92	92
query83	245	177	172	172
query84	239	89	85	85
query85	1266	290	262	262
query86	445	276	293	276
query87	3291	3093	3166	3093
query88	4259	2329	2347	2329
query89	472	411	376	376
query90	1954	193	196	193
query91	130	106	109	106
query92	61	53	57	53
query93	1878	508	481	481
query94	1349	184	187	184
query95	400	309	305	305
query96	587	260	262	260
query97	3179	3057	3038	3038
query98	227	231	213	213
query99	1077	829	865	829
Total cold run time: 277142 ms
Total hot run time: 170134 ms

@doris-robot
Copy link

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

query1	0.04	0.03	0.03
query2	0.08	0.04	0.04
query3	0.24	0.05	0.05
query4	1.67	0.08	0.07
query5	0.50	0.46	0.49
query6	1.12	0.72	0.72
query7	0.02	0.01	0.02
query8	0.05	0.05	0.05
query9	0.54	0.49	0.48
query10	0.54	0.55	0.54
query11	0.15	0.11	0.11
query12	0.15	0.12	0.12
query13	0.60	0.60	0.59
query14	0.79	0.79	0.77
query15	0.83	0.80	0.82
query16	0.35	0.37	0.35
query17	1.01	0.98	0.95
query18	0.23	0.24	0.24
query19	1.77	1.70	1.64
query20	0.01	0.01	0.01
query21	15.71	0.69	0.65
query22	4.11	7.91	1.72
query23	18.35	1.30	1.33
query24	2.00	0.24	0.20
query25	0.13	0.09	0.08
query26	0.27	0.16	0.17
query27	0.08	0.08	0.08
query28	13.26	1.01	1.02
query29	13.07	3.32	3.31
query30	0.26	0.06	0.05
query31	2.86	0.39	0.38
query32	3.29	0.48	0.48
query33	2.87	2.92	2.91
query34	16.91	4.38	4.42
query35	4.53	4.46	4.55
query36	0.66	0.46	0.45
query37	0.18	0.16	0.16
query38	0.17	0.15	0.15
query39	0.05	0.04	0.04
query40	0.16	0.15	0.14
query41	0.09	0.04	0.05
query42	0.05	0.04	0.05
query43	0.05	0.03	0.04
Total cold run time: 109.8 s
Total hot run time: 30.25 s

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 36.00% (9147/25410)
Line Coverage: 27.44% (75143/273823)
Region Coverage: 26.65% (38890/145929)
Branch Coverage: 23.49% (19799/84294)
Coverage Report: http://coverage.selectdb-in.cc/coverage/8f0d403e4c2cceb03024f9086ad916f3eaa29919_8f0d403e4c2cceb03024f9086ad916f3eaa29919/report/index.html

@yiguolei yiguolei merged commit cc854a3 into apache:master May 30, 2024
@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label May 30, 2024
@github-actions
Copy link
Contributor

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

w41ter pushed a commit to w41ter/incubator-doris that referenced this pull request May 31, 2024
## Proposed changes

Revert apache#13660 

`-l` and `dlopen` load Dynamic Link Library, will use the Allocator of
main program, Doris use Jemalloc by default.

but, `dlopen` load libjvm.so and use Jemalloc compiled with prefix,
overwriting malloc/free will incompatible with libjvm.so. see apache#34578 for
details.

In addition, jemalloc not recommend `dlopen` to load Dynamic Link
Library, `dlclose` will memory leak in that case.
jemalloc/jemalloc#2404
jemalloc/jemalloc#1321
jemalloc/jemalloc#1890

`export LD_PRELOAD` to force `libjvm.so` use a separate `jemalloc.so`
will not solve the problem, but may cause a new crash.

```
received by PID 2368 (TID 2391 OR 0x7f445cafb700) from PID 0; stack trace: ***
 0# doris::signal::(anonymous namespace)::FailureSignalHandler(int, siginfo_t*, void*) at /root/selectdb-core/be/src/common/signal_handler.h:421
 1# PosixSignals::chained_handler(int, siginfo*, void*) [clone .part.0] in /opt/jdk/lib/server/libjvm.so
 2# JVM_handle_linux_signal in /opt/jdk/lib/server/libjvm.so
 3# 0x00007F448DB40400 in /lib64/libc.so.6
 4# je_arena_dalloc_promoted at /root/selectdb-core/thirdparty/src/jemalloc-5.3.0/doris_build/../src/arena.c:1277
 5# je_free_default at /root/selectdb-core/thirdparty/src/jemalloc-5.3.0/doris_build/../src/jemalloc.c:3014
 6# __pthread_create_2_1 in /lib64/libpthread.so.0
 7# os::create_thread(Thread*, os::ThreadType, unsigned long) in /opt/jdk/lib/server/libjvm.so
 8# CompilerThread::CompilerThread(CompileQueue*, CompilerCounters*) in /opt/jdk/lib/server/libjvm.so
 9# CompileBroker::make_thread(CompileBroker::ThreadType, _jobject*, CompileQueue*, AbstractCompiler*, JavaThread*) [clone .constprop.0] in /opt/jdk/lib/server/libjvm.so
10# CompileBroker::possibly_add_compiler_threads(JavaThread*) in /opt/jdk/lib/server/libjvm.so
11# CompileBroker::compiler_thread_loop() in /opt/jdk/lib/server/libjvm.so
12# JavaThread::thread_main_inner() in /opt/jdk/lib/server/libjvm.so
13# Thread::call_run() in /opt/jdk/lib/server/libjvm.so
14# thread_native_entry(Thread*) in /opt/jdk/lib/server/libjvm.so
15# start_thread in /lib64/libpthread.so.0
16# clone in /lib64/libc.so.6
```

<!--Describe your changes.-->
yiguolei pushed a commit that referenced this pull request May 31, 2024
Cherry-pick #35557

Co-authored-by: Xinyi Zou <zouxinyi02@gmail.com>
xinyiZzz added a commit that referenced this pull request Jun 20, 2024
… some env (#35694)

After #35557, jdk17 and jemalloc compatibility problems not exist.
iszhangpch pushed a commit to iszhangpch/doris-p that referenced this pull request Jun 21, 2024
… some env (apache#35694)

After apache#35557, jdk17 and jemalloc compatibility problems not exist.
dataroaring pushed a commit that referenced this pull request Jun 21, 2024
… some env (#35694)

After #35557, jdk17 and jemalloc compatibility problems not exist.
w41ter added a commit to w41ter/incubator-doris that referenced this pull request Jul 2, 2024
…he#35083 apache#35557 (apache#3405)

[fix](memory) Fix BE memory info compatible with Cgroup (apache#35412)
[fix](memory) Avoid frequently refresh cgroup memory info (apache#35083)
[fix](libjdk) Revert support loading libjvm at runtime (apache#35557)
@xinyiZzz xinyiZzz mentioned this pull request Jul 22, 2024
3 tasks
xinyiZzz added a commit to xinyiZzz/incubator-doris that referenced this pull request Dec 9, 2024
morningman pushed a commit to morningman/doris that referenced this pull request Feb 14, 2025
Revert apache#13660

`-l` and `dlopen` load Dynamic Link Library, will use the Allocator of
main program, Doris use Jemalloc by default.

but, `dlopen` load libjvm.so and use Jemalloc compiled with prefix,
overwriting malloc/free will incompatible with libjvm.so. see apache#34578 for
details.

In addition, jemalloc not recommend `dlopen` to load Dynamic Link
Library, `dlclose` will memory leak in that case.
jemalloc/jemalloc#2404
jemalloc/jemalloc#1321
jemalloc/jemalloc#1890

`export LD_PRELOAD` to force `libjvm.so` use a separate `jemalloc.so`
will not solve the problem, but may cause a new crash.

```
received by PID 2368 (TID 2391 OR 0x7f445cafb700) from PID 0; stack trace: ***
 0# doris::signal::(anonymous namespace)::FailureSignalHandler(int, siginfo_t*, void*) at /root/selectdb-core/be/src/common/signal_handler.h:421
 1# PosixSignals::chained_handler(int, siginfo*, void*) [clone .part.0] in /opt/jdk/lib/server/libjvm.so
 2# JVM_handle_linux_signal in /opt/jdk/lib/server/libjvm.so
 3# 0x00007F448DB40400 in /lib64/libc.so.6
 4# je_arena_dalloc_promoted at /root/selectdb-core/thirdparty/src/jemalloc-5.3.0/doris_build/../src/arena.c:1277
 5# je_free_default at /root/selectdb-core/thirdparty/src/jemalloc-5.3.0/doris_build/../src/jemalloc.c:3014
 6# __pthread_create_2_1 in /lib64/libpthread.so.0
 7# os::create_thread(Thread*, os::ThreadType, unsigned long) in /opt/jdk/lib/server/libjvm.so
 8# CompilerThread::CompilerThread(CompileQueue*, CompilerCounters*) in /opt/jdk/lib/server/libjvm.so
 9# CompileBroker::make_thread(CompileBroker::ThreadType, _jobject*, CompileQueue*, AbstractCompiler*, JavaThread*) [clone .constprop.0] in /opt/jdk/lib/server/libjvm.so
10# CompileBroker::possibly_add_compiler_threads(JavaThread*) in /opt/jdk/lib/server/libjvm.so
11# CompileBroker::compiler_thread_loop() in /opt/jdk/lib/server/libjvm.so
12# JavaThread::thread_main_inner() in /opt/jdk/lib/server/libjvm.so
13# Thread::call_run() in /opt/jdk/lib/server/libjvm.so
14# thread_native_entry(Thread*) in /opt/jdk/lib/server/libjvm.so
15# start_thread in /lib64/libpthread.so.0
16# clone in /lib64/libc.so.6
```

<!--Describe your changes.-->
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.0.0-merged reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants