Skip to content

Conversation

@amorynan
Copy link
Contributor

@amorynan amorynan commented Apr 14, 2025

What problem does this PR solve?

somehow in sort situation we meet an empty block in some operator. so we should deal with empty column in column_variant. otherwise we may meet core like :

SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /mnt/disk2/wangqiannan/amory/master/doris/be/src/vec/common/cow.h:198:12 in
*** Query id: f7c99aba0f494e70-8a36947b66383aa7 ***
*** is nereids: 1 ***
*** tablet id: 0 ***
*** Aborted at 1744620857 (unix time) try "date -d @1744620857" if you are using GNU date ***
*** Current BE git commitID: 62a58bff4c ***
*** SIGSEGV address not mapped to object (@0x0) received by PID 483713 (TID 489737 OR 0x7fd98093e700) from PID 0; stack trace: ***
 0# doris::signal::(anonymous namespace)::FailureSignalHandler(int, siginfo_t*, void*) at /mnt/disk2/wangqiannan/amory/master/doris/be/src/common/signal_handler.h:421
 1# PosixSignals::chained_handler(int, siginfo*, void*) [clone .part.0] in /mnt/disk2/wangqiannan/tool/jdk-17.0.10/lib/server/libjvm.so
 2# JVM_handle_linux_signal in /mnt/disk2/wangqiannan/tool/jdk-17.0.10/lib/server/libjvm.so
 3# 0x00007FE4D07005B0 in /lib64/libc.so.6
 4# COW<doris::vectorized::IColumn>::intrusive_ptr<doris::vectorized::IColumn const>::operator->() const at /mnt/disk2/wangqiannan/amory/master/doris/be/src/vec/common/cow.h:198
 5# COW<doris::vectorized::IColumn>::chameleon_ptr<doris::vectorized::IColumn>::operator*() at /mnt/disk2/wangqiannan/amory/master/doris/be/src/vec/common/cow.h:340
 6# doris::vectorized::ColumnObject::Subcolumn::get_finalized_column() at /mnt/disk2/wangqiannan/amory/master/doris/be/src/vec/columns/column_object.cpp:744
 7# COW<doris::vectorized::IColumn>::mutable_ptr<doris::vectorized::IColumn> doris::vectorized::ColumnObject::apply_for_subcolumns<doris::vectorized::ColumnObject::permute(doris::vectorized::PODArray<unsigned long, 4096ul, Allocator<false, false, false, DefaultMemoryAllocator>, 16ul, 15ul> const&, unsigned long) const::$_0>(doris::vectorized::ColumnObject::permute(doris::vectorized::PODArray<unsigned long, 4096ul, Allocator<false, false, false, DefaultMemoryAllocator>, 16ul, 15ul> const&, unsigned long) const::$_0&&) const at /mnt/disk2/wangqiannan/amory/master/doris/be/src/vec/columns/column_object.cpp:625
 8# doris::vectorized::ColumnObject::permute(doris::vectorized::PODArray<unsigned long, 4096ul, Allocator<false, false, false, DefaultMemoryAllocator>, 16ul, 15ul> const&, unsigned long) const at /mnt/disk2/wangqiannan/amory/master/doris/be/src/vec/columns/column_object.cpp:1125
 9# doris::vectorized::ColumnNullable::permute(doris::vectorized::PODArray<unsigned long, 4096ul, Allocator<false, false, false, DefaultMemoryAllocator>, 16ul, 15ul> const&, unsigned long) const at /mnt/disk2/wangqiannan/amory/master/doris/be/src/vec/columns/column_nullable.cpp:382
