Skip to content

Conversation

@zhangstar333
Copy link
Contributor

@zhangstar333 zhangstar333 commented Jul 31, 2025

What problem does this PR solve?

Problem Summary:

doris_be: /mnt/disk8/zhangsida/doris/thirdparty/installed/include/parallel_hashmap/phmap.h:1511: void phmap::priv::raw_hash_set<phmap::priv::FlatHashMapPolicy<unsigned char, char *>, HashCRC32<doris::vectorized::UInt8>, phmap::EqualTo<unsigned char>, doris::vectorized::Allocator_<std::pair<const unsigned char, char *>>>::constructor::operator()(Args &&...) const [Policy = phmap::priv::FlatHashMapPolicy<unsigned char, char *>, Hash = HashCRC32<doris::vectorized::UInt8>, Eq = phmap::EqualTo<unsigned char>, Alloc = doris::vectorized::Allocator_<std::pair<const unsigned char, char *>>, Args = <unsigned char &, std::nullptr_t>]: Assertion `*slot_' failed.
*** Query id: 6bda59ac672d4496-bcf117ae8ce3f894 ***
*** is nereids: 1 ***
*** tablet id: 0 ***
*** Aborted at 1753928330 (unix time) try "date -d @1753928330" if you are using GNU date ***
*** Current BE git commitID: 9634891401 ***
*** SIGABRT unknown detail explain (@0x3ef003cad02) received by PID 3976450 (TID 3979645 OR 0x7fad84c15700) from PID 3976450; stack trace: ***
 0# doris::signal::(anonymous namespace)::FailureSignalHandler(int, siginfo_t*, void*) at /mnt/disk8/zhangsida/doris/be/src/common/signal_handler.h:420
 1# 0x00007FAF620E25B0 in /lib64/libc.so.6
 2# __GI_raise in /lib64/libc.so.6
 3# __GI_abort in /lib64/libc.so.6
 4# _nl_load_domain.cold.0 in /lib64/libc.so.6
 5# 0x00007FAF620DAE86 in /lib64/libc.so.6
 6# void phmap::priv::raw_hash_set<phmap::priv::FlatHashMapPolicy<unsigned char, char*>, HashCRC32<unsigned char>, phmap::EqualTo<unsigned char>, doris::vectorized::Allocator_<std::pair<unsigned char const, char*> > >::constructor::operator()<unsigned char&, decltype(nullptr)>(unsigned char&, decltype(nullptr)&&) const at /mnt/disk8/zhangsida/doris/thirdparty/installed/include/parallel_hashmap/phmap.h:1511
 7# _ZNSt8__detail9__variant17__gen_vtable_implINS0_12_Multi_arrayIPFNS0_21__deduce_visit_resultIbEEON5doris10vectorized8OverloadIJZNS5_8pipeline17AggSinkLocalState30_emplace_into_hash_table_limitEPPcPNS6_5BlockERKSt6vectorIiSaIiEERSE_IPKNS6_7IColumnESaISL_EEjE3$_0ZNS9_30_emplace_into_hash_table_limitESB_SD_SI_SO_jE3$_1EEERSt7variantIJSt9monostateNS6_16MethodSerializedI9PHHashMapINS5_9StringRefESA_11DefaultHashISX_vEEEENS6_15MethodOneNumberIhSW_IhSA_9HashCRC32IhEEEENS12_ItSW_ItSA_S13_ItEEEENS12_IjSW_IjSA_S13_IjEEEENS12_ImSW_ImSA_S13_ImEEEENS6_19MethodStringNoCacheINS5_13StringHashMapISA_NS5_9AllocatorILb1ELb1ELb0ENS5_22DefaultMemoryAllocatorELb1EEEEEEENS12_IN4wide7integerILm128EjEESW_IS1P_SA_S13_IS1P_EEEENS12_INS1O_ILm256EjEESW_IS1T_SA_S13_IS1T_EEEENS12_IjSW_IjSA_14HashMixWrapperIjS1A_EEEENS12_ImSW_ImSA_S1X_ImS1D_EEEENS6_26MethodSingleNullableColumnINS12_IhNS6_15DataWithNullKeyIS15_EEEEEENS24_INS12_ItNS25_IS18_EEEEEENS24_INS12_IjNS25_IS1B_EEEEEENS24_INS12_ImNS25_IS1E_EEEEEENS24_INS12_IjNS25_IS1Z_EEEEEENS24_INS12_ImNS25_IS22_EEEEEENS24_INS12_IS1P_NS25_IS1R_EEEEEENS24_INS12_IS1T_NS25_IS1V_EEEEEENS24_INS1G_INS25_IS1L_EEEEEENS6_15MethodKeysFixedIS1E_EENS2X_IS1R_EENS2X_IS1V_EENS2X_ISW_INS6_7UInt136ESA_S13_IS31_EEEEEEEJEEESt16integer_sequenceImJLm11EEEE14__visit_invokeESS_S36_ at /mnt/disk8/zhangsida/install_data/ldb_toolchain_robin/ldb_toolchain/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/variant:1032
 8# doris::pipeline::AggSinkLocalState::_emplace_into_hash_table_limit(char**, doris::vectorized::Block*, std::vector<int, std::allocator<int> > const&, std::vector<doris::vectorized::IColumn const*, std::allocator<doris::vectorized::IColumn const*> >&, unsigned int) at /mnt/disk8/zhangsida/doris/be/src/pipeline/exec/aggregation_sink_operator.cpp:584
 9# doris::Status doris::pipeline::AggSinkLocalState::_execute_with_serialized_key_helper<true>(doris::vectorized::Block*) at /mnt/disk8/zhangsida/doris/be/src/pipeline/exec/aggregation_sink_operator.cpp:496
10# doris::pipeline::AggSinkLocalState::_execute_with_serialized_key(doris::vectorized::Block*) at /mnt/disk8/zhangsida/doris/be/src/pipeline/exec/aggregation_sink_operator.cpp:443
11# doris::pipeline::AggSinkLocalState::Executor<false, false>::execute(doris::pipeline::AggSinkLocalState*, doris::vectorized::Block*) at /mnt/disk8/zhangsida/doris/be/src/pipeline/exec/aggregation_sink_operator.h:62
                                try {
                                    HashMethodType::try_presis_key_and_origin(key, origin,
                                                                              _agg_arena_pool);
                                    auto mapped =
                                            _shared_state->aggregate_data_container->append_data(
                                                    origin);
                                    auto st = _create_agg_status(mapped);
                                    if (!st) {
                                        throw Exception(st.code(), st.to_string());
                                    }
                                    ctor(key, mapped);
                                   _shared_state->refresh_top_limit(i, key_columns);
                                } catch (...) {
                                    // Exception-safety - if it can not allocate memory or create status,
                                    // the destructors will not be called.
                                    ctor(key, nullptr);
                                    throw;
                                }

when _shared_state->refresh_top_limit(i, key_columns); throw exception
will exectue ctor(key, nullptr);, but before have exectue ctor(key, mapped)

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

@Thearas
Copy link
Contributor

Thearas commented Jul 31, 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?

@zhangstar333
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17668	5775	5723	5723
q2	1965	293	195	195
q3	10246	1345	720	720
q4	10231	977	536	536
q5	8891	2336	2350	2336
q6	225	167	132	132
q7	897	787	634	634
q8	9355	1337	1057	1057
q9	7214	5245	5178	5178
q10	6969	2353	2001	2001
q11	472	276	275	275
q12	378	396	234	234
q13	17838	3503	3010	3010
q14	250	243	218	218
q15	578	480	467	467
q16	419	447	375	375
q17	576	853	349	349
q18	7565	7138	6974	6974
q19	1426	977	531	531
q20	352	323	212	212
q21	3450	3040	2273	2273
q22	1058	1108	1028	1028
Total cold run time: 108023 ms
Total hot run time: 34458 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5844	5852	5777	5777
q2	336	314	224	224
q3	2080	2566	2212	2212
q4	1298	1704	1340	1340
q5	4535	4448	4463	4448
q6	219	177	133	133
q7	2035	1902	1828	1828
q8	2634	2499	2455	2455
q9	7289	7616	7375	7375
q10	3182	3382	2925	2925
q11	560	526	517	517
q12	685	771	644	644
q13	3456	3752	3451	3451
q14	304	320	272	272
q15	520	461	463	461
q16	454	487	443	443
q17	1214	1427	1599	1427
q18	7756	8005	7917	7917
q19	18169	951	868	868
q20	2109	2051	1791	1791
q21	11757	4290	4271	4271
q22	1028	1075	993	993
Total cold run time: 77464 ms
Total hot run time: 51772 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 172804 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 1c7d61974b8660e3a9d02c333e9474eb0e5928d7, data reload: false

============================================
query1	1042	417	415	415
query2	6561	1896	1696	1696
query3	6743	227	219	219
query4	27130	24238	23294	23294
query5	4333	647	508	508
query6	328	222	220	220
query7	4627	528	298	298
query8	268	236	229	229
query9	8619	3200	3161	3161
query10	487	318	285	285
query11	15887	14914	14783	14783
query12	179	149	132	132
query13	1651	551	420	420
query14	9465	7839	7725	7725
query15	231	194	174	174
query16	7529	672	483	483
query17	1367	802	644	644
query18	2097	454	345	345
query19	299	209	192	192
query20	155	149	142	142
query21	228	127	119	119
query22	3998	3919	3875	3875
query23	34403	34411	34454	34411
query24	8110	2410	2438	2410
query25	582	538	493	493
query26	1086	290	162	162
query27	2637	497	350	350
query28	4283	2350	2353	2350
query29	732	601	488	488
query30	305	233	197	197
query31	882	785	718	718
query32	89	78	79	78
query33	571	476	368	368
query34	829	845	514	514
query35	809	827	754	754
query36	1011	1012	949	949
query37	140	111	87	87
query38	3972	4069	3989	3989
query39	1443	1397	1388	1388
query40	244	141	135	135
query41	60	56	53	53
query42	140	120	127	120
query43	511	522	497	497
query44	1412	874	883	874
query45	199	185	194	185
query46	951	1063	673	673
query47	1799	1851	1772	1772
query48	399	430	309	309
query49	709	493	416	416
query50	660	715	407	407
query51	4163	4163	4182	4163
query52	130	132	123	123
query53	257	295	221	221
query54	665	635	552	552
query55	94	87	89	87
query56	373	360	350	350
query57	1212	1230	1165	1165
query58	340	327	338	327
query59	2602	2664	2541	2541
query60	407	395	383	383
query61	124	123	122	122
query62	806	723	661	661
query63	257	214	211	211
query64	3850	1131	825	825
query65	4250	4073	4117	4073
query66	992	475	349	349
query67	query68	16353	888	861	861
query69	1198	312	282	282
query70	1468	1116	1143	1116
query71	719	332	324	324
query72	9262	2321	2146	2146
query73	2966	693	368	368
query74	9019	8912	8594	8594
query75	7487	3191	2743	2743
query76	8776	1232	844	844
query77	1170	407	340	340
query78	9542	11175	9225	9225
query79	15474	610	579	579
query80	1640	545	487	487
query81	569	275	242	242
query82	451	150	115	115
query83	366	303	271	271
query84	298	99	84	84
query85	952	375	329	329
query86	362	335	280	280
query87	4359	4271	4247	4247
query88	5502	2267	2263	2263
query89	510	367	327	327
query90	2611	233	234	233
query91	149	142	115	115
query92	86	73	69	69
query93	6375	976	677	677
query94	1087	418	291	291
query95	430	335	333	333
query96	499	586	289	289
query97	2700	2744	2564	2564
query98	262	243	226	226
query99	1510	1451	1281	1281
Total cold run time: 306866 ms
Total hot run time: 172804 ms

@doris-robot
Copy link

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

query1	0.04	0.04	0.03
query2	0.08	0.04	0.04
query3	0.24	0.08	0.07
query4	1.62	0.11	0.10
query5	0.43	0.43	0.43
query6	1.17	0.67	0.67
query7	0.02	0.02	0.02
query8	0.05	0.04	0.04
query9	0.58	0.45	0.46
query10	0.53	0.52	0.51
query11	0.15	0.10	0.10
query12	0.15	0.12	0.11
query13	0.65	0.63	0.64
query14	0.90	1.12	1.15
query15	0.91	0.91	0.88
query16	0.41	0.39	0.38
query17	1.05	1.04	1.05
query18	0.22	0.20	0.20
query19	2.02	1.83	1.80
query20	0.01	0.02	0.01
query21	15.37	0.87	0.56
query22	0.76	1.04	0.64
query23	15.13	1.19	0.63
query24	6.64	2.11	0.54
query25	0.50	0.25	0.23
query26	0.57	0.15	0.13
query27	0.07	0.05	0.05
query28	10.01	0.87	0.45
query29	12.66	3.91	3.41
query30	3.00	3.04	2.96
query31	2.82	0.58	0.39
query32	3.24	0.56	0.49
query33	2.99	3.21	3.22
query34	15.87	5.41	4.92
query35	4.93	5.03	4.94
query36	0.70	0.52	0.49
query37	0.09	0.08	0.07
query38	0.05	0.05	0.04
query39	0.03	0.02	0.03
query40	0.17	0.13	0.14
query41	0.08	0.03	0.02
query42	0.03	0.03	0.03
query43	0.04	0.04	0.04
Total cold run time: 106.98 s
Total hot run time: 33.02 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.80% (16082/27825)
Line Coverage 46.53% (144653/310858)
Region Coverage 35.76% (108767/304184)
Branch Coverage 38.42% (48034/125029)

@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100.00% (1/1) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 81.24% (22191/27314)
Line Coverage 73.95% (229600/310485)
Region Coverage 61.63% (192239/311901)
Branch Coverage 65.48% (82762/126401)

2 similar comments
@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100.00% (1/1) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 81.24% (22191/27314)
Line Coverage 73.95% (229600/310485)
Region Coverage 61.63% (192239/311901)
Branch Coverage 65.48% (82762/126401)

@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100.00% (1/1) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 81.24% (22191/27314)
Line Coverage 73.95% (229600/310485)
Region Coverage 61.63% (192239/311901)
Branch Coverage 65.48% (82762/126401)

Copy link
Contributor

@HappenLee HappenLee 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
Copy link
Contributor

github-actions bot commented Aug 2, 2025

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 Aug 2, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Aug 2, 2025

PR approved by anyone and no changes requested.

Copy link
Collaborator

@wm1581066 wm1581066 left a comment

Choose a reason for hiding this comment

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

LGTM

@yiguolei yiguolei merged commit 597ad09 into apache:master Aug 2, 2025
32 of 34 checks passed
zhangstar333 added a commit to zhangstar333/incubator-doris that referenced this pull request Aug 4, 2025
…pache#54137)

Problem Summary:
```
doris_be: /mnt/disk8/zhangsida/doris/thirdparty/installed/include/parallel_hashmap/phmap.h:1511: void phmap::priv::raw_hash_set<phmap::priv::FlatHashMapPolicy<unsigned char, char *>, HashCRC32<doris::vectorized::UInt8>, phmap::EqualTo<unsigned char>, doris::vectorized::Allocator_<std::pair<const unsigned char, char *>>>::constructor::operator()(Args &&...) const [Policy = phmap::priv::FlatHashMapPolicy<unsigned char, char *>, Hash = HashCRC32<doris::vectorized::UInt8>, Eq = phmap::EqualTo<unsigned char>, Alloc = doris::vectorized::Allocator_<std::pair<const unsigned char, char *>>, Args = <unsigned char &, std::nullptr_t>]: Assertion `*slot_' failed.
*** Query id: 6bda59ac672d4496-bcf117ae8ce3f894 ***
*** is nereids: 1 ***
*** tablet id: 0 ***
*** Aborted at 1753928330 (unix time) try "date -d @1753928330" if you are using GNU date ***
*** Current BE git commitID: 9634891 ***
*** SIGABRT unknown detail explain (@0x3ef003cad02) received by PID 3976450 (TID 3979645 OR 0x7fad84c15700) from PID 3976450; stack trace: ***
 0# doris::signal::(anonymous namespace)::FailureSignalHandler(int, siginfo_t*, void*) at /mnt/disk8/zhangsida/doris/be/src/common/signal_handler.h:420
 1# 0x00007FAF620E25B0 in /lib64/libc.so.6
 2# __GI_raise in /lib64/libc.so.6
 3# __GI_abort in /lib64/libc.so.6
 4# _nl_load_domain.cold.0 in /lib64/libc.so.6
 5# 0x00007FAF620DAE86 in /lib64/libc.so.6
 6# void phmap::priv::raw_hash_set<phmap::priv::FlatHashMapPolicy<unsigned char, char*>, HashCRC32<unsigned char>, phmap::EqualTo<unsigned char>, doris::vectorized::Allocator_<std::pair<unsigned char const, char*> > >::constructor::operator()<unsigned char&, decltype(nullptr)>(unsigned char&, decltype(nullptr)&&) const at /mnt/disk8/zhangsida/doris/thirdparty/installed/include/parallel_hashmap/phmap.h:1511
 7# _ZNSt8__detail9__variant17__gen_vtable_implINS0_12_Multi_arrayIPFNS0_21__deduce_visit_resultIbEEON5doris10vectorized8OverloadIJZNS5_8pipeline17AggSinkLocalState30_emplace_into_hash_table_limitEPPcPNS6_5BlockERKSt6vectorIiSaIiEERSE_IPKNS6_7IColumnESaISL_EEjE3$_0ZNS9_30_emplace_into_hash_table_limitESB_SD_SI_SO_jE3$_1EEERSt7variantIJSt9monostateNS6_16MethodSerializedI9PHHashMapINS5_9StringRefESA_11DefaultHashISX_vEEEENS6_15MethodOneNumberIhSW_IhSA_9HashCRC32IhEEEENS12_ItSW_ItSA_S13_ItEEEENS12_IjSW_IjSA_S13_IjEEEENS12_ImSW_ImSA_S13_ImEEEENS6_19MethodStringNoCacheINS5_13StringHashMapISA_NS5_9AllocatorILb1ELb1ELb0ENS5_22DefaultMemoryAllocatorELb1EEEEEEENS12_IN4wide7integerILm128EjEESW_IS1P_SA_S13_IS1P_EEEENS12_INS1O_ILm256EjEESW_IS1T_SA_S13_IS1T_EEEENS12_IjSW_IjSA_14HashMixWrapperIjS1A_EEEENS12_ImSW_ImSA_S1X_ImS1D_EEEENS6_26MethodSingleNullableColumnINS12_IhNS6_15DataWithNullKeyIS15_EEEEEENS24_INS12_ItNS25_IS18_EEEEEENS24_INS12_IjNS25_IS1B_EEEEEENS24_INS12_ImNS25_IS1E_EEEEEENS24_INS12_IjNS25_IS1Z_EEEEEENS24_INS12_ImNS25_IS22_EEEEEENS24_INS12_IS1P_NS25_IS1R_EEEEEENS24_INS12_IS1T_NS25_IS1V_EEEEEENS24_INS1G_INS25_IS1L_EEEEEENS6_15MethodKeysFixedIS1E_EENS2X_IS1R_EENS2X_IS1V_EENS2X_ISW_INS6_7UInt136ESA_S13_IS31_EEEEEEEJEEESt16integer_sequenceImJLm11EEEE14__visit_invokeESS_S36_ at /mnt/disk8/zhangsida/install_data/ldb_toolchain_robin/ldb_toolchain/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/variant:1032
 8# doris::pipeline::AggSinkLocalState::_emplace_into_hash_table_limit(char**, doris::vectorized::Block*, std::vector<int, std::allocator<int> > const&, std::vector<doris::vectorized::IColumn const*, std::allocator<doris::vectorized::IColumn const*> >&, unsigned int) at /mnt/disk8/zhangsida/doris/be/src/pipeline/exec/aggregation_sink_operator.cpp:584
 9# doris::Status doris::pipeline::AggSinkLocalState::_execute_with_serialized_key_helper<true>(doris::vectorized::Block*) at /mnt/disk8/zhangsida/doris/be/src/pipeline/exec/aggregation_sink_operator.cpp:496
10# doris::pipeline::AggSinkLocalState::_execute_with_serialized_key(doris::vectorized::Block*) at /mnt/disk8/zhangsida/doris/be/src/pipeline/exec/aggregation_sink_operator.cpp:443
11# doris::pipeline::AggSinkLocalState::Executor<false, false>::execute(doris::pipeline::AggSinkLocalState*, doris::vectorized::Block*) at /mnt/disk8/zhangsida/doris/be/src/pipeline/exec/aggregation_sink_operator.h:62
```

```
                                try {
                                    HashMethodType::try_presis_key_and_origin(key, origin,
                                                                              _agg_arena_pool);
                                    auto mapped =
                                            _shared_state->aggregate_data_container->append_data(
                                                    origin);
                                    auto st = _create_agg_status(mapped);
                                    if (!st) {
                                        throw Exception(st.code(), st.to_string());
                                    }
                                    ctor(key, mapped);
                                   _shared_state->refresh_top_limit(i, key_columns);
                                } catch (...) {
                                    // Exception-safety - if it can not allocate memory or create status,
                                    // the destructors will not be called.
                                    ctor(key, nullptr);
                                    throw;
                                }
```

when _shared_state->refresh_top_limit(i, key_columns); throw exception
will exectue ctor(key, nullptr);, but before have exectue ctor(key,
mapped)

None

- Test <!-- At least one of them must be included. -->
    - [ ] 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 <!-- Add your reason?  -->

- Behavior changed:
    - [ ] No.
    - [ ] Yes. <!-- Explain the behavior change -->

- Does this need documentation?
    - [ ] No.
- [ ] Yes. <!-- Add document PR link here. eg:
apache/doris-website#1214 -->

- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR
should merge into -->
zhangstar333 added a commit to zhangstar333/incubator-doris that referenced this pull request Aug 4, 2025
…pache#54137)

