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

Found a MSan error in Asio #480

Open
JackyWoo opened this issue Dec 14, 2023 · 4 comments
Open

Found a MSan error in Asio #480

JackyWoo opened this issue Dec 14, 2023 · 4 comments

Comments

@JackyWoo
Copy link
Contributor

NuRaft version: current latest commit.

Logging debug to /var/log/raftkeeper-server/raftkeeper-server.log
Logging errors to /var/log/raftkeeper-server/raftkeeper-server.err.log
==8==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x1099d05 in asio::detail::epoll_reactor::run(long, asio::detail::op_queue<asio::detail::scheduler_operation>&) /data1/home/wujianchao/project/jd/raftkeeper/contrib/NuRaft/asio/asio/include/asio/detail/impl/epoll_reactor.ipp:542:9
    #1 0x1099f8c in non-virtual thunk to asio::detail::epoll_reactor::run(long, asio::detail::op_queue<asio::detail::scheduler_operation>&) /data1/home/wujianchao/project/jd/raftkeeper/contrib/NuRaft/asio/asio/include/asio/detail/epoll_reactor.hpp
    #2 0x109f421 in asio::detail::scheduler::do_run_one(asio::detail::conditionally_enabled_mutex::scoped_lock&, asio::detail::scheduler_thread_info&, std::__1::error_code const&) /data1/home/wujianchao/project/jd/raftkeeper/contrib/NuRaft/asio/asio/include/asio/detail/impl/scheduler.ipp:475:16
    #3 0x109e107 in asio::detail::scheduler::run(std::__1::error_code&) /data1/home/wujianchao/project/jd/raftkeeper/contrib/NuRaft/asio/asio/include/asio/detail/impl/scheduler.ipp:209:10
    #4 0x1088ae6 in asio::io_context::run() /data1/home/wujianchao/project/jd/raftkeeper/contrib/NuRaft/asio/asio/include/asio/impl/io_context.ipp:62:24
    #5 0x1088ae6 in nuraft::asio_service_impl::worker_entry() /data1/home/wujianchao/project/jd/raftkeeper/contrib/NuRaft/src/asio_service.cxx:1945:21
    #6 0x10b9808 in decltype(*(std::__1::forward<nuraft::asio_service_impl*&>(fp0)).*fp()) std::__1::__invoke<void (nuraft::asio_service_impl::*&)(), nuraft::asio_service_impl*&, void>(void (nuraft::asio_service_impl::*&)(), nuraft::asio_service_impl*&) /data1/home/wujianchao/project/jd/raftkeeper/contrib/libcxx/include/type_traits:3617:1
    #7 0x10b9808 in std::__1::__bind_return<void (nuraft::asio_service_impl::*)(), std::__1::tuple<nuraft::asio_service_impl*>, std::__1::tuple<>, __is_valid_bind_return<void (nuraft::asio_service_impl::*)(), std::__1::tuple<nuraft::asio_service_impl*>, std::__1::tuple<> >::value>::type std::__1::__apply_functor<void (nuraft::asio_service_impl::*)(), std::__1::tuple<nuraft::asio_service_impl*>, 0ul, std::__1::tuple<> >(void (nuraft::asio_service_impl::*&)(), std::__1::tuple<nuraft::asio_service_impl*>&, std::__1::__tuple_indices<0ul>, std::__1::tuple<>&&) /data1/home/wujianchao/project/jd/raftkeeper/contrib/libcxx/include/functional:2857:12
    #8 0x10b9808 in std::__1::__bind_return<void (nuraft::asio_service_impl::*)(), std::__1::tuple<nuraft::asio_service_impl*>, std::__1::tuple<>, __is_valid_bind_return<void (nuraft::asio_service_impl::*)(), std::__1::tuple<nuraft::asio_service_impl*>, std::__1::tuple<> >::value>::type std::__1::__bind<void (nuraft::asio_service_impl::*)(), nuraft::asio_service_impl*>::operator()<>() /data1/home/wujianchao/project/jd/raftkeeper/contrib/libcxx/include/functional:2890:20
    #9 0x10b9808 in decltype(std::__1::forward<std::__1::__bind<void (nuraft::asio_service_impl::*)(), nuraft::asio_service_impl*> >(fp)()) std::__1::__invoke<std::__1::__bind<void (nuraft::asio_service_impl::*)(), nuraft::asio_service_impl*> >(std::__1::__bind<void (nuraft::asio_service_impl::*)(), nuraft::asio_service_impl*>&&) /data1/home/wujianchao/project/jd/raftkeeper/contrib/libcxx/include/type_traits:3676:1
    #10 0x10b9808 in void std::__1::__thread_execute<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, std::__1::__bind<void (nuraft::asio_service_impl::*)(), nuraft::asio_service_impl*> >(std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, std::__1::__bind<void (nuraft::asio_service_impl::*)(), nuraft::asio_service_impl*> >&, std::__1::__tuple_indices<>) /data1/home/wujianchao/project/jd/raftkeeper/contrib/libcxx/include/thread:280:5
    #11 0x10b9808 in void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, std::__1::__bind<void (nuraft::asio_service_impl::*)(), nuraft::asio_service_impl*> > >(void*) /data1/home/wujianchao/project/jd/raftkeeper/contrib/libcxx/include/thread:291:5
    #12 0x7fb1855bb608 in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x8608)
    #13 0x7fb18584e132 in __clone (/lib/x86_64-linux-gnu/libc.so.6+0x11f132)

  Uninitialized value was created by an allocation of 'events' in the stack frame of function '_ZN4asio6detail13epoll_reactor3runElRNS0_8op_queueINS0_19scheduler_operationEEE'
    #0 0x1098e10 in asio::detail::epoll_reactor::run(long, asio::detail::op_queue<asio::detail::scheduler_operation>&) /data1/home/wujianchao/project/jd/raftkeeper/contrib/NuRaft/asio/asio/include/asio/detail/impl/epoll_reactor.ipp:477

SUMMARY: MemorySanitizer: use-of-uninitialized-value /data1/home/wujianchao/project/jd/raftkeeper/contrib/NuRaft/asio/asio/include/asio/detail/impl/epoll_reactor.ipp:542:9 in asio::detail::epoll_reactor::run(long, asio::detail::op_queue<asio::detail::scheduler_operation>&)
Exiting
@JackyWoo JackyWoo changed the title Found an MSan error in Asio Found a MSan error in Asio Dec 14, 2023
@greensky00
Copy link
Contributor

Sorry, I completely forgot to respond. It seems like it is not related to NuRaft code, but Asio problem.

@JackyWoo
Copy link
Contributor Author

I solved the issue by using standalone Asio. But I think we'd better provide a solid version of Asio.

@greensky00
Copy link
Contributor

@JackyWoo Which version of Asio did you try? NuRaft is already using standalone Asio, 1.24.0.

@JackyWoo
Copy link
Contributor Author

JackyWoo commented Jan 25, 2024

hi @greensky00 I found the issue was just skipped by the following code snippet but not resolved

#if defined(__has_feature)
#if __has_feature(memory_sanitizer)
  __msan_unpoison(events, 128);
#endif
#endif

And it is independent of the version of Asio.
Sorry for the previous mistaken.

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