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

MemorySanitizer: use-of-uninitialized-value #109

Closed
agauniyal opened this issue Dec 10, 2017 · 3 comments
Closed

MemorySanitizer: use-of-uninitialized-value #109

agauniyal opened this issue Dec 10, 2017 · 3 comments

Comments

@agauniyal
Copy link

==17342==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x5599d1e7d337 in std::_Rb_tree<doctest::detail::TestCase, doctest::detail::TestCase, std::_Identity<doctest::detail::TestCase>, std::less<doctest::detail::TestCase>, std::allocator<doctest::detail::TestCase> >::_M_get_insert_unique_pos(doctest::detail::TestCase const&) /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/7.2.1/../../../../include/c++/7.2.1/bits/stl_tree.h:2035:7
    #1 0x5599d1e7cc2b in std::pair<std::_Rb_tree_iterator<doctest::detail::TestCase>, bool> std::_Rb_tree<doctest::detail::TestCase, doctest::detail::TestCase, std::_Identity<doctest::detail::TestCase>, std::less<doctest::detail::TestCase>, std::allocator<doctest::detail::TestCase> >::_M_insert_unique<doctest::detail::TestCase const&>(doctest::detail::TestCase const&) /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/7.2.1/../../../../include/c++/7.2.1/bits/stl_tree.h:2091:4
    #2 0x5599d1e340b4 in std::set<doctest::detail::TestCase, std::less<doctest::detail::TestCase>, std::allocator<doctest::detail::TestCase> >::insert(doctest::detail::TestCase const&) /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/7.2.1/../../../../include/c++/7.2.1/bits/stl_set.h:502:9
    #3 0x5599d1de40aa in doctest::detail::regTest(doctest::detail::TestCase const&) /home/agauniyal/.conan/data/doctest/1.2.6/bincrafters/stable/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include/doctest.h:4185:30
    #4 0x5599d1d5a480 in __cxx_global_var_init.309 /home/agauniyal/projects/termdb/build/../test/test.cpp:17:1
    #5 0x5599d1d5bc87 in _GLOBAL__sub_I_test.cpp /home/agauniyal/projects/termdb/build/../test/test.cpp
    #6 0x5599d1eacaac in __libc_csu_init (/home/agauniyal/projects/termdb/build/test/mainTest+0x170aac)
    #7 0x7fa862b16eda in __libc_start_main (/usr/lib/libc.so.6+0x20eda)
    #8 0x5599d1d5bce9 in _start (/home/agauniyal/projects/termdb/build/test/mainTest+0x1fce9)

SUMMARY: MemorySanitizer: use-of-uninitialized-value /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/7.2.1/../../../../include/c++/7.2.1/bits/stl_tree.h:2035:7 in std::_Rb_tree<doctest::detail::TestCase, doctest::detail::TestCase, std::_Identity<doctest::detail::TestCase>, std::less<doctest::detail::TestCase>, std::allocator<doctest::detail::TestCase> >::_M_get_insert_unique_pos(doctest::detail::TestCase const&)
Exiting
@agauniyal
Copy link
Author

This could be a false positive too.

@onqtam
Copy link
Member

onqtam commented Dec 11, 2017

are you using an instrumented version of the stdlib? I think that's the way to go with the memory sanitizer (unlike other sanitizers like the address/ub/thread ones) - especially since the error is somewhere in the stl container...

But if you are using an instrumented stdlib and given that the sanitizers don't give false positives I'd be curious to see a complete example that reproduces this - perhaps some test suites and decorators are in play...? I double-checked the code and it seems fine

@agauniyal
Copy link
Author

I apologize, somehow I missed building the instrumented version of stdlib. This must be a false positive then :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants