wangbo commented on a change in pull request #1944: Segment v2 use string's 
real length(#1943)
URL: https://github.com/apache/incubator-doris/pull/1944#discussion_r333807895
 
 

 ##########
 File path: be/src/olap/field.h
 ##########
 @@ -55,9 +55,11 @@ class Field {
     inline size_t field_size() const { return size() + 1; }
     inline size_t index_size() const { return _index_size; }
 
-    inline void set_to_max(char* buf) const { return 
_type_info->set_to_max(buf); }
+    virtual inline void set_to_max(char* buf) const { return 
_type_info->set_to_max(buf); }
+    //todo delete this method when segment v2 release
+    inline void set_to_max_v1(char* buf) const { return 
_type_info->set_to_max(buf); }
 
 Review comment:
   implement it the same with set_to_max means:
    when calling varchar field.set_to_max,using field._length to memset slice's 
data.
    but for segment v1, field._length is regarded as 
slice.size+sizeof(StringLengthType)
   So when calling segment v1 varchar field.set_max,the length of memset is 
beyond slice's actually size,this may cause subsequently tcmalloc core 
dumped.see error stack below:
   >#0  SLL_Next (t=0xffffffffffffffff) at src/linked_list.h:45
   >#1  SLL_TryPop (rv=<synthetic pointer>, list=0x436dce0) at 
src/linked_list.h:69
   >#2  TryPop (rv=<synthetic pointer>, this=0x436dce0) at 
src/thread_cache.h:220
   >#3  Allocate (oom_handler=0x25e5700 <tcmalloc::cpp_throw_oom(unsigned 
long)>, cl=5, size=64, this=<optimized out>) at src/thread_cache.h:379
   >#4  malloc_fast_path<tcmalloc::cpp_throw_oom> (size=64) at 
src/tcmalloc.cc:1855
   >#5  tc_new (size=64) at src/tcmalloc.cc:1976
   >#6  0x0000000000c21672 in doris::WrapperField::WrapperField 
(this=0x4e07d40, rep=<optimized out>, variable_len=<optimized out>, 
   >    is_string_type=<optimized out>) at 
/home/wangbo/incubator-doris/be/src/olap/wrapper_field.cpp:84
   >#7  0x0000000000c21b9e in doris::WrapperField::create (column=..., 
len=<optimized out>, len@entry=0)
   >    at /home/wangbo/incubator-doris/be/src/olap/wrapper_field.cpp:51
   >#8  0x0000000000cb88e1 in doris::ColumnDataWriter::init (this=0x4bc4780) at 
/home/wangbo/incubator-doris/be/src/olap/rowset/column_data_writer.cpp:72
   >#9  0x0000000000ca273c in doris::AlphaRowsetWriter::_init 
(this=this@entry=0x4bf83c0)
   >    at 
/home/wangbo/incubator-doris/be/src/olap/rowset/alpha_rowset_writer.cpp:275
   >#10 0x0000000000ca3694 in doris::AlphaRowsetWriter::init (this=0x4bf83c0, 
rowset_writer_context=...)
   >    at 
/home/wangbo/incubator-doris/be/src/olap/rowset/alpha_rowset_writer.cpp:73
   >#11 0x0000000000c91b03 in doris::RowsetFactory::create_rowset_writer 
(context=..., output=output@entry=0x7fffcdf75318)
   >    at /home/wangbo/incubator-doris/be/src/olap/rowset/rowset_factory.cpp:50
   >#12 0x0000000000bc9b3f in doris::TabletManager::_create_inital_rowset 
(this=this@entry=0x4d5a180, tablet=..., request=...)
   >    at /home/wangbo/incubator-doris/be/src/olap/tablet_manager.cpp:1250
   >#13 0x0000000000bcc919 in doris::TabletManager::_internal_create_tablet 
(this=this@entry=0x4d5a180, alter_type=alter_type@entry=doris::SCHEMA_CHANGE, 
   >    request=..., 
is_schema_change_tablet=is_schema_change_tablet@entry=false, ref_tablet=..., 
data_dirs=...)
   >    at /home/wangbo/incubator-doris/be/src/olap/tablet_manager.cpp:371
   >#14 0x0000000000bcdd72 in doris::TabletManager::create_tablet 
(this=this@entry=0x4d5a180, request=..., stores=...)
   >    at /home/wangbo/incubator-doris/be/src/olap/tablet_manager.cpp:318
   >#15 0x0000000000b82642 in doris::StorageEngine::create_tablet 
(this=<optimized out>, request=...)
   >    at /home/wangbo/incubator-doris/be/src/olap/storage_engine.cpp:760
   >#16 0x0000000000b4fac3 in doris::TestDeleteConditionHandler::SetUp 
(this=0x4e08460)
   >    at /home/wangbo/incubator-doris/be/test/olap/delete_handler_test.cpp:173
   >#17 0x0000000002530f37 in void 
testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, 
void>(testing::Test*, void (testing::Test::*)(), char const*) ()
   >#18 0x000000000252ba9c in void 
testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, 
void>(testing::Test*, void (testing::Test::*)(), char const*) ()
   >#19 0x0000000002510df7 in testing::Test::Run() ()
   >#20 0x00000000025116ce in testing::TestInfo::Run() ()
   >#21 0x0000000002511d25 in testing::TestCase::Run() ()
   >#22 0x0000000002518899 in testing::internal::UnitTestImpl::RunAllTests() ()
   >#23 0x0000000002531eb3 in bool 
testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl,
 bool>(testing::internal::UnitTestImpl*, bool 
(testing::internal::UnitTestImpl::*)(), char const*) ()
   >#24 0x000000000252c7a2 in bool 
testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl,
 bool>(testing::internal::UnitTestImpl*, bool 
(testing::internal::UnitTestImpl::*)(), char const*) ()
   >#25 0x0000000002517570 in testing::UnitTest::Run() ()
   >#26 0x00000000009fb316 in RUN_ALL_TESTS () at 
/home/wangbo/incubator-doris/thirdparty/installed/include/gtest/gtest.h:2233
   >#27 main (argc=<optimized out>, argv=0x7fffcdf75f88) at 
/home/wangbo/incubator-doris/be/test/olap/delete_handler_test.cpp:951
   
   it seems that memset memory to 0xff may effect tcmalloc logic

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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

Reply via email to