You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/05/13 13:58:42 UTC

[GitHub] [incubator-doris] jacktengg opened a new pull request, #9556: [bugfix](vectorized) vectorized write: invalid memory access caused by podarray resize

jacktengg opened a new pull request, #9556:
URL: https://github.com/apache/incubator-doris/pull/9556

   
   # Proposed changes
   
   Issue Number: close #9525 
   
   ## Problem Summary:
   
   When converting bitmap and hll data to storage format, PaddedPODArray<char>::resize may relocate the underlying data, resulting in previously saved address of PaddedPODArray<char>::data() invalid.
   
   ## Checklist(Required)
   
   1. Does it affect the original behavior: (Yes/No/I Don't know)
   2. Has unit tests been added: (Yes/No/No Need)
   3. Has document been added or modified: (Yes/No/No Need)
   4. Does it need to update dependencies: (Yes/No)
   5. Are there any changes that cannot be rolled back: (Yes/No)
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at [dev@doris.apache.org](mailto:dev@doris.apache.org) by explaining why you chose the solution you did and what alternatives you considered, etc...
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] yiguolei merged pull request #9556: [bugfix](vectorized) vectorized write: invalid memory access caused by podarray resize

Posted by GitBox <gi...@apache.org>.
yiguolei merged PR #9556:
URL: https://github.com/apache/incubator-doris/pull/9556


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] yiguolei commented on a diff in pull request #9556: [bugfix](vectorized) vectorized write: invalid memory access caused by podarray resize

Posted by GitBox <gi...@apache.org>.
yiguolei commented on code in PR #9556:
URL: https://github.com/apache/incubator-doris/pull/9556#discussion_r872908130


##########
be/src/vec/olap/olap_data_convertor.cpp:
##########
@@ -296,13 +337,24 @@ Status OlapBlockDataConvertor::OlapColumnDataConvertorHLL::convert_to_olap() {
             slice_size = hll_value_cur->serialize((uint8_t*)raw_data);
             _raw_data.resize(old_size + slice_size);
 
-            slice->data = raw_data;
             slice->size = slice_size;
 
             ++slice;
             ++hll_value_cur;
         }
         assert(slice == _slice.get_end_ptr());
+
+        slice = _slice.data();
+        raw_data = _raw_data.data();
+        hll_value_cur = const_cast<HyperLogLog*>(column_hll->get_data().data() + _row_pos);
+
+        while (hll_value_cur != hll_value_end) {
+            slice->data = raw_data;
+            raw_data += slice->size;

Review Comment:
   could you please add the issue test case to regression test?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] github-actions[bot] commented on pull request #9556: [bugfix](vectorized) vectorized write: invalid memory access caused by podarray resize

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #9556:
URL: https://github.com/apache/incubator-doris/pull/9556#issuecomment-1126652013

   PR approved by anyone and no changes requested.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] jacktengg commented on a diff in pull request #9556: [bugfix](vectorized) vectorized write: invalid memory access caused by podarray resize

Posted by GitBox <gi...@apache.org>.
jacktengg commented on code in PR #9556:
URL: https://github.com/apache/incubator-doris/pull/9556#discussion_r872925495


##########
be/src/vec/olap/olap_data_convertor.cpp:
##########
@@ -222,6 +221,22 @@ Status OlapBlockDataConvertor::OlapColumnDataConvertorBitMap::convert_to_olap()
             ++bitmap_value_cur;
         }
         assert(nullmap_cur == _nullmap + _row_pos + _num_rows && slice == _slice.get_end_ptr());
+
+        slice = _slice.data();
+        raw_data = _raw_data.data();

Review Comment:
   fixed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] yiguolei commented on a diff in pull request #9556: [bugfix](vectorized) vectorized write: invalid memory access caused by podarray resize

Posted by GitBox <gi...@apache.org>.
yiguolei commented on code in PR #9556:
URL: https://github.com/apache/incubator-doris/pull/9556#discussion_r872907806


##########
be/src/vec/olap/olap_data_convertor.cpp:
##########
@@ -222,6 +221,22 @@ Status OlapBlockDataConvertor::OlapColumnDataConvertorBitMap::convert_to_olap()
             ++bitmap_value_cur;
         }
         assert(nullmap_cur == _nullmap + _row_pos + _num_rows && slice == _slice.get_end_ptr());
+
+        slice = _slice.data();
+        raw_data = _raw_data.data();

Review Comment:
   The previous code will resize the podarray when insert a bitmap everytime, it will call resize too many times, the performance is very bad.
   Maybe we could compute the podarray size at the beginning by tranverse all bitmap value. And call resize only one time.
   Then all the slice->data do not need re calculate any more. The code will be more simple.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org