Uh oh!
There was an error while loading. Please reload this page.
[fix](mem) heap-buffer-overflow for function convert_to - #46405
Conversation
Thearas
commented
Jan 3, 2025
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
cambyzju
commented
Jan 3, 2025
run buildall |
doris-robot
commented
Jan 3, 2025
TeamCity be ut coverage result: |
There was a problem hiding this comment.
Seems that this file should not be updated in this PR.
cambyzju
commented
Jan 5, 2025
run buildall |
doris-robot
commented
Jan 5, 2025
TPC-H: Total hot run time: 32346 ms |
doris-robot
commented
Jan 5, 2025
TPC-DS: Total hot run time: 190695 ms |
doris-robot
commented
Jan 5, 2025
ClickBench: Total hot run time: 31.47 s |
doris-robot
commented
Jan 5, 2025
TeamCity be ut coverage result: |
Uh oh!
There was an error while loading. Please reload this page.
PR approved by at least one committer and no changes requested. |
PR approved by anyone and no changes requested. |
### What problem does this PR solve?
Reproduce SQL with ASAN version:
`select convert('装装装装装' using gbk);`
Then be crashed:
```
=================================================================
==1830466==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x606002aeec20 at pc 0x560826fb3e66 bp 0x7fc3816a5890 sp 0x7fc3816a5058
WRITE of size 10 at 0x606002aeec20 thread T711 (brpc_light)
```
But if we use release version, we found the result is not correct, and
the memory maybe already corrupted:
```
> select convert('装装装装装' using gbk);
+---------------------------------------------------------+
| convert_to('装装装装装', 'gbk') |
+---------------------------------------------------------+
| ~zhuangdang~zhuangdang~zhuangdang~zhuangdang~zhu |
+---------------------------------------------------------+
1 row in set (0.04 sec)
```
The correct answer should be:
```
> select convert('装装装装装' using gbk);
+--------------------------------------+
| convert_to('装装装装装', 'gbk') |
+--------------------------------------+
| ~zhuang~zhuang~zhuang~zhuang~zhuang |
+--------------------------------------+
1 row in set (0.06 sec)
```Reproduce SQL with ASAN version:
`select convert('装装装装装' using gbk);`
Then be crashed:
```
=================================================================
==1830466==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x606002aeec20 at pc 0x560826fb3e66 bp 0x7fc3816a5890 sp 0x7fc3816a5058
WRITE of size 10 at 0x606002aeec20 thread T711 (brpc_light)
```
But if we use release version, we found the result is not correct, and
the memory maybe already corrupted:
```
> select convert('装装装装装' using gbk);
+---------------------------------------------------------+
| convert_to('装装装装装', 'gbk') |
+---------------------------------------------------------+
| ~zhuangdang~zhuangdang~zhuangdang~zhuangdang~zhu |
+---------------------------------------------------------+
1 row in set (0.04 sec)
```
The correct answer should be:
```
> select convert('装装装装装' using gbk);
+--------------------------------------+
| convert_to('装装装装装', 'gbk') |
+--------------------------------------+
| ~zhuang~zhuang~zhuang~zhuang~zhuang |
+--------------------------------------+
1 row in set (0.06 sec)
```
What problem does this PR solve?
Reproduce SQL with ASAN version:
select convert('装装装装装' using gbk);Then be crashed:
But if we use release version, we found the result is not correct, and the memory maybe already corrupted:
The correct answer should be:
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)