Azat Khuzhin
00fdfa115f
Suppress MSan warning in NgramDistanceImpl::unrollLowering()
...
NgramDistanceImpl::unrollLowering() relies on the fact that PODArray has
padding and it is OK to access more items.
Here is an MSan report:
==656==WARNING: MemorySanitizer: use-of-uninitialized-value
0 0x557fd825485f in DB::NgramDistanceImpl<4ul, char8_t, false, true, false>::vectorConstant(DB::PODArray<char8_t, 4096ul, Allocator<false, false>, 63ul, 64ul> const&, DB::PODArray<unsigned long, 4096ul, Allocator<false, false>, 63ul, 64ul> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, DB::PODArray<float, 4096ul, Allocator<false, false>, 63ul, 64ul>&) (/usr/bin/clickhouse+0x124d885f) (BuildId: 76773125d8739591c75d4f4d263a2ffe7ca96855)
1 0x557fd824eb83 in DB::FunctionsStringSimilarity<DB::NgramDistanceImpl<4ul, char8_t, false, true, false>, DB::NameNgramSearchCaseInsensitive>::executeImpl(std::__1::vector<DB::ColumnWithTypeAndName, std::__1::allocator<DB::ColumnWithTypeAndName>> const&, std::__1::shared_ptr<DB::IDataType const> const&, unsigned long) const (/usr/bin/clickhouse+0x124d2b83) (BuildId: 76773125d8739591c75d4f4d263a2ffe7ca96855)
2 0x557fd50023b7 in DB::FunctionToExecutableFunctionAdaptor::executeImpl() const (/usr/bin/clickhouse+0xf2863b7) (BuildId: 76773125d8739591c75d4f4d263a2ffe7ca96855)
Uninitialized value was stored to memory at
0 0x557fd4f8da5a in __msan_memcpy (/usr/bin/clickhouse+0xf211a5a) (BuildId: 76773125d8739591c75d4f4d263a2ffe7ca96855)
1 0x557fd8253803 in DB::NgramDistanceImpl<4ul, char8_t, false, true, false>::vectorConstant(DB::PODArray<char8_t, 4096ul, Allocator<false, false>, 63ul, 64ul> const&, DB::PODArray<unsigned long, 4096ul, Allocator<false, false>, 63ul, 64ul> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, DB::PODArray<float, 4096ul, Allocator<false, false>, 63ul, 64ul>&) (/usr/bin/clickhouse+0x124d7803) (BuildId: 76773125d8739591c75d4f4d263a2ffe7ca96855)
2 0x557fd824eb83 in DB::FunctionsStringSimilarity<DB::NgramDistanceImpl<4ul, char8_t, false, true, false>, DB::NameNgramSearchCaseInsensitive>::executeImpl(std::__1::vector<DB::ColumnWithTypeAndName, std::__1::allocator<DB::ColumnWithTypeAndName>> const&, std::__1::shared_ptr<DB::IDataType const> const&, unsigned long) const (/usr/bin/clickhouse+0x124d2b83) (BuildId: 76773125d8739591c75d4f4d263a2ffe7ca96855)
3 0x557fd50023b7 in DB::FunctionToExecutableFunctionAdaptor::executeImpl() const (/usr/bin/clickhouse+0xf2863b7) (BuildId: 76773125d8739591c75d4f4d263a2ffe7ca96855)
Uninitialized value was stored to memory at
0 0x557fd4f8da5a in __msan_memcpy (/usr/bin/clickhouse+0xf211a5a) (BuildId: 76773125d8739591c75d4f4d263a2ffe7ca96855)
1 0x5580061699f5 in detail::memcpySmallAllowReadWriteOverflow15Impl(char*, char const*, long) build_docker/./src/Common/memcpySmall.h:42:13
2 0x5580061699f5 in memcpySmallAllowReadWriteOverflow15(void*, void const*, unsigned long) build_docker/./src/Common/memcpySmall.h:57:5
3 0x5580061699f5 in DB::ColumnString::replicate(DB::PODArray<unsigned long, 4096ul, Allocator<false, false>, 63ul, 64ul> const&) const build_docker/./src/Columns/ColumnString.cpp:462:13
4 0x558005d3fae4 in DB::ColumnConst::convertToFullColumn() const build_docker/./src/Columns/ColumnConst.cpp:48:18
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-05-11 16:30:17 +02:00