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/07/11 13:00:18 UTC

[GitHub] [doris] BiteTheDDDDt opened a new pull request, #10775: [Bug][Memtable] fix core dump on int128 because not aligned by 16 byte

BiteTheDDDDt opened a new pull request, #10775:
URL: https://github.com/apache/doris/pull/10775

   # Proposed changes
   
   Issue Number: close #10766
   only core dump on clang
   ## Problem Summary:
   
   Describe the overview of changes.
   
   ## 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] [doris] BiteTheDDDDt commented on pull request #10775: [Bug][Memtable] fix core dump on int128 because not aligned by 16 byte

Posted by GitBox <gi...@apache.org>.
BiteTheDDDDt commented on PR #10775:
URL: https://github.com/apache/doris/pull/10775#issuecomment-1180603761

   yes
   
   
   
   
   
   ------------------ Original ------------------
   From: Xinyi Zou ***@***.***&gt;
   Date: Mon,Jul 11,2022 11:55 PM
   To: apache/doris ***@***.***&gt;
   Cc: Pxl ***@***.***&gt;, Author ***@***.***&gt;
   Subject: Re: [apache/doris] [Bug][Memtable] fix core dump on int128 because not aligned by 16 byte (PR #10775)
   
   
   
   
   
   
   @xinyiZzz commented on this pull request.
   
   
   In be/src/runtime/mem_pool.h:
   &gt; @@ -104,9 +104,17 @@ class MemPool {     /// of the current chunk. Creates a new chunk if there aren't any chunks     /// with enough capacity.     uint8_t* allocate(int64_t size, Status* rst = nullptr) {+        // TODO: rethink if DEFAULT_ALIGNMENT should be 82, malloc is aligned by 16.
   Do you mean DEFAULT_ALIGNMENT changed from 8 to 16
   
   —
   Reply to this email directly, view it on GitHub, or unsubscribe.
   You are receiving this because you authored the thread.Message ID: ***@***.***&gt;


-- 
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] [doris] xinyiZzz commented on pull request #10775: [Bug][Memtable] fix core dump on int128 because not aligned by 16 byte

Posted by GitBox <gi...@apache.org>.
xinyiZzz commented on PR #10775:
URL: https://github.com/apache/doris/pull/10775#issuecomment-1181695091

   > yes
   > […](#)
   
   you can change it directly~


-- 
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] [doris] adonis0147 commented on a diff in pull request #10775: [Bug][Memtable] fix core dump on int128 because not aligned by 16 byte

Posted by GitBox <gi...@apache.org>.
adonis0147 commented on code in PR #10775:
URL: https://github.com/apache/doris/pull/10775#discussion_r924735680


##########
be/src/runtime/mem_pool.h:
##########
@@ -104,9 +104,17 @@ class MemPool {
     /// of the current chunk. Creates a new chunk if there aren't any chunks
     /// with enough capacity.
     uint8_t* allocate(int64_t size, Status* rst = nullptr) {
+        // TODO: rethink if DEFAULT_ALIGNMENT should be changed, malloc is aligned by 16.

Review Comment:
   Why not change `DEFAULT_ALIGNMENT` to 16?



-- 
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] [doris] dataroaring commented on a diff in pull request #10775: [Bug][Memtable] fix core dump on int128 because not aligned by 16 byte

Posted by GitBox <gi...@apache.org>.
dataroaring commented on code in PR #10775:
URL: https://github.com/apache/doris/pull/10775#discussion_r918002387


##########
be/src/olap/memtable.cpp:
##########
@@ -101,19 +101,14 @@ void MemTable::_init_agg_functions(const vectorized::Block* block) {
     }
 
     for (uint32_t cid = _schema->num_key_columns(); cid < _schema->num_columns(); ++cid) {
+        size_t alignment_of_state = _agg_functions[cid]->align_of_data();
+        size_t module = _total_size_of_aggregate_states % alignment_of_state;
+        if (module) {
+            _total_size_of_aggregate_states += alignment_of_state - module;
+        }

Review Comment:
   DCHECK(alignment_of_state & (alignment_of_state -1)  == 0);
   _total_size_of_aggregate_states = (_total_size_of_aggregate_states + alignment_of_state -1 )  & (~(alignment_of_state -1));



-- 
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] [doris] HappenLee commented on a diff in pull request #10775: [Bug][Memtable] fix core dump on int128 because not aligned by 16 byte

Posted by GitBox <gi...@apache.org>.
HappenLee commented on code in PR #10775:
URL: https://github.com/apache/doris/pull/10775#discussion_r918575131


##########
be/src/runtime/mem_pool.h:
##########
@@ -104,9 +104,17 @@ class MemPool {
     /// of the current chunk. Creates a new chunk if there aren't any chunks
     /// with enough capacity.
     uint8_t* allocate(int64_t size, Status* rst = nullptr) {
+        // TODO: rethink if DEFAULT_ALIGNMENT should be 82, malloc is aligned by 16.

Review Comment:
   not 82?



-- 
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] [doris] xinyiZzz commented on a diff in pull request #10775: [Bug][Memtable] fix core dump on int128 because not aligned by 16 byte

Posted by GitBox <gi...@apache.org>.
xinyiZzz commented on code in PR #10775:
URL: https://github.com/apache/doris/pull/10775#discussion_r918101331


##########
be/src/runtime/mem_pool.h:
##########
@@ -104,9 +104,17 @@ class MemPool {
     /// of the current chunk. Creates a new chunk if there aren't any chunks
     /// with enough capacity.
     uint8_t* allocate(int64_t size, Status* rst = nullptr) {
+        // TODO: rethink if DEFAULT_ALIGNMENT should be 82, malloc is aligned by 16.

Review Comment:
   Do you mean DEFAULT_ALIGNMENT changed from 8 to 16



-- 
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] [doris] github-actions[bot] commented on pull request #10775: [Bug][Memtable] fix core dump on int128 because not aligned by 16 byte

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

   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] [doris] BiteTheDDDDt commented on a diff in pull request #10775: [Bug][Memtable] fix core dump on int128 because not aligned by 16 byte

Posted by GitBox <gi...@apache.org>.
BiteTheDDDDt commented on code in PR #10775:
URL: https://github.com/apache/doris/pull/10775#discussion_r918022045


##########
be/src/olap/memtable.cpp:
##########
@@ -101,19 +101,14 @@ void MemTable::_init_agg_functions(const vectorized::Block* block) {
     }
 
     for (uint32_t cid = _schema->num_key_columns(); cid < _schema->num_columns(); ++cid) {
+        size_t alignment_of_state = _agg_functions[cid]->align_of_data();
+        size_t module = _total_size_of_aggregate_states % alignment_of_state;
+        if (module) {
+            _total_size_of_aggregate_states += alignment_of_state - module;
+        }

Review Comment:
   alignment_of_state just is `sizeof(FunctionData)`, not necessarily power of 2



-- 
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] [doris] HappenLee commented on pull request #10775: [Bug][Memtable] fix core dump on int128 because not aligned by 16 byte

Posted by GitBox <gi...@apache.org>.
HappenLee commented on PR #10775:
URL: https://github.com/apache/doris/pull/10775#issuecomment-1181696283

   LGTM


-- 
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] [doris] github-actions[bot] commented on pull request #10775: [Bug][Memtable] fix core dump on int128 because not aligned by 16 byte

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

   PR approved by at least one committer 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] [doris] yiguolei merged pull request #10775: [Bug][Memtable] fix core dump on int128 because not aligned by 16 byte

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


-- 
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