Skip to content

[fix](httpserver) Fix lsan check error when stop libevent server#53081

Merged
liaoxin01 merged 1 commit intoapache:masterfrom
liaoxin01:fix_http_server
Jul 11, 2025
Merged

[fix](httpserver) Fix lsan check error when stop libevent server#53081
liaoxin01 merged 1 commit intoapache:masterfrom
liaoxin01:fix_http_server

Conversation

@liaoxin01
Copy link
Contributor

@liaoxin01 liaoxin01 commented Jul 11, 2025

What problem does this PR solve?

Issue Number: close #xxx

Related PR: #xxx

Problem Summary:
AddressSanitizer: CHECK failed: sanitizer_posix_libcdep.cpp:303 "((14)) == ((write_errno))" (0xe, 0x20) (tid=42951)
#0 0x55d6f4c6fc21 in __asan::CheckUnwind() (/mnt/ssd01/pipline/OpenSourceDoris/clusterEnv/P0/Cluster0/be/lib/doris_be+0x29e5bc21)
#1 0x55d6f4c8a742 in __sanitizer::CheckFailed(char const*, int, char const*, unsigned long long, unsigned long long) (/mnt/ssd01/pipline/OpenSourceDoris/clusterEnv/P0/Cluster0/be/lib/doris_be+0x29e76742)
#2 0x55d6f4c8cba8 in __sanitizer::IsAccessibleMemoryRange(unsigned long, unsigned long) (/mnt/ssd01/pipline/OpenSourceDoris/clusterEnv/P0/Cluster0/be/lib/doris_be+0x29e78ba8)
#3 0x55d6f4ca7698 in __ubsan::checkDynamicType(void*, void*, unsigned long) (/mnt/ssd01/pipline/OpenSourceDoris/clusterEnv/P0/Cluster0/be/lib/doris_be+0x29e93698)
#4 0x55d6f4ca6a62 in HandleDynamicTypeCacheMiss(__ubsan::DynamicTypeCacheMissData*, unsigned long, unsigned long, __ubsan::ReportOptions) (/mnt/ssd01/pipline/OpenSourceDoris/clusterEnv/P0/Cluster0/be/lib/doris_be+0x29e92a62)
#5 0x55d6f4ca6a33 in __ubsan_handle_dynamic_type_cache_miss (/mnt/ssd01/pipline/OpenSourceDoris/clusterEnv/P0/Cluster0/be/lib/doris_be+0x29e92a33)
#6 0x55d6fadbf0d1 in std::_Sp_counted_deleter<event_base*, doris::EvHttpServer::EvHttpServer(int, int)::$_0, std::allocator, (__gnu_cxx::_Lock_policy)2>::_M_dispose() /usr/local/ldb-toolchain-v0.24/bin/../lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/bits/shared_ptr_base.h:527:9
#7 0x55d6f4cc5c52 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() /usr/local/ldb-toolchain-v0.24/bin/../lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/bits/shared_ptr_base.h:346:8
#8 0x55d6f88a0a4e in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count() /usr/local/ldb-toolchain-v0.24/bin/../lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/bits/shared_ptr_base.h:1069:11
#9 0x55d6f88a0a4e in std::__shared_ptr<event_base, (__gnu_cxx::_Lock_policy)2>::
__shared_ptr() /usr/local/ldb-toolchain-v0.24/bin/../lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/bits/shared_ptr_base.h:1525:31
#10 0x55d6f88a0a4e in void std::destroy_at<std::shared_ptr<event_base> >(std::shared_ptr<event_base>) /usr/local/ldb-toolchain-v0.24/bin/../lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/bits/stl_construct.h:88:15
#11 0x55d6f88a0a4e in void std::_Destroy<std::shared_ptr<event_base> >(std::shared_ptr<event_base>
) /usr/local/ldb-toolchain-v0.24/bin/../lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/bits/stl_construct.h:149:7
#12 0x55d6f88a0a4e in void std::_Destroy_aux::__destroy<std::shared_ptr<event_base>>(std::shared_ptr<event_base>, std::shared_ptr<event_base>) /usr/local/ldb-toolchain-v0.24/bin/../lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/bits/stl_construct.h:163:6
#13 0x55d6fadbc194 in void std::_Destroy<std::shared_ptr<event_base>
>(std::shared_ptr<event_base>, std::shared_ptr<event_base>) /usr/local/ldb-toolchain-v0.24/bin/../lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/bits/stl_construct.h:195:7
#14 0x55d6fadbc194 in void std::_Destroy<std::shared_ptr<event_base>, std::shared_ptr<event_base> >(std::shared_ptr<event_base>, std::shared_ptr<event_base>, std::allocator<std::shared_ptr<event_base> >&) /usr/local/ldb-toolchain-v0.24/bin/../lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/bits/alloc_traits.h:981:7
#15 0x55d6fadbc194 in std::vector<std::shared_ptr<event_base>, std::allocator<std::shared_ptr<event_base> > >::_M_erase_at_end(std::shared_ptr<event_base>
) /usr/local/ldb-toolchain-v0.24/bin/../lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/bits/stl_vector.h:1947:6
#16 0x55d6fadbc194 in std::vector<std::shared_ptr<event_base>, std::allocator<std::shared_ptr<event_base> > >::clear() /usr/local/ldb-toolchain-v0.24/bin/../lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/bits/stl_vector.h:1608:9
#17 0x55d6fadbc194 in doris::EvHttpServer::stop() /root/doris/be/src/http/ev_http_server.cpp:151:22
#18 0x55d6f88902f4 in doris::HttpService::stop() /root/doris/be/src/service/http_service.cpp:497:22
#19 0x55d6f4cae518 in main /root/doris/be/src/service/doris_main.cpp:625:19

Release note

None

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

@hello-stephen
Copy link
Contributor

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?

@liaoxin01 liaoxin01 marked this pull request as draft July 11, 2025 02:33
@liaoxin01
Copy link
Contributor Author

run buildall

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

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

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

@github-actions
Copy link
Contributor

PR approved by anyone and no changes requested.

@liaoxin01 liaoxin01 marked this pull request as ready for review July 11, 2025 02:37
@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17564	5184	5046	5046
q2	1941	300	188	188
q3	10380	1304	756	756
q4	10243	1019	523	523
q5	7980	2432	2367	2367
q6	175	166	127	127
q7	943	760	622	622
q8	9330	1332	1106	1106
q9	6853	5062	5106	5062
q10	6880	2390	1942	1942
q11	472	283	270	270
q12	340	357	213	213
q13	17788	3713	3066	3066
q14	227	223	211	211
q15	580	468	478	468
q16	423	438	372	372
q17	601	888	370	370
q18	7593	7144	7149	7144
q19	1402	972	543	543
q20	345	343	214	214
q21	3791	3181	2320	2320
q22	360	321	301	301
Total cold run time: 106211 ms
Total hot run time: 33231 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5130	5105	5071	5071
q2	235	324	221	221
q3	2216	2684	2349	2349
q4	1368	1804	1385	1385
q5	4248	4282	4494	4282
q6	240	190	129	129
q7	2037	2012	1818	1818
q8	2665	2614	2578	2578
q9	7426	7270	7316	7270
q10	3099	3308	2873	2873
q11	615	547	492	492
q12	677	771	610	610
q13	3642	3965	3429	3429
q14	291	302	272	272
q15	516	494	498	494
q16	463	482	465	465
q17	1209	1625	1402	1402
q18	8057	7805	7098	7098
q19	772	841	880	841
q20	1896	1961	1834	1834
q21	4782	4345	4353	4345
q22	673	587	534	534
Total cold run time: 52257 ms
Total hot run time: 49792 ms

@doris-robot
Copy link

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

query1	996	375	373	373
query2	6505	1757	1669	1669
query3	6735	210	214	210
query4	26572	23331	23089	23089
query5	4348	571	412	412
query6	310	207	213	207
query7	4629	495	293	293
query8	281	224	215	215
query9	8615	2625	2623	2623
query10	475	337	262	262
query11	15663	15150	14851	14851
query12	165	102	99	99
query13	1639	499	385	385
query14	8616	5803	5762	5762
query15	204	187	160	160
query16	7129	622	468	468
query17	1117	726	577	577
query18	1958	387	293	293
query19	200	205	163	163
query20	131	113	110	110
query21	217	126	106	106
query22	4145	4301	4101	4101
query23	34094	32981	33107	32981
query24	8457	2401	2370	2370
query25	563	478	426	426
query26	1250	271	151	151
query27	2761	528	353	353
query28	4331	2125	2101	2101
query29	771	572	455	455
query30	285	223	189	189
query31	918	856	744	744
query32	73	68	61	61
query33	561	379	330	330
query34	786	839	514	514
query35	779	827	765	765
query36	964	973	885	885
query37	119	99	79	79
query38	4154	4055	4008	4008
query39	1515	1443	1409	1409
query40	217	122	107	107
query41	62	60	58	58
query42	124	107	110	107
query43	528	497	466	466
query44	1302	808	815	808
query45	178	163	159	159
query46	832	1027	614	614
query47	1767	1803	1732	1732
query48	374	401	311	311
query49	734	483	401	401
query50	624	695	404	404
query51	5546	5542	5483	5483
query52	114	105	93	93
query53	218	247	183	183
query54	565	558	483	483
query55	78	79	80	79
query56	298	284	338	284
query57	1181	1188	1147	1147
query58	263	255	261	255
query59	2618	2715	2670	2670
query60	332	305	299	299
query61	137	117	118	117
query62	780	721	653	653
query63	220	183	180	180
query64	4271	1030	645	645
query65	4325	4186	4186	4186
query66	1147	400	322	322
query67	15867	15544	15393	15393
query68	7951	894	510	510
query69	473	305	270	270
query70	1194	1115	1052	1052
query71	443	315	298	298
query72	5750	4755	4887	4755
query73	744	639	342	342
query74	9200	9091	8801	8801
query75	3764	3178	2688	2688
query76	3601	1128	724	724
query77	781	392	285	285
query78	10141	10075	9204	9204
query79	2436	822	576	576
query80	622	506	446	446
query81	472	269	213	213
query82	468	128	94	94
query83	282	252	239	239
query84	294	112	85	85
query85	779	350	301	301
query86	334	299	300	299
query87	4393	4369	4399	4369
query88	3413	2272	2260	2260
query89	382	323	283	283
query90	1935	206	203	203
query91	138	145	108	108
query92	78	61	55	55
query93	1416	961	583	583
query94	676	406	292	292
query95	373	292	273	273
query96	489	574	278	278
query97	2761	2741	2687	2687
query98	231	208	207	207
query99	1476	1390	1282	1282
Total cold run time: 275223 ms
Total hot run time: 185950 ms

@doris-robot
Copy link

ClickBench: Total hot run time: 28.96 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit a9ecfd40ac1b89d4f35ac12cc01a5f2abc8716bb, 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.12
query5	0.44	0.41	0.42
query6	1.18	0.66	0.65
query7	0.03	0.02	0.02
query8	0.05	0.04	0.04
query9	0.59	0.51	0.51
query10	0.56	0.59	0.57
query11	0.15	0.11	0.11
query12	0.15	0.11	0.11
query13	0.62	0.61	0.61
query14	0.81	0.80	0.82
query15	0.89	0.88	0.88
query16	0.38	0.39	0.39
query17	1.09	1.07	1.11
query18	0.22	0.22	0.21
query19	1.93	1.88	1.83
query20	0.01	0.01	0.01
query21	15.39	0.87	0.54
query22	0.75	1.19	0.66
query23	14.98	1.34	0.61
query24	6.91	1.07	0.32
query25	0.35	0.15	0.13
query26	0.64	0.16	0.13
query27	0.06	0.05	0.05
query28	8.96	0.90	0.44
query29	12.58	4.01	3.31
query30	0.24	0.10	0.06
query31	2.84	0.59	0.38
query32	3.25	0.56	0.47
query33	3.07	3.10	3.07
query34	16.14	5.40	4.71
query35	4.79	4.77	4.79
query36	0.69	0.52	0.49
query37	0.09	0.07	0.07
query38	0.05	0.04	0.04
query39	0.03	0.03	0.02
query40	0.17	0.14	0.15
query41	0.08	0.02	0.02
query42	0.03	0.03	0.03
query43	0.04	0.03	0.02
Total cold run time: 103.22 s
Total hot run time: 28.96 s

@hello-stephen
Copy link
Contributor

BE UT Coverage Report

Increment line coverage 100.00% (1/1) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 57.07% (15508/27173)
Line Coverage 45.90% (138453/301637)
Region Coverage 35.30% (103497/293232)
Branch Coverage 37.78% (45588/120670)

@liaoxin01 liaoxin01 merged commit 4edda90 into apache:master Jul 11, 2025
29 of 32 checks passed
@liaoxin01 liaoxin01 deleted the fix_http_server branch July 11, 2025 08:37
dataroaring pushed a commit that referenced this pull request Jul 12, 2025
… server #53081 (#53111)

Cherry-picked from #53081

Co-authored-by: Xin Liao <liaoxin@selectdb.com>
morrySnow pushed a commit that referenced this pull request Jul 14, 2025
… server #53081 (#53113)

Cherry-picked from #53081

Co-authored-by: Xin Liao <liaoxin@selectdb.com>
vinlee19 pushed a commit to vinlee19/doris that referenced this pull request Jul 14, 2025
… server apache#53081 (apache#53113)

Cherry-picked from apache#53081

Co-authored-by: Xin Liao <liaoxin@selectdb.com>
yiguolei pushed a commit that referenced this pull request Jul 16, 2025
… server #53081 (#53112)

Cherry-picked from #53081

Co-authored-by: Xin Liao <liaoxin@selectdb.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants