[ https://issues.apache.org/jira/browse/ARROW-17119?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17568289#comment-17568289 ]
Jin Chengcheng edited comment on ARROW-17119 at 7/19/22 3:05 AM: ----------------------------------------------------------------- I extract the relevant code {code:java} #define TYPE_FACTORY(NAME, KLASS) \ const std::shared_ptr<DataType>& NAME() { \ static std::shared_ptr<DataType> result = std::make_shared<KLASS>(); \ return result; \ } TYPE_FACTORY(null, NullType) TYPE_FACTORY(boolean, BooleanType) TYPE_FACTORY(int8, Int8Type) TYPE_FACTORY(uint8, UInt8Type) TYPE_FACTORY(int16, Int16Type) TYPE_FACTORY(uint16, UInt16Type) TYPE_FACTORY(int32, Int32Type) ARROW_EXPORT const std::shared_ptr<DataType>& int16(); const std::set<std::shared_ptr<DataType>> AsofJoinNode::kSupportedOnTypes_ = {int64()}; private: static const std::set<std::shared_ptr<DataType>> kSupportedOnTypes_; void InitStaticData() { // Signed int types g_signed_int_types = {int8(), int16(), int32(), int64()}; {code} was (Author: JIRAUSER292899): I extract the relevant code {code:java} #define TYPE_FACTORY(NAME, KLASS) \ const std::shared_ptr<DataType>& NAME() { \ static std::shared_ptr<DataType> result = std::make_shared<KLASS>(); \ return result; \ } TYPE_FACTORY(null, NullType) TYPE_FACTORY(boolean, BooleanType) TYPE_FACTORY(int8, Int8Type) TYPE_FACTORY(uint8, UInt8Type) TYPE_FACTORY(int16, Int16Type) TYPE_FACTORY(uint16, UInt16Type) TYPE_FACTORY(int32, Int32Type) ARROW_EXPORT const std::shared_ptr<DataType>& int16(); const std::set<std::shared_ptr<DataType>> AsofJoinNode::kSupportedOnTypes_ = {int64()}; private: static const std::set<std::shared_ptr<DataType>> kSupportedOnTypes_; {code} > [C++] Invalid free when run gluten project google test > ------------------------------------------------------ > > Key: ARROW-17119 > URL: https://issues.apache.org/jira/browse/ARROW-17119 > Project: Apache Arrow > Issue Type: Bug > Environment: ubuntu20 > Reporter: Jin Chengcheng > Assignee: Li Jin > Priority: Major > > When I run [gluten|[oap-project/gluten > (github.com)|https://github.com/oap-project/gluten]] project google test, it > will show a error message after all the simple tests passed. > {code:java} > gluten/cpp/build/src# ./exec_backend_test > Running main() from > /build/googletest-j5yxiC/googletest-1.10.0/googletest/src/gtest_main.cc > [==========] Running 2 tests from 1 test suite. > [----------] Global test environment set-up. > [----------] 2 tests from TestExecBackend > [ RUN ] TestExecBackend.CreateBackend > Set backend factory. > [ OK ] TestExecBackend.CreateBackend (0 ms) > [ RUN ] TestExecBackend.GetResultIterator > [ OK ] TestExecBackend.GetResultIterator (0 ms) > [----------] 2 tests from TestExecBackend (0 ms total)[----------] Global > test environment tear-down > [==========] 2 tests from 1 test suite ran. (0 ms total) > [ PASSED ] 2 tests. > corrupted size vs. prev_size in fastbins > Aborted (core dumped) > {code} > I use valgrind to detect, here is the details > {code:java} > // code placeholder > ==32256== Invalid read of size 8 > ==32256== at 0x5E493B7: std::set<std::shared_ptr<arrow::DataType>, > std::less<std::shared_ptr<arrow::DataType> >, > std::allocator<std::shared_ptr<arrow::DataType> > >::~set() (in > /mnt/jcc/code/gluten/cpp/build/releases/libarrow.so.900.0.0) > ==32256== by 0x77E0FDD: __cxa_finalize (cxa_finalize.c:83) > ==32256== by 0x5955816: ??? (in > /mnt/jcc/code/gluten/cpp/build/releases/libarrow.so.900.0.0) > ==32256== by 0x4011F6A: _dl_fini (dl-fini.c:138) > ==32256== by 0x77E08A6: __run_exit_handlers (exit.c:108) > ==32256== by 0x77E0A5F: exit (exit.c:139) > ==32256== by 0x77BE089: (below main) (libc-start.c:342) > ==32256== Address 0xd984680 is 16 bytes inside a block of size 48 free'd > ==32256== at 0x483CFBF: operator delete(void*) (in > /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) > ==32256== by 0x5E493CD: std::set<std::shared_ptr<arrow::DataType>, > std::less<std::shared_ptr<arrow::DataType> >, > std::allocator<std::shared_ptr<arrow::DataType> > >::~set() (in > /mnt/jcc/code/gluten/cpp/build/releases/libarrow.so.900.0.0) > ==32256== by 0x77E0FDD: __cxa_finalize (cxa_finalize.c:83) > ==32256== by 0x7FF65B6: ??? (in > /mnt/jcc/code/gluten/cpp/build/releases/libarrow_dataset_jni.so.900.0.0) > ==32256== by 0x4011F6A: _dl_fini (dl-fini.c:138) > ==32256== by 0x77E08A6: __run_exit_handlers (exit.c:108) > ==32256== by 0x77E0A5F: exit (exit.c:139) > ==32256== by 0x77BE089: (below main) (libc-start.c:342) > ==32256== Block was alloc'd at > ==32256== at 0x483BE63: operator new(unsigned long) (in > /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) > ==32256== by 0x5E4E5E9: std::set<std::shared_ptr<arrow::DataType>, > std::less<std::shared_ptr<arrow::DataType> >, > std::allocator<std::shared_ptr<arrow::DataType> > > >::set(std::initializer_list<std::shared_ptr<arrow::DataType> >, > std::less<std::shared_ptr<arrow::DataType> > const&, > std::allocator<std::shared_ptr<arrow::DataType> > const&) (in > /mnt/jcc/code/gluten/cpp/build/releases/libarrow.so.900.0.0) > ==32256== by 0x7FF4CC4: _GLOBAL__sub_I_asof_join_node.cc (in > /mnt/jcc/code/gluten/cpp/build/releases/libarrow_dataset_jni.so.900.0.0) > ==32256== by 0x4011B99: call_init.part.0 (dl-init.c:72) > ==32256== by 0x4011CA0: call_init (dl-init.c:30) > ==32256== by 0x4011CA0: _dl_init (dl-init.c:119) > ==32256== by 0x4001139: ??? (in /usr/lib/x86_64-linux-gnu/ld-2.31.so) > ==32256== > ==32256== Invalid free() / delete / delete[] / realloc() > ==32256== at 0x483CFBF: operator delete(void*) (in > /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) > ==32256== by 0x5E493CD: std::set<std::shared_ptr<arrow::DataType>, > std::less<std::shared_ptr<arrow::DataType> >, > std::allocator<std::shared_ptr<arrow::DataType> > >::~set() (in > /mnt/jcc/code/gluten/cpp/build/releases/libarrow.so.900.0.0) > ==32256== by 0x77E0FDD: __cxa_finalize (cxa_finalize.c:83) > ==32256== by 0x5955816: ??? (in > /mnt/jcc/code/gluten/cpp/build/releases/libarrow.so.900.0.0) > ==32256== by 0x4011F6A: _dl_fini (dl-fini.c:138) > ==32256== by 0x77E08A6: __run_exit_handlers (exit.c:108) > ==32256== by 0x77E0A5F: exit (exit.c:139) > ==32256== by 0x77BE089: (below main) (libc-start.c:342) > ==32256== Address 0xd984670 is 0 bytes inside a block of size 48 free'd > ==32256== at 0x483CFBF: operator delete(void*) (in > /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) > ==32256== by 0x5E493CD: std::set<std::shared_ptr<arrow::DataType>, > std::less<std::shared_ptr<arrow::DataType> >, > std::allocator<std::shared_ptr<arrow::DataType> > >::~set() (in > /mnt/jcc/code/gluten/cpp/build/releases/libarrow.so.900.0.0) > ==32256== by 0x77E0FDD: __cxa_finalize (cxa_finalize.c:83) > ==32256== by 0x7FF65B6: ??? (in > /mnt/jcc/code/gluten/cpp/build/releases/libarrow_dataset_jni.so.900.0.0) > ==32256== by 0x4011F6A: _dl_fini (dl-fini.c:138) > ==32256== by 0x77E08A6: __run_exit_handlers (exit.c:108) > ==32256== by 0x77E0A5F: exit (exit.c:139) > ==32256== by 0x77BE089: (below main) (libc-start.c:342) > ==32256== Block was alloc'd at > ==32256== at 0x483BE63: operator new(unsigned long) (in > /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) > ==32256== by 0x5E4E5E9: std::set<std::shared_ptr<arrow::DataType>, > std::less<std::shared_ptr<arrow::DataType> >, > std::allocator<std::shared_ptr<arrow::DataType> > > >::set(std::initializer_list<std::shared_ptr<arrow::DataType> >, > std::less<std::shared_ptr<arrow::DataType> > const&, > std::allocator<std::shared_ptr<arrow::DataType> > const&) (in > /mnt/jcc/code/gluten/cpp/build/releases/libarrow.so.900.0.0) > ==32256== by 0x7FF4CC4: _GLOBAL__sub_I_asof_join_node.cc (in > /mnt/jcc/code/gluten/cpp/build/releases/libarrow_dataset_jni.so.900.0.0) > ==32256== by 0x4011B99: call_init.part.0 (dl-init.c:72) > ==32256== by 0x4011CA0: call_init (dl-init.c:30) > ==32256== by 0x4011CA0: _dl_init (dl-init.c:119) > ==32256== by 0x4001139: ??? (in /usr/lib/x86_64-linux-gnu/ld-2.31.so) > {code} > I found it is static std::set in file {color:#FF0000}asof_join_node.cc{color} > {color:#172b4d}Can you help me to check if it has invalid memory free in your > convienent?{color} > {color:#172b4d}Thank you very much! > {color} > {code:java} > private: > static const std::set<std::shared_ptr<DataType>> kSupportedOnTypes_; > static const std::set<std::shared_ptr<DataType>> kSupportedByTypes_; > static const std::set<std::shared_ptr<DataType>> kSupportedDataTypes_;{code} -- This message was sent by Atlassian Jira (v8.20.10#820010)