zilliztech / knowhere

Knowhere is an open-source vector search engine, integrating FAISS, HNSW, etc.
Apache License 2.0
160 stars 68 forks source link

ASAN problems in the master branch #686

Open alexanderguzhva opened 1 month ago

alexanderguzhva commented 1 month ago

Run unit tests locally for the master branch (20caafd65e5d787188ea6a15b8a4b91f751267f4)

I0703 14:53:18.791541 102823 thread_pool.h:53] [KNOWHERE][operator()][knowhere_search] Successfully set priority of knowhere thread.
I0703 14:53:18.791925 102824 thread_pool.h:53] [KNOWHERE][operator()][knowhere_search] Successfully set priority of knowhere thread.
I0703 14:53:18.795344 102825 thread_pool.h:53] [KNOWHERE][operator()][knowhere_search] Successfully set priority of knowhere thread.
I0703 14:53:18.799831 102518 index.cc:32] [KNOWHERE][LoadConfig][knowhere_tests] Search config dump: {"M":128,"dim":128,"ef":64,"efConstruction":200,"k":5,"metric_type":"L2"}
I0703 14:53:18.820672 102518 index_factory.cc:54] [KNOWHERE][Create][knowhere_tests] use key HNSW_SQ8_fp32 to create knowhere index HNSW_SQ8 with version 4
=================================================================
==102518==ERROR: AddressSanitizer: stack-use-after-return on address 0x7ee35fa88140 at pc 0x5d66cb1e3562 bp 0x7ffe6410bfd0 sp 0x7ffe6410bfc8
READ of size 8 at 0x7ee35fa88140 thread T0
    #0 0x5d66cb1e3561 in CATCH2_INTERNAL_TEST_12()::$_9::operator()[abi:cxx11]() const /home/ubuntu/zilliz/knowhere_ut/knowhere/tests/ut/test_iterator.cc:102:37
    #1 0x5d66cb1e304d in CATCH2_INTERNAL_TEST_12()::$_0::operator()[abi:cxx11]() const /home/ubuntu/zilliz/knowhere_ut/knowhere/tests/ut/test_iterator.cc:109:31
    #2 0x5d66cb1e2e9f in nlohmann::json_abi_v3_11_2::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_2::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char>>> std::__invoke_impl<nlohmann::json_abi_v3_11_2::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_2::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char>>>, CATCH2_INTERNAL_TEST_12()::$_0&>(std::__invoke_other, CATCH2_INTERNAL_TEST_12()::$_0&) /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/invoke.h:61:14
    #3 0x5d66cb1e2e3f in std::enable_if<is_invocable_r_v<nlohmann::json_abi_v3_11_2::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_2::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char>>>, CATCH2_INTERNAL_TEST_12()::$_0&>, nlohmann::json_abi_v3_11_2::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_2::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char>>>>::type std::__invoke_r<nlohmann::json_abi_v3_11_2::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_2::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char>>>, CATCH2_INTERNAL_TEST_12()::$_0&>(CATCH2_INTERNAL_TEST_12()::$_0&) /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/invoke.h:114:9
    #4 0x5d66cb1e2cff in std::_Function_handler<nlohmann::json_abi_v3_11_2::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_2::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char>>> (), CATCH2_INTERNAL_TEST_12()::$_0>::_M_invoke(std::_Any_data const&) /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/std_function.h:290:9
    #5 0x5d66cb1bccc5 in std::function<nlohmann::json_abi_v3_11_2::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_2::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char>>> ()>::operator()() const /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/std_function.h:590:9
    #6 0x5d66cb1d42a3 in CATCH2_INTERNAL_TEST_12() /home/ubuntu/zilliz/knowhere_ut/knowhere/tests/ut/test_iterator.cc:145:25
    #7 0x5d66cb46de42 in Catch::TestInvokerAsFunction::invoke() const /home/ubuntu/.conan/data/catch2/3.3.1/_/_/build/f9d48335a9769575b0fbb2c43dcef4109c3f1d6c/build/Debug/src/src/catch2/internal/catch_test_case_registry_impl.cpp:149:9
    #8 0x5d66cb464638 in Catch::TestCaseHandle::invoke() const /home/ubuntu/.conan/data/catch2/3.3.1/_/_/build/f9d48335a9769575b0fbb2c43dcef4109c3f1d6c/build/Debug/src/src/catch2/../catch2/catch_test_case_info.hpp:115:24
    #9 0x5d66cb462dc0 in Catch::RunContext::invokeActiveTestCase() /home/ubuntu/.conan/data/catch2/3.3.1/_/_/build/f9d48335a9769575b0fbb2c43dcef4109c3f1d6c/build/Debug/src/src/catch2/internal/catch_run_context.cpp:541:27
    #10 0x5d66cb46188e in Catch::RunContext::runCurrentTest(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&) /home/ubuntu/.conan/data/catch2/3.3.1/_/_/build/f9d48335a9769575b0fbb2c43dcef4109c3f1d6c/build/Debug/src/src/catch2/internal/catch_run_context.cpp:504:17
    #11 0x5d66cb461031 in Catch::RunContext::runTest(Catch::TestCaseHandle const&) /home/ubuntu/.conan/data/catch2/3.3.1/_/_/build/f9d48335a9769575b0fbb2c43dcef4109c3f1d6c/build/Debug/src/src/catch2/internal/catch_run_context.cpp:235:13
    #12 0x5d66cb414ab4 in Catch::(anonymous namespace)::TestGroup::execute() /home/ubuntu/.conan/data/catch2/3.3.1/_/_/build/f9d48335a9769575b0fbb2c43dcef4109c3f1d6c/build/Debug/src/src/catch2/catch_session.cpp:110:45
    #13 0x5d66cb413bc5 in Catch::Session::runInternal() /home/ubuntu/.conan/data/catch2/3.3.1/_/_/build/f9d48335a9769575b0fbb2c43dcef4109c3f1d6c/build/Debug/src/src/catch2/catch_session.cpp:332:39
    #14 0x5d66cb4137a6 in Catch::Session::run() /home/ubuntu/.conan/data/catch2/3.3.1/_/_/build/f9d48335a9769575b0fbb2c43dcef4109c3f1d6c/build/Debug/src/src/catch2/catch_session.cpp:263:24
    #15 0x5d66cb40f5d9 in int Catch::Session::run<char>(int, char const* const*) /home/ubuntu/.conan/data/catch2/3.3.1/_/_/build/f9d48335a9769575b0fbb2c43dcef4109c3f1d6c/build/Debug/src/src/catch2/../catch2/catch_session.hpp:41:30
    #16 0x5d66cb40f51e in main /home/ubuntu/.conan/data/catch2/3.3.1/_/_/build/f9d48335a9769575b0fbb2c43dcef4109c3f1d6c/build/Debug/src/src/catch2/internal/catch_main.cpp:36:29
    #17 0x7ee361629d8f in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
    #18 0x7ee361629e3f in __libc_start_main csu/../csu/libc-start.c:392:3
    #19 0x5d66caee3a64 in _start (/home/ubuntu/zilliz/knowhere_ut/knowhere/build/Debug/tests/ut/knowhere_tests+0x1e8a64) (BuildId: 741712da828738e5aad63c52268d88548d258472)

Address 0x7ee35fa88140 is located in stack of thread T0 at offset 320 in frame
    #0 0x5d66cb1d1a0f in CATCH2_INTERNAL_TEST_12() /home/ubuntu/zilliz/knowhere_ut/knowhere/tests/ut/test_iterator.cc:90
Light-City commented 1 month ago

related pr commit is : https://github.com/zilliztech/knowhere/pull/631/commits/b9ee39fabd8981336ad8ea81b11082194d2edac2

We just need to remove the & in the lambda and use =

github-actions[bot] commented 8 hours ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Rotten issues close after 30d of inactivity. Reopen the issue with /reopen.