10# doris::vectorized::sort_block(doris::vectorized::Block&, doris::vectorized::Block&, std::vector<doris::vectorized::SortColumnDescription, std::allocator<doris::vectorized::SortColumnDescription> > const&, unsigned long) at /mnt/disk2/wangqiannan/amory/master/doris/be/src/vec/core/sort_block.cpp:66
11# doris::vectorized::Sorter::partial_sort(doris::vectorized::Block&, doris::vectorized::Block&) at /mnt/disk2/wangqiannan/amory/master/doris/be/src/vec/common/sort/sorter.cpp:203
12# doris::vectorized::PartitionSorter::append_block(doris::vectorized::Block*) at /mnt/disk2/wangqiannan/amory/master/doris/be/src/vec/common/sort/partition_sorter.cpp:60
13# doris::pipeline::PartitionSortSinkOperatorX::sink(doris::RuntimeState*, doris::vectorized::Block*, bool) at /mnt/disk2/wangqiannan/amory/master/doris/be/src/pipeline/exec/partition_sort_sink_operator.cpp:215
14# doris::pipeline::PipelineTask::execute(bool*)::$_1::operator()() const at /mnt/disk2/wangqiannan/amory/master/doris/be/src/pipeline/pipeline_task.cpp:392
15# doris::pipeline::PipelineTask::execute(bool*) at /mnt/disk2/wangqiannan/amory/master/doris/be/src/pipeline/pipeline_task.cpp:395
16# doris::pipeline::TaskScheduler::_do_work(unsigned long) at /mnt/disk2/wangqiannan/amory/master/doris/be/src/pipeline/task_scheduler.cpp:138
17# doris::pipeline::TaskScheduler::start()::$_0::operator()() const at /mnt/disk2/wangqiannan/amory/master/doris/be/src/pipeline/task_scheduler.cpp:64
18# void std::__invoke_impl<

Issue Number: close #xxx

Related PR: #xxx

Problem Summary:

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?

@amorynan
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	25771	5057	4983	4983
q2	2052	292	186	186
q3	10370	1244	699	699
q4	10216	1001	531	531
q5	7535	2310	2344	2310
q6	183	162	129	129
q7	908	758	614	614
q8	9301	1215	1094	1094
q9	6809	5159	5117	5117
q10	6863	2303	1886	1886
q11	496	281	267	267
q12	355	359	220	220
q13	17772	3652	3116	3116
q14	231	228	210	210
q15	525	485	483	483
q16	615	605	591	591
q17	594	850	358	358
q18	7637	7146	7087	7087
q19	2172	995	564	564
q20	325	340	230	230
q21	3944	3372	2516	2516
q22	1043	1036	940	940
Total cold run time: 115717 ms
Total hot run time: 34131 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5224	5137	5448	5137
q2	243	336	237	237
q3	2190	2663	2259	2259
q4	1414	1843	1466	1466
q5	4426	4389	4392	4389
q6	221	175	125	125
q7	2004	1909	1764	1764
q8	2582	2710	2566	2566
q9	7304	7194	7047	7047
q10	2979	3183	2735	2735
q11	587	518	508	508
q12	670	769	617	617
q13	3494	3931	3308	3308
q14	287	326	280	280
q15	505	476	479	476
q16	668	661	648	648
q17	1174	1547	1397	1397
q18	7666	7581	7347	7347
q19	874	887	996	887
q20	1938	1981	1833	1833
q21	5260	4769	4743	4743
q22	1089	1096	984	984
Total cold run time: 52799 ms
Total hot run time: 50753 ms

@doris-robot
Copy link

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

query1	1397	1107	1055	1055
query2	6232	1900	1844	1844
query3	10997	4550	4700	4550
query4	53800	25426	22947	22947
query5	5016	578	465	465
query6	342	205	194	194
query7	4888	509	288	288
query8	325	261	250	250
query9	5702	2614	2618	2614
query10	445	325	275	275
query11	15040	15118	14774	14774
query12	164	112	107	107
query13	1048	518	400	400
query14	10287	6579	6525	6525
query15	210	194	183	183
query16	7128	671	504	504
query17	1101	733	617	617
query18	1563	424	331	331
query19	194	207	187	187
query20	139	120	120	120
query21	213	127	109	109
query22	4344	4567	4301	4301
query23	34369	33294	33566	33294
query24	6510	2457	2436	2436
query25	484	471	405	405
query26	716	272	154	154
query27	2247	525	348	348
query28	3115	2466	2443	2443
query29	586	559	428	428
query30	273	232	204	204
query31	847	894	818	818
query32	79	64	63	63
query33	458	364	305	305
query34	779	888	516	516
query35	806	840	750	750
query36	946	998	931	931
query37	129	100	73	73
query38	4108	4286	4247	4247
query39	1536	1456	1614	1456
query40	232	123	109	109
query41	66	52	56	52
query42	125	115	111	111
query43	499	526	497	497
query44	1397	853	823	823
query45	184	182	173	173
query46	860	1041	659	659
query47	1852	1843	1783	1783
query48	403	423	309	309
query49	720	517	428	428
query50	674	706	408	408
query51	4277	4405	4299	4299
query52	111	119	105	105
query53	243	263	194	194
query54	609	607	522	522
query55	85	80	82	80
query56	304	295	284	284
query57	1172	1173	1105	1105
query58	270	270	276	270
query59	2659	2754	2715	2715
query60	325	324	317	317
query61	131	128	128	128
query62	766	788	695	695
query63	231	204	187	187
query64	1816	1059	710	710
query65	4401	4233	4238	4233
query66	729	397	296	296
query67	15882	15453	15443	15443
query68	6544	891	522	522
query69	539	305	277	277
query70	1212	1135	1141	1135
query71	509	317	296	296
query72	5901	4700	4455	4455
query73	1458	603	343	343
query74	9027	8814	8749	8749
query75	3970	3204	2690	2690
query76	4265	1211	791	791
query77	711	391	285	285
query78	9881	10113	9279	9279
query79	3367	809	567	567
query80	621	509	441	441
query81	479	259	218	218
query82	454	125	93	93
query83	326	258	227	227
query84	293	106	79	79
query85	788	346	315	315
query86	335	305	282	282
query87	4465	4547	4434	4434
query88	3265	2263	2257	2257
query89	402	316	336	316
query90	1981	217	209	209
query91	147	140	109	109
query92	73	61	57	57
query93	1750	929	575	575
query94	672	450	312	312
query95	367	287	293	287
query96	483	575	277	277
query97	3226	3286	3177	3177
query98	241	227	209	209
query99	1468	1440	1296	1296
Total cold run time: 298806 ms
Total hot run time: 193005 ms