Problem Summary:
```
doris_be: /mnt/disk8/zhangsida/doris/thirdparty/installed/include/parallel_hashmap/phmap.h:1511: void phmap::priv::raw_hash_set<phmap::priv::FlatHashMapPolicy<unsigned char, char *>, HashCRC32<doris::vectorized::UInt8>, phmap::EqualTo<unsigned char>, doris::vectorized::Allocator_<std::pair<const unsigned char, char *>>>::constructor::operator()(Args &&...) const [Policy = phmap::priv::FlatHashMapPolicy<unsigned char, char *>, Hash = HashCRC32<doris::vectorized::UInt8>, Eq = phmap::EqualTo<unsigned char>, Alloc = doris::vectorized::Allocator_<std::pair<const unsigned char, char *>>, Args = <unsigned char &, std::nullptr_t>]: Assertion `*slot_' failed.
*** Query id: 6bda59ac672d4496-bcf117ae8ce3f894 ***
*** is nereids: 1 ***
*** tablet id: 0 ***
*** Aborted at 1753928330 (unix time) try "date -d @1753928330" if you are using GNU date ***
*** Current BE git commitID: 9634891 ***
*** SIGABRT unknown detail explain (@0x3ef003cad02) received by PID 3976450 (TID 3979645 OR 0x7fad84c15700) from PID 3976450; stack trace: ***
 0# doris::signal::(anonymous namespace)::FailureSignalHandler(int, siginfo_t*, void*) at /mnt/disk8/zhangsida/doris/be/src/common/signal_handler.h:420
 1# 0x00007FAF620E25B0 in /lib64/libc.so.6
 2# __GI_raise in /lib64/libc.so.6
 3# __GI_abort in /lib64/libc.so.6
 4# _nl_load_domain.cold.0 in /lib64/libc.so.6
 5# 0x00007FAF620DAE86 in /lib64/libc.so.6
 6# void phmap::priv::raw_hash_set<phmap::priv::FlatHashMapPolicy<unsigned char, char*>, HashCRC32<unsigned char>, phmap::EqualTo<unsigned char>, doris::vectorized::Allocator_<std::pair<unsigned char const, char*> > >::constructor::operator()<unsigned char&, decltype(nullptr)>(unsigned char&, decltype(nullptr)&&) const at /mnt/disk8/zhangsida/doris/thirdparty/installed/include/parallel_hashmap/phmap.h:1511
 7# _ZNSt8__detail9__variant17__gen_vtable_implINS0_12_Multi_arrayIPFNS0_21__deduce_visit_resultIbEEON5doris10vectorized8OverloadIJZNS5_8pipeline17AggSinkLocalState30_emplace_into_hash_table_limitEPPcPNS6_5BlockERKSt6vectorIiSaIiEERSE_IPKNS6_7IColumnESaISL_EEjE3$_0ZNS9_30_emplace_into_hash_table_limitESB_SD_SI_SO_jE3$_1EEERSt7variantIJSt9monostateNS6_16MethodSerializedI9PHHashMapINS5_9StringRefESA_11DefaultHashISX_vEEEENS6_15MethodOneNumberIhSW_IhSA_9HashCRC32IhEEEENS12_ItSW_ItSA_S13_ItEEEENS12_IjSW_IjSA_S13_IjEEEENS12_ImSW_ImSA_S13_ImEEEENS6_19MethodStringNoCacheINS5_13StringHashMapISA_NS5_9AllocatorILb1ELb1ELb0ENS5_22DefaultMemoryAllocatorELb1EEEEEEENS12_IN4wide7integerILm128EjEESW_IS1P_SA_S13_IS1P_EEEENS12_INS1O_ILm256EjEESW_IS1T_SA_S13_IS1T_EEEENS12_IjSW_IjSA_14HashMixWrapperIjS1A_EEEENS12_ImSW_ImSA_S1X_ImS1D_EEEENS6_26MethodSingleNullableColumnINS12_IhNS6_15DataWithNullKeyIS15_EEEEEENS24_INS12_ItNS25_IS18_EEEEEENS24_INS12_IjNS25_IS1B_EEEEEENS24_INS12_ImNS25_IS1E_EEEEEENS24_INS12_IjNS25_IS1Z_EEEEEENS24_INS12_ImNS25_IS22_EEEEEENS24_INS12_IS1P_NS25_IS1R_EEEEEENS24_INS12_IS1T_NS25_IS1V_EEEEEENS24_INS1G_INS25_IS1L_EEEEEENS6_15MethodKeysFixedIS1E_EENS2X_IS1R_EENS2X_IS1V_EENS2X_ISW_INS6_7UInt136ESA_S13_IS31_EEEEEEEJEEESt16integer_sequenceImJLm11EEEE14__visit_invokeESS_S36_ at /mnt/disk8/zhangsida/install_data/ldb_toolchain_robin/ldb_toolchain/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/variant:1032
 8# doris::pipeline::AggSinkLocalState::_emplace_into_hash_table_limit(char**, doris::vectorized::Block*, std::vector<int, std::allocator<int> > const&, std::vector<doris::vectorized::IColumn const*, std::allocator<doris::vectorized::IColumn const*> >&, unsigned int) at /mnt/disk8/zhangsida/doris/be/src/pipeline/exec/aggregation_sink_operator.cpp:584
 9# doris::Status doris::pipeline::AggSinkLocalState::_execute_with_serialized_key_helper<true>(doris::vectorized::Block*) at /mnt/disk8/zhangsida/doris/be/src/pipeline/exec/aggregation_sink_operator.cpp:496
10# doris::pipeline::AggSinkLocalState::_execute_with_serialized_key(doris::vectorized::Block*) at /mnt/disk8/zhangsida/doris/be/src/pipeline/exec/aggregation_sink_operator.cpp:443
11# doris::pipeline::AggSinkLocalState::Executor<false, false>::execute(doris::pipeline::AggSinkLocalState*, doris::vectorized::Block*) at /mnt/disk8/zhangsida/doris/be/src/pipeline/exec/aggregation_sink_operator.h:62
```

```
                                try {
                                    HashMethodType::try_presis_key_and_origin(key, origin,
                                                                              _agg_arena_pool);
                                    auto mapped =
                                            _shared_state->aggregate_data_container->append_data(
                                                    origin);
                                    auto st = _create_agg_status(mapped);
                                    if (!st) {
                                        throw Exception(st.code(), st.to_string());
                                    }
                                    ctor(key, mapped);
                                   _shared_state->refresh_top_limit(i, key_columns);
                                } catch (...) {
                                    // Exception-safety - if it can not allocate memory or create status,
                                    // the destructors will not be called.
                                    ctor(key, nullptr);
                                    throw;
                                }
```

when _shared_state->refresh_top_limit(i, key_columns); throw exception
will exectue ctor(key, nullptr);, but before have exectue ctor(key,
mapped)

None

- Test <!-- At least one of them must be included. -->
    - [ ] 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 <!-- Add your reason?  -->

- Behavior changed:
    - [ ] No.
    - [ ] Yes. <!-- Explain the behavior change -->

- Does this need documentation?
    - [ ] No.
- [ ] Yes. <!-- Add document PR link here. eg:
apache/doris-website#1214 -->

- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR
should merge into -->
morrySnow pushed a commit that referenced this pull request Aug 4, 2025
dataroaring pushed a commit that referenced this pull request Sep 5, 2025
… key twice (#54137) (#54271)

### What problem does this PR solve?
Problem Summary:
cherry-pick from master  (#54137)

### Release note

None

### Check List (For Author)

- Test <!-- At least one of them must be included. -->
    - [ ] 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 <!-- Add your reason?  -->

- Behavior changed:
    - [ ] No.
    - [ ] Yes. <!-- Explain the behavior change -->

- Does this need documentation?
    - [ ] No.
- [ ] Yes. <!-- Add document PR link here. eg:
apache/doris-website#1214 -->

### Check List (For Reviewer who merge this PR)

- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR
should merge into -->
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.9-merged dev/3.1.0-merged reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants