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

UndefinedBehaviourSanitizer crash on 1.8.2 #1832

Closed
streamsniper69 opened this issue Feb 16, 2021 · 1 comment
Closed

UndefinedBehaviourSanitizer crash on 1.8.2 #1832

streamsniper69 opened this issue Feb 16, 2021 · 1 comment

Comments

@streamsniper69
Copy link

streamsniper69 commented Feb 16, 2021

My apologies if this is a known issue or a false positive. I am confident I have built things correctly, as I am using the "copy-paste heades into your repository" option to build (so the code should be properly instrumented).

UndefinedBehaviourSanitizer dumps the following stack trace when exiting a unit test. The problem appears to be inside the spdlog shutdown code. I am hoping someone can fix it.

1: UndefinedBehaviorSanitizer:DEADLYSIGNAL
1: ==10==ERROR: UndefinedBehaviorSanitizer: SEGV on unknown address 0x00003f800060 (pc 0x0000006633c3 bp 0x7fff416fa230 sp 0x7fff416fa200 T10)
1: ==10==The signal is caused by a WRITE memory access.
1:     #0 0x6633c3 in fmt::v7::basic_memory_buffer<char, 250ul, std::allocator<char> >::~basic_memory_buffer() /home/edge/protocol-translator/src/blocks/util/./spdlog/fmt/bundled/format.h:678:26
1:     #1 0x7af6d0 in spdlog::details::log_msg_buffer::~log_msg_buffer() /home/edge/protocol-translator/src/blocks/util/./spdlog/details/log_msg_buffer.h:14:18
1:     #2 0x7af63f in void std::_Destroy<spdlog::details::log_msg_buffer>(spdlog::details::log_msg_buffer*) /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/stl_construct.h:140:19
1:     #3 0x7af569 in void std::_Destroy_aux<false>::__destroy<spdlog::details::log_msg_buffer*>(spdlog::details::log_msg_buffer*, spdlog::details::log_msg_buffer*) /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/stl_construct.h:152:6
1:     #4 0x7af4e4 in void std::_Destroy<spdlog::details::log_msg_buffer*>(spdlog::details::log_msg_buffer*, spdlog::details::log_msg_buffer*) /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/stl_construct.h:184:7
1:     #5 0x7af138 in void std::_Destroy<spdlog::details::log_msg_buffer*, spdlog::details::log_msg_buffer>(spdlog::details::log_msg_buffer*, spdlog::details::log_msg_buffer*, std::allocator<spdlog::details::log_msg_buffer>&) /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/alloc_traits.h:738:7
1:     #6 0x7af0d1 in std::vector<spdlog::details::log_msg_buffer, std::allocator<spdlog::details::log_msg_buffer> >::~vector() /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/stl_vector.h:680:2
1:     #7 0x7aee30 in spdlog::details::circular_q<spdlog::details::log_msg_buffer>::~circular_q() /home/edge/protocol-translator/src/blocks/util/./spdlog/details/circular_q.h:13:7
1:     #8 0x7aea80 in spdlog::details::backtracer::~backtracer() /home/edge/protocol-translator/src/blocks/util/./spdlog/details/backtracer.h:18:18
1:     #9 0x652f64 in spdlog::logger::~logger() /home/edge/protocol-translator/src/blocks/util/./spdlog/logger.h:68:31
1:     #10 0x7a2790 in void __gnu_cxx::new_allocator<spdlog::logger>::destroy<spdlog::logger>(spdlog::logger*) /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ext/new_allocator.h:156:10
1:     #11 0x7a255c in void std::allocator_traits<std::allocator<spdlog::logger> >::destroy<spdlog::logger>(std::allocator<spdlog::logger>&, spdlog::logger*) /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/alloc_traits.h:531:8
1:     #12 0x79eaf5 in std::_Sp_counted_ptr_inplace<spdlog::logger, std::allocator<spdlog::logger>, (__gnu_cxx::_Lock_policy)2>::_M_dispose() /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/shared_ptr_base.h:560:2
1:     #13 0x4e9575 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/shared_ptr_base.h:158:6
1:     #14 0x4e9255 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/shared_ptr_base.h:733:11
1:     #15 0x7ae7f0 in std::__shared_ptr<spdlog::logger, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/shared_ptr_base.h:1183:31
1:     #16 0x651ada in std::shared_ptr<spdlog::logger>::~shared_ptr() /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/shared_ptr.h:121:11
1:     #17 0x7a80e0 in std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<spdlog::logger> >::~pair() /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/stl_pair.h:211:12
1:     #18 0x7a8073 in void __gnu_cxx::new_allocator<std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<spdlog::logger> >, true> >::destroy<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<spdlog::logger> > >(std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<spdlog::logger> >*) /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ext/new_allocator.h:156:10
1:     #19 0x7a7f0c in void std::allocator_traits<std::allocator<std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<spdlog::logger> >, true> > >::destroy<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<spdlog::logger> > >(std::allocator<std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<spdlog::logger> >, true> >&, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<spdlog::logger> >*) /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/alloc_traits.h:531:8
1:     #20 0x7a7e9e in std::__detail::_Hashtable_alloc<std::allocator<std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<spdlog::logger> >, true> > >::_M_deallocate_node(std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<spdlog::logger> >, true>*) /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/hashtable_policy.h:2053:7
1:     #21 0x7aa74c in std::__detail::_Hashtable_alloc<std::allocator<std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<spdlog::logger> >, true> > >::_M_deallocate_nodes(std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<spdlog::logger> >, true>*) /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/hashtable_policy.h:2075:4
1:     #22 0x7aa5bf in std::_Hashtable<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<spdlog::logger> >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<spdlog::logger> > >, std::__detail::_Select1st, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::clear() /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/hashtable.h:2030:13
1:     #23 0x7aa4d7 in std::_Hashtable<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<spdlog::logger> >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<spdlog::logger> > >, std::__detail::_Select1st, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::~_Hashtable() /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/hashtable.h:1387:7
1:     #24 0x659147 in std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::shared_ptr<spdlog::logger>, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<spdlog::logger> > > >::~unordered_map() /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/unordered_map.h:102:11
1:     #25 0x7fa1c2723da5 in spdlog::details::registry_t<std::mutex>::~registry_t() /home/edge/protocol-translator/build/amd64/_deps/cdp-src/src/util/spdlog/details/registry.h:29:30
1:     #26 0x7fa1c20b8a56 in __run_exit_handlers stdlib/exit.c:108:8
1:     #27 0x7fa1c20b8bff in exit stdlib/exit.c:139:3
1:     #28 0x7fa1c209ccb8 in __libc_start_main csu/../csu/libc-start.c:348:3
1:
1: UndefinedBehaviorSanitizer can not provide additional info.
@gabime
Copy link
Owner

gabime commented Feb 16, 2021

This seems like false positive and duplicate of #680

@gabime gabime closed this as completed Feb 20, 2021
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