@doris-robot
Copy link

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

query1	0.04	0.03	0.03
query2	0.13	0.11	0.11
query3	0.25	0.20	0.20
query4	1.59	0.19	0.19
query5	0.57	0.59	0.58
query6	1.18	0.72	0.72
query7	0.02	0.02	0.02
query8	0.04	0.04	0.04
query9	0.57	0.53	0.51
query10	0.57	0.57	0.57
query11	0.15	0.11	0.11
query12	0.15	0.10	0.11
query13	0.62	0.59	0.60
query14	2.68	2.68	2.73
query15	0.91	0.86	0.85
query16	0.39	0.38	0.40
query17	1.06	1.04	1.07
query18	0.21	0.20	0.20
query19	1.96	1.97	1.81
query20	0.02	0.01	0.01
query21	15.37	0.90	0.54
query22	0.76	1.30	0.71
query23	14.75	1.41	0.60
query24	7.41	1.12	1.10
query25	0.54	0.30	0.06
query26	0.49	0.16	0.13
query27	0.05	0.05	0.05
query28	9.55	0.89	0.44
query29	12.54	3.98	3.29
query30	0.26	0.09	0.07
query31	2.82	0.58	0.38
query32	3.23	0.55	0.48
query33	3.08	3.00	3.11
query34	15.79	5.09	4.49
query35	4.55	4.54	4.53
query36	0.66	0.50	0.48
query37	0.08	0.06	0.06
query38	0.05	0.04	0.04
query39	0.03	0.03	0.03
query40	0.18	0.13	0.12
query41	0.08	0.02	0.02
query42	0.03	0.03	0.02
query43	0.04	0.03	0.03
Total cold run time: 105.45 s
Total hot run time: 31.41 s

@doris-robot
Copy link

BE UT Coverage Report

Increment line coverage 25.00% (1/4) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 52.46% (14116/26908)
Line Coverage 41.37% (122379/295842)
Region Coverage 40.09% (62277/155356)
Branch Coverage 34.79% (31264/89866)

dataroaring
dataroaring previously approved these changes Apr 15, 2025
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 Apr 15, 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.

@amorynan
Copy link
Contributor Author

run buildall

@github-actions github-actions bot removed the approved Indicates a PR has been approved by one committer. label Apr 15, 2025
@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	25859	5079	5040	5040
q2	2076	292	186	186
q3	10375	1242	731	731
q4	10215	1002	543	543
q5	7560	2393	2367	2367
q6	187	167	134	134
q7	906	784	610	610
q8	9303	1279	1040	1040
q9	6736	5061	5129	5061
q10	6827	2301	1906	1906
q11	463	298	263	263
q12	346	347	214	214
q13	17770	3722	3118	3118
q14	220	217	210	210
q15	543	500	504	500
q16	637	616	605	605
q17	605	863	374	374
q18	7486	7240	7028	7028
q19	1076	941	572	572
q20	330	335	234	234
q21	4520	3527	2605	2605
q22	1070	1049	1002	1002
Total cold run time: 115110 ms
Total hot run time: 34343 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5163	5069	5051	5051
q2	233	319	229	229
q3	2237	2708	2347	2347
q4	1401	1818	1441	1441
q5	4545	4490	4398	4398
q6	206	165	124	124
q7	1980	1897	1766	1766
q8	2594	2654	2586	2586
q9	7091	7096	7097	7096
q10	3021	3225	2766	2766
q11	564	507	489	489
q12	672	773	641	641
q13	3452	3928	3275	3275
q14	278	299	274	274
q15	543	497	493	493
q16	656	685	632	632
q17	1153	1607	1351	1351
q18	7730	7563	7496	7496
q19	857	856	861	856
q20	2048	2071	1867	1867
q21	5399	4868	4621	4621
q22	1076	1049	998	998
Total cold run time: 52899 ms
Total hot run time: 50797 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 187044 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 3818f9553bc4b986bb41b4f39afca5c71c1dbe28, data reload: false

query1	1010	477	483	477
query2	6565	1890	1897	1890
query3	6762	231	214	214
query4	26393	24105	23450	23450
query5	4462	625	462	462
query6	299	195	191	191
query7	4631	492	287	287
query8	290	240	238	238
query9	8633	2611	2626	2611
query10	497	340	269	269
query11	15334	15068	14919	14919
query12	158	115	108	108
query13	1657	514	383	383
query14	8991	6237	6150	6150
query15	194	219	169	169
query16	7161	645	485	485
query17	1199	709	555	555
query18	1971	401	295	295
query19	188	187	159	159
query20	117	124	123	123
query21	212	119	102	102
query22	4175	4193	4004	4004
query23	33738	33002	32992	32992
query24	8458	2407	2396	2396
query25	554	451	398	398
query26	1249	274	156	156
query27	2749	524	341	341
query28	4334	2436	2415	2415
query29	753	561	450	450
query30	288	219	186	186
query31	907	855	763	763
query32	75	66	68	66
query33	598	388	323	323
query34	778	886	528	528
query35	785	838	758	758
query36	935	964	876	876
query37	126	109	81	81
query38	4106	4050	4065	4050
query39	1474	1430	1386	1386
query40	216	129	112	112
query41	62	57	59	57
query42	125	106	108	106
query43	509	505	471	471
query44	1342	810	815	810
query45	184	176	174	174
query46	834	1054	641	641
query47	1731	1789	1722	1722
query48	372	428	300	300
query49	814	541	451	451
query50	657	720	411	411
query51	4170	4202	4179	4179
query52	111	116	108	108
query53	225	261	200	200
query54	606	593	530	530
query55	128	84	87	84
query56	308	296	284	284
query57	1115	1152	1073	1073
query58	265	249	255	249
query59	2609	2703	2526	2526
query60	342	322	310	310
query61	130	131	126	126
query62	828	741	654	654
query63	234	198	187	187
query64	4347	1031	674	674
query65	4392	4267	4266	4266
query66	1136	429	303	303
query67	15532	15621	15226	15226
query68	8644	886	511	511
query69	461	366	266	266
query70	1237	1126	1116	1116
query71	464	315	298	298
query72	5682	4777	4969	4777
query73	741	677	348	348
query74	8931	9161	8975	8975
query75	3919	3214	2682	2682
query76	3636	1209	784	784
query77	794	400	285	285
query78	9943	10172	9293	9293
query79	2370	830	568	568
query80	617	522	468	468
query81	479	264	228	228
query82	449	135	99	99
query83	284	256	240	240
query84	289	102	87	87
query85	789	353	391	353
query86	360	295	293	293
query87	4405	4525	4442	4442
query88	2893	2237	2227	2227
query89	389	319	287	287
query90	1933	211	215	211
query91	141	149	114	114
query92	77	62	58	58
query93	1122	950	587	587
query94	663	422	316	316
query95	374	296	294	294
query96	489	570	276	276
query97	3159	3220	3120	3120
query98	236	233	211	211
query99	1434	1382	1290	1290
Total cold run time: 273534 ms
Total hot run time: 187044 ms

@doris-robot
Copy link

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

query1	0.04	0.04	0.03
query2	0.13	0.11	0.10
query3	0.26	0.19	0.19
query4	1.59	0.20	0.20
query5	0.61	0.56	0.58
query6	1.19	0.72	0.72
query7	0.03	0.01	0.01
query8	0.04	0.03	0.03
query9	0.57	0.55	0.52
query10	0.57	0.59	0.57
query11	0.15	0.11	0.12
query12	0.15	0.11	0.12
query13	0.62	0.60	0.59
query14	2.67	2.68	2.73
query15	0.92	0.88	0.85
query16	0.38	0.40	0.39
query17	1.01	1.03	1.01
query18	0.21	0.19	0.19
query19	1.92	1.84	1.90
query20	0.01	0.01	0.01
query21	15.35	0.91	0.55
query22	0.76	1.24	0.69
query23	14.90	1.38	0.64
query24	7.44	0.83	1.10
query25	0.51	0.20	0.07
query26	0.53	0.17	0.15
query27	0.06	0.05	0.04
query28	9.60	0.95	0.44
query29	12.54	3.95	3.29
query30	0.25	0.10	0.06
query31	2.82	0.58	0.38
query32	3.22	0.55	0.50
query33	3.02	3.01	3.11
query34	15.74	5.14	4.51
query35	4.54	4.55	4.54
query36	0.66	0.49	0.47
query37	0.09	0.07	0.06
query38	0.04	0.04	0.04
query39	0.03	0.02	0.02
query40	0.16	0.13	0.14
query41	0.08	0.03	0.03
query42	0.04	0.02	0.02
query43	0.04	0.03	0.03
Total cold run time: 105.49 s
Total hot run time: 31.21 s

Copy link
Member

@eldenmoon eldenmoon 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 Apr 15, 2025
@github-actions
Copy link
Contributor

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

@hello-stephen
Copy link
Contributor

BE UT Coverage Report

Increment line coverage 25.00% (1/4) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 52.46% (14115/26908)
Line Coverage 41.37% (122404/295845)
Region Coverage 40.09% (62283/155356)
Branch Coverage 34.80% (31269/89866)

@eldenmoon eldenmoon merged commit ca37805 into apache:master Apr 16, 2025
26 of 28 checks passed
seawinde pushed a commit to seawinde/doris that referenced this pull request Apr 17, 2025
…pache#50032)

somehow in sort situation we meet an empty block in some operator. so we
should deal with empty column in column_variant. otherwise we may meet
core like :
```
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /mnt/disk2/wangqiannan/amory/master/doris/be/src/vec/common/cow.h:198:12 in
*** Query id: f7c99aba0f494e70-8a36947b66383aa7 ***
*** is nereids: 1 ***
*** tablet id: 0 ***
*** Aborted at 1744620857 (unix time) try "date -d @1744620857" if you are using GNU date ***
*** Current BE git commitID: 62a58bf ***
*** SIGSEGV address not mapped to object (@0x0) received by PID 483713 (TID 489737 OR 0x7fd98093e700) from PID 0; stack trace: ***
 0# doris::signal::(anonymous namespace)::FailureSignalHandler(int, siginfo_t*, void*) at /mnt/disk2/wangqiannan/amory/master/doris/be/src/common/signal_handler.h:421
 1# PosixSignals::chained_handler(int, siginfo*, void*) [clone .part.0] in /mnt/disk2/wangqiannan/tool/jdk-17.0.10/lib/server/libjvm.so
 2# JVM_handle_linux_signal in /mnt/disk2/wangqiannan/tool/jdk-17.0.10/lib/server/libjvm.so
 3# 0x00007FE4D07005B0 in /lib64/libc.so.6
 4# COW<doris::vectorized::IColumn>::intrusive_ptr<doris::vectorized::IColumn const>::operator->() const at /mnt/disk2/wangqiannan/amory/master/doris/be/src/vec/common/cow.h:198
 5# COW<doris::vectorized::IColumn>::chameleon_ptr<doris::vectorized::IColumn>::operator*() at /mnt/disk2/wangqiannan/amory/master/doris/be/src/vec/common/cow.h:340
 6# doris::vectorized::ColumnObject::Subcolumn::get_finalized_column() at /mnt/disk2/wangqiannan/amory/master/doris/be/src/vec/columns/column_object.cpp:744
 7# COW<doris::vectorized::IColumn>::mutable_ptr<doris::vectorized::IColumn> doris::vectorized::ColumnObject::apply_for_subcolumns<doris::vectorized::ColumnObject::permute(doris::vectorized::PODArray<unsigned long, 4096ul, Allocator<false, false, false, DefaultMemoryAllocator>, 16ul, 15ul> const&, unsigned long) const::$_0>(doris::vectorized::ColumnObject::permute(doris::vectorized::PODArray<unsigned long, 4096ul, Allocator<false, false, false, DefaultMemoryAllocator>, 16ul, 15ul> const&, unsigned long) const::$_0&&) const at /mnt/disk2/wangqiannan/amory/master/doris/be/src/vec/columns/column_object.cpp:625
 8# doris::vectorized::ColumnObject::permute(doris::vectorized::PODArray<unsigned long, 4096ul, Allocator<false, false, false, DefaultMemoryAllocator>, 16ul, 15ul> const&, unsigned long) const at /mnt/disk2/wangqiannan/amory/master/doris/be/src/vec/columns/column_object.cpp:1125
 9# doris::vectorized::ColumnNullable::permute(doris::vectorized::PODArray<unsigned long, 4096ul, Allocator<false, false, false, DefaultMemoryAllocator>, 16ul, 15ul> const&, unsigned long) const at /mnt/disk2/wangqiannan/amory/master/doris/be/src/vec/columns/column_nullable.cpp:382
10# doris::vectorized::sort_block(doris::vectorized::Block&, doris::vectorized::Block&, std::vector<doris::vectorized::SortColumnDescription, std::allocator<doris::vectorized::SortColumnDescription> > const&, unsigned long) at /mnt/disk2/wangqiannan/amory/master/doris/be/src/vec/core/sort_block.cpp:66
11# doris::vectorized::Sorter::partial_sort(doris::vectorized::Block&, doris::vectorized::Block&) at /mnt/disk2/wangqiannan/amory/master/doris/be/src/vec/common/sort/sorter.cpp:203
12# doris::vectorized::PartitionSorter::append_block(doris::vectorized::Block*) at /mnt/disk2/wangqiannan/amory/master/doris/be/src/vec/common/sort/partition_sorter.cpp:60
13# doris::pipeline::PartitionSortSinkOperatorX::sink(doris::RuntimeState*, doris::vectorized::Block*, bool) at /mnt/disk2/wangqiannan/amory/master/doris/be/src/pipeline/exec/partition_sort_sink_operator.cpp:215
14# doris::pipeline::PipelineTask::execute(bool*)::$_1::operator()() const at /mnt/disk2/wangqiannan/amory/master/doris/be/src/pipeline/pipeline_task.cpp:392
15# doris::pipeline::PipelineTask::execute(bool*) at /mnt/disk2/wangqiannan/amory/master/doris/be/src/pipeline/pipeline_task.cpp:395
16# doris::pipeline::TaskScheduler::_do_work(unsigned long) at /mnt/disk2/wangqiannan/amory/master/doris/be/src/pipeline/task_scheduler.cpp:138
17# doris::pipeline::TaskScheduler::start()::$_0::operator()() const at /mnt/disk2/wangqiannan/amory/master/doris/be/src/pipeline/task_scheduler.cpp:64
18# void std::__invoke_impl<
```
@eldenmoon eldenmoon added the usercase Important user case type label label Apr 18, 2025
dataroaring pushed a commit that referenced this pull request Apr 18, 2025
koarz pushed a commit to koarz/doris that referenced this pull request Jun 4, 2025
…pache#50032)

somehow in sort situation we meet an empty block in some operator. so we
should deal with empty column in column_variant. otherwise we may meet
core like :
```
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /mnt/disk2/wangqiannan/amory/master/doris/be/src/vec/common/cow.h:198:12 in
*** Query id: f7c99aba0f494e70-8a36947b66383aa7 ***
*** is nereids: 1 ***
*** tablet id: 0 ***
*** Aborted at 1744620857 (unix time) try "date -d @1744620857" if you are using GNU date ***
*** Current BE git commitID: 62a58bf ***
*** SIGSEGV address not mapped to object (@0x0) received by PID 483713 (TID 489737 OR 0x7fd98093e700) from PID 0; stack trace: ***
 0# doris::signal::(anonymous namespace)::FailureSignalHandler(int, siginfo_t*, void*) at /mnt/disk2/wangqiannan/amory/master/doris/be/src/common/signal_handler.h:421
 1# PosixSignals::chained_handler(int, siginfo*, void*) [clone .part.0] in /mnt/disk2/wangqiannan/tool/jdk-17.0.10/lib/server/libjvm.so
 2# JVM_handle_linux_signal in /mnt/disk2/wangqiannan/tool/jdk-17.0.10/lib/server/libjvm.so
 3# 0x00007FE4D07005B0 in /lib64/libc.so.6
 4# COW<doris::vectorized::IColumn>::intrusive_ptr<doris::vectorized::IColumn const>::operator->() const at /mnt/disk2/wangqiannan/amory/master/doris/be/src/vec/common/cow.h:198
 5# COW<doris::vectorized::IColumn>::chameleon_ptr<doris::vectorized::IColumn>::operator*() at /mnt/disk2/wangqiannan/amory/master/doris/be/src/vec/common/cow.h:340
 6# doris::vectorized::ColumnObject::Subcolumn::get_finalized_column() at /mnt/disk2/wangqiannan/amory/master/doris/be/src/vec/columns/column_object.cpp:744
 7# COW<doris::vectorized::IColumn>::mutable_ptr<doris::vectorized::IColumn> doris::vectorized::ColumnObject::apply_for_subcolumns<doris::vectorized::ColumnObject::permute(doris::vectorized::PODArray<unsigned long, 4096ul, Allocator<false, false, false, DefaultMemoryAllocator>, 16ul, 15ul> const&, unsigned long) const::$_0>(doris::vectorized::ColumnObject::permute(doris::vectorized::PODArray<unsigned long, 4096ul, Allocator<false, false, false, DefaultMemoryAllocator>, 16ul, 15ul> const&, unsigned long) const::$_0&&) const at /mnt/disk2/wangqiannan/amory/master/doris/be/src/vec/columns/column_object.cpp:625
 8# doris::vectorized::ColumnObject::permute(doris::vectorized::PODArray<unsigned long, 4096ul, Allocator<false, false, false, DefaultMemoryAllocator>, 16ul, 15ul> const&, unsigned long) const at /mnt/disk2/wangqiannan/amory/master/doris/be/src/vec/columns/column_object.cpp:1125
 9# doris::vectorized::ColumnNullable::permute(doris::vectorized::PODArray<unsigned long, 4096ul, Allocator<false, false, false, DefaultMemoryAllocator>, 16ul, 15ul> const&, unsigned long) const at /mnt/disk2/wangqiannan/amory/master/doris/be/src/vec/columns/column_nullable.cpp:382
10# doris::vectorized::sort_block(doris::vectorized::Block&, doris::vectorized::Block&, std::vector<doris::vectorized::SortColumnDescription, std::allocator<doris::vectorized::SortColumnDescription> > const&, unsigned long) at /mnt/disk2/wangqiannan/amory/master/doris/be/src/vec/core/sort_block.cpp:66
11# doris::vectorized::Sorter::partial_sort(doris::vectorized::Block&, doris::vectorized::Block&) at /mnt/disk2/wangqiannan/amory/master/doris/be/src/vec/common/sort/sorter.cpp:203
12# doris::vectorized::PartitionSorter::append_block(doris::vectorized::Block*) at /mnt/disk2/wangqiannan/amory/master/doris/be/src/vec/common/sort/partition_sorter.cpp:60
13# doris::pipeline::PartitionSortSinkOperatorX::sink(doris::RuntimeState*, doris::vectorized::Block*, bool) at /mnt/disk2/wangqiannan/amory/master/doris/be/src/pipeline/exec/partition_sort_sink_operator.cpp:215
14# doris::pipeline::PipelineTask::execute(bool*)::$_1::operator()() const at /mnt/disk2/wangqiannan/amory/master/doris/be/src/pipeline/pipeline_task.cpp:392
15# doris::pipeline::PipelineTask::execute(bool*) at /mnt/disk2/wangqiannan/amory/master/doris/be/src/pipeline/pipeline_task.cpp:395
16# doris::pipeline::TaskScheduler::_do_work(unsigned long) at /mnt/disk2/wangqiannan/amory/master/doris/be/src/pipeline/task_scheduler.cpp:138
17# doris::pipeline::TaskScheduler::start()::$_0::operator()() const at /mnt/disk2/wangqiannan/amory/master/doris/be/src/pipeline/task_scheduler.cpp:64
18# void std::__invoke_impl<
```
suxiaogang223 pushed a commit to suxiaogang223/doris that referenced this pull request Jul 15, 2025
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/2.1.10-merged dev/3.0.5-merged p0_c reviewed usercase Important user case type label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants