Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use-of-uninitialized-value in NHyperscan::Serialize() #10708

Open
spuchin opened this issue Oct 22, 2024 · 2 comments
Open

Use-of-uninitialized-value in NHyperscan::Serialize() #10708

spuchin opened this issue Oct 22, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@spuchin
Copy link
Collaborator

spuchin commented Oct 22, 2024

Reproduced in tests:

ydb/library/rewrapper/ut
ReWrapperDispatcherTestHyperscan::LegacySerialization
ReWrapperDispatcherTestHyperscan::Serialization

Sanitizer output:

Test crashed (return code: 100)
==446212==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x118e818 in TBasicString<char, std::__y1::char_traits<char> >::TBasicString /-S/util/generic/string.h:473:14
    #1 0x118e818 in NHyperscan::Serialize(THolder<hs_database, NHyperscan::TDeleter<int (*)(hs_database*), &hs_free_database>> const&) /-S/library/cpp/regex/hyperscan/hyperscan.cpp:263:16
    #2 0x645273 in NReWrapper::NDispatcher::NTestSuiteReWrapperDispatcherTestHyperscan::TTestCaseLegacySerialization::Execute_(NUnitTest::TTestContext&) /-S/contrib/ydb/library/rewrapper/ut/hyperscan_ut.cpp:18:23
    #3 0x64faa6 in NReWrapper::NDispatcher::NTestSuiteReWrapperDispatcherTestHyperscan::TCurrentTest::Execute()::(anonymous class)::operator() /-S/contrib/ydb/library/rewrapper/ut/hyperscan_ut.cpp:10:1
    #4 0x64faa6 in std::__y1::__invoke<(lambda at /-S/contrib/ydb/library/rewrapper/ut/hyperscan_ut.cpp:10:1) &> /-S/contrib/libs/cxxsupp/libcxx/include/__type_traits/invoke.h:344:25
    #5 0x64faa6 in std::__y1::__invoke_void_return_wrapper<void, true>::__call<(lambda at /-S/contrib/ydb/library/rewrapper/ut/hyperscan_ut.cpp:10:1) &> /-S/contrib/libs/cxxsupp/libcxx/include/__type_traits/invoke.h:419:5
    #6 0x64faa6 in std::__y1::__function::__alloc_func<(lambda at /-S/contrib/ydb/library/rewrapper/ut/hyperscan_ut.cpp:10:1), std::__y1::allocator<(lambda at /-S/contrib/ydb/library/rewrapper/ut/hyperscan_ut.cpp:10:1)>, void ()>::operator() /-S/contrib/libs/cxxsupp/libcxx/include/__functional/function.h:195:16
    #7 0x64faa6 in std::__y1::__function::__func<NReWrapper::NDispatcher::NTestSuiteReWrapperDispatcherTestHyperscan::TCurrentTest::Execute()::'lambda'(), std::__y1::allocator<NReWrapper::NDispatcher::NTestSuiteReWrapperDispatcherTestHyperscan::TCurrentTest::Execute()::'lambda'()>, void ()>::operator()() /-S/contrib/libs/cxxsupp/libcxx/include/__functional/function.h:366:12
    #8 0x97f29b in NUnitTest::TTestBase::Run(std::__y1::function<void ()>, TBasicString<char, std::__y1::char_traits<char>> const&, char const*, bool) /-S/library/cpp/testing/unittest/registar.cpp:374:18
    #9 0x64e3ac in NReWrapper::NDispatcher::NTestSuiteReWrapperDispatcherTestHyperscan::TCurrentTest::Execute() /-S/contrib/ydb/library/rewrapper/ut/hyperscan_ut.cpp:10:1
    #10 0x980bbf in NUnitTest::TTestFactory::Execute() /-S/library/cpp/testing/unittest/registar.cpp:495:19
    #11 0x9abb64 in NUnitTest::RunMain(int, char**) /-S/library/cpp/testing/unittest/utmain.cpp:872:44
    #12 0x7fe7fe453082 in __libc_start_main /build/glibc-LcI20x/glibc-2.31/csu/../csu/libc-start.c:308:16
    #13 0x641158 in _start (build-release/contrib/ydb/library/rewrapper/ut/contrib-ydb-library-rewrapper-ut+0x641158) (BuildId: f2bff6e47fbd2aa20e53467207060d536300f878)
SUMMARY: MemorySanitizer: use-of-uninitialized-value /-S/util/generic/string.h:473:14 in TBasicString<char, std::__y1::char_traits<char> >::TBasicString
@spuchin spuchin added the bug Something isn't working label Oct 22, 2024
@dcherednik
Copy link
Member

The problem appears after b10aca4

@dcherednik
Copy link
Member

dcherednik commented Oct 23, 2024

Solution 1: Remove NO_SANITIZE() from contrib/libs/hyperscan/runtime_avx512
Solution 2: Do not use avx512 used for msan build of hyperscan

diff.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants