fix: Auth ReservationHandler, clear timer map before stopping io context#1832
Merged
Conversation
Additionally reset the executor_work_guard in dtor before stopping the io_context This fixes some invalid read errors reported by valgrind: ==4131335== Invalid read of size 8 ==4131335== at 0x688DB6: std::__atomic_base<long>::operator--() (atomic_base.h:406) ==4131335== by 0x67C87B: boost::asio::detail::scheduler::work_finished() (scheduler.hpp:108) ==4131335== by 0x68A45B: boost::asio::io_context::basic_executor_type<std::allocator<void>, 0ul>::on_work_finished() const (io_context.hpp:264) ==4131335== by 0x691A23: boost::asio::executor_work_guard<boost::asio::io_context::basic_executor_type<std::allocator<void>, 0ul>, void, void>::~executor_work_guard() (executor_work_guard.hpp:122) ==4131335== by 0x70C228: boost::detail::sp_ms_deleter<boost::asio::executor_work_guard<boost::asio::io_context::basic_executor_type<std::allocator<void>, 0ul>, void, void> >::destroy() (make_shared_object.hpp:55) ==4131335== by 0x7144F7: boost::detail::sp_ms_deleter<boost::asio::executor_work_guard<boost::asio::io_context::basic_executor_type<std::allocator<void>, 0ul>, void, void> >::operator()(boost::asio::executor_work_guard<boost::asio::io_context::basic_executor_type<std::allocator<void>, 0ul>, void, void>*) (make_shared_object.hpp:89) ==4131335== by 0x7141F0: boost::detail::sp_counted_impl_pd<boost::asio::executor_work_guard<boost::asio::io_context::basic_executor_type<std::allocator<void>, 0ul>, void, void>*, boost::detail::sp_ms_deleter<boost::asio::executor_work_guard<boost::asio::io_context::basic_executor_type<std::allocator<void>, 0ul>, void, void> > >::dispose() (sp_counted_impl.hpp:113) ==4131335== by 0x564F0C: boost::detail::sp_counted_base::release() (sp_counted_base_std_atomic.hpp:118) ==4131335== by 0x565012: boost::detail::shared_count::~shared_count() (shared_count.hpp:352) ==4131335== by 0x6E7B1B: boost::shared_ptr<boost::asio::executor_work_guard<boost::asio::io_context::basic_executor_type<std::allocator<void>, 0ul>, void, void> >::~shared_ptr() (shared_ptr.hpp:253) ==4131335== by 0x6D107F: module::ReservationHandler::~ReservationHandler() (ReservationHandler.cpp:34) ==4131335== by 0x715833: module::AuthHandler::~AuthHandler() (AuthHandler.cpp:59) Signed-off-by: Kai-Uwe Hermann <kai-uwe.hermann@pionix.de>
Pietfried
approved these changes
Feb 18, 2026
mlitre
pushed a commit
that referenced
this pull request
Feb 19, 2026
…ext (#1832) Additionally reset the executor_work_guard in dtor before stopping the io_context This fixes some invalid read errors reported by valgrind: ==4131335== Invalid read of size 8 ==4131335== at 0x688DB6: std::__atomic_base<long>::operator--() (atomic_base.h:406) ==4131335== by 0x67C87B: boost::asio::detail::scheduler::work_finished() (scheduler.hpp:108) ==4131335== by 0x68A45B: boost::asio::io_context::basic_executor_type<std::allocator<void>, 0ul>::on_work_finished() const (io_context.hpp:264) ==4131335== by 0x691A23: boost::asio::executor_work_guard<boost::asio::io_context::basic_executor_type<std::allocator<void>, 0ul>, void, void>::~executor_work_guard() (executor_work_guard.hpp:122) ==4131335== by 0x70C228: boost::detail::sp_ms_deleter<boost::asio::executor_work_guard<boost::asio::io_context::basic_executor_type<std::allocator<void>, 0ul>, void, void> >::destroy() (make_shared_object.hpp:55) ==4131335== by 0x7144F7: boost::detail::sp_ms_deleter<boost::asio::executor_work_guard<boost::asio::io_context::basic_executor_type<std::allocator<void>, 0ul>, void, void> >::operator()(boost::asio::executor_work_guard<boost::asio::io_context::basic_executor_type<std::allocator<void>, 0ul>, void, void>*) (make_shared_object.hpp:89) ==4131335== by 0x7141F0: boost::detail::sp_counted_impl_pd<boost::asio::executor_work_guard<boost::asio::io_context::basic_executor_type<std::allocator<void>, 0ul>, void, void>*, boost::detail::sp_ms_deleter<boost::asio::executor_work_guard<boost::asio::io_context::basic_executor_type<std::allocator<void>, 0ul>, void, void> > >::dispose() (sp_counted_impl.hpp:113) ==4131335== by 0x564F0C: boost::detail::sp_counted_base::release() (sp_counted_base_std_atomic.hpp:118) ==4131335== by 0x565012: boost::detail::shared_count::~shared_count() (shared_count.hpp:352) ==4131335== by 0x6E7B1B: boost::shared_ptr<boost::asio::executor_work_guard<boost::asio::io_context::basic_executor_type<std::allocator<void>, 0ul>, void, void> >::~shared_ptr() (shared_ptr.hpp:253) ==4131335== by 0x6D107F: module::ReservationHandler::~ReservationHandler() (ReservationHandler.cpp:34) ==4131335== by 0x715833: module::AuthHandler::~AuthHandler() (AuthHandler.cpp:59) Signed-off-by: Kai-Uwe Hermann <kai-uwe.hermann@pionix.de>
mlitre
pushed a commit
that referenced
this pull request
Feb 19, 2026
…ext (#1832) Additionally reset the executor_work_guard in dtor before stopping the io_context This fixes some invalid read errors reported by valgrind: ==4131335== Invalid read of size 8 ==4131335== at 0x688DB6: std::__atomic_base<long>::operator--() (atomic_base.h:406) ==4131335== by 0x67C87B: boost::asio::detail::scheduler::work_finished() (scheduler.hpp:108) ==4131335== by 0x68A45B: boost::asio::io_context::basic_executor_type<std::allocator<void>, 0ul>::on_work_finished() const (io_context.hpp:264) ==4131335== by 0x691A23: boost::asio::executor_work_guard<boost::asio::io_context::basic_executor_type<std::allocator<void>, 0ul>, void, void>::~executor_work_guard() (executor_work_guard.hpp:122) ==4131335== by 0x70C228: boost::detail::sp_ms_deleter<boost::asio::executor_work_guard<boost::asio::io_context::basic_executor_type<std::allocator<void>, 0ul>, void, void> >::destroy() (make_shared_object.hpp:55) ==4131335== by 0x7144F7: boost::detail::sp_ms_deleter<boost::asio::executor_work_guard<boost::asio::io_context::basic_executor_type<std::allocator<void>, 0ul>, void, void> >::operator()(boost::asio::executor_work_guard<boost::asio::io_context::basic_executor_type<std::allocator<void>, 0ul>, void, void>*) (make_shared_object.hpp:89) ==4131335== by 0x7141F0: boost::detail::sp_counted_impl_pd<boost::asio::executor_work_guard<boost::asio::io_context::basic_executor_type<std::allocator<void>, 0ul>, void, void>*, boost::detail::sp_ms_deleter<boost::asio::executor_work_guard<boost::asio::io_context::basic_executor_type<std::allocator<void>, 0ul>, void, void> > >::dispose() (sp_counted_impl.hpp:113) ==4131335== by 0x564F0C: boost::detail::sp_counted_base::release() (sp_counted_base_std_atomic.hpp:118) ==4131335== by 0x565012: boost::detail::shared_count::~shared_count() (shared_count.hpp:352) ==4131335== by 0x6E7B1B: boost::shared_ptr<boost::asio::executor_work_guard<boost::asio::io_context::basic_executor_type<std::allocator<void>, 0ul>, void, void> >::~shared_ptr() (shared_ptr.hpp:253) ==4131335== by 0x6D107F: module::ReservationHandler::~ReservationHandler() (ReservationHandler.cpp:34) ==4131335== by 0x715833: module::AuthHandler::~AuthHandler() (AuthHandler.cpp:59) Signed-off-by: Kai-Uwe Hermann <kai-uwe.hermann@pionix.de> Signed-off-by: Martin Litre <mnlitre@gmail.com>
Dalachowsky
pushed a commit
to Dalachowsky/everest-core
that referenced
this pull request
Feb 20, 2026
…ext (EVerest#1832) Additionally reset the executor_work_guard in dtor before stopping the io_context This fixes some invalid read errors reported by valgrind: ==4131335== Invalid read of size 8 ==4131335== at 0x688DB6: std::__atomic_base<long>::operator--() (atomic_base.h:406) ==4131335== by 0x67C87B: boost::asio::detail::scheduler::work_finished() (scheduler.hpp:108) ==4131335== by 0x68A45B: boost::asio::io_context::basic_executor_type<std::allocator<void>, 0ul>::on_work_finished() const (io_context.hpp:264) ==4131335== by 0x691A23: boost::asio::executor_work_guard<boost::asio::io_context::basic_executor_type<std::allocator<void>, 0ul>, void, void>::~executor_work_guard() (executor_work_guard.hpp:122) ==4131335== by 0x70C228: boost::detail::sp_ms_deleter<boost::asio::executor_work_guard<boost::asio::io_context::basic_executor_type<std::allocator<void>, 0ul>, void, void> >::destroy() (make_shared_object.hpp:55) ==4131335== by 0x7144F7: boost::detail::sp_ms_deleter<boost::asio::executor_work_guard<boost::asio::io_context::basic_executor_type<std::allocator<void>, 0ul>, void, void> >::operator()(boost::asio::executor_work_guard<boost::asio::io_context::basic_executor_type<std::allocator<void>, 0ul>, void, void>*) (make_shared_object.hpp:89) ==4131335== by 0x7141F0: boost::detail::sp_counted_impl_pd<boost::asio::executor_work_guard<boost::asio::io_context::basic_executor_type<std::allocator<void>, 0ul>, void, void>*, boost::detail::sp_ms_deleter<boost::asio::executor_work_guard<boost::asio::io_context::basic_executor_type<std::allocator<void>, 0ul>, void, void> > >::dispose() (sp_counted_impl.hpp:113) ==4131335== by 0x564F0C: boost::detail::sp_counted_base::release() (sp_counted_base_std_atomic.hpp:118) ==4131335== by 0x565012: boost::detail::shared_count::~shared_count() (shared_count.hpp:352) ==4131335== by 0x6E7B1B: boost::shared_ptr<boost::asio::executor_work_guard<boost::asio::io_context::basic_executor_type<std::allocator<void>, 0ul>, void, void> >::~shared_ptr() (shared_ptr.hpp:253) ==4131335== by 0x6D107F: module::ReservationHandler::~ReservationHandler() (ReservationHandler.cpp:34) ==4131335== by 0x715833: module::AuthHandler::~AuthHandler() (AuthHandler.cpp:59) Signed-off-by: Kai-Uwe Hermann <kai-uwe.hermann@pionix.de>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Additionally reset the executor_work_guard in dtor before stopping the io_context
This fixes some invalid read errors reported by valgrind: ==4131335== Invalid read of size 8
==4131335== at 0x688DB6: std::__atomic_base::operator--() (atomic_base.h:406)
==4131335== by 0x67C87B: boost::asio::detail::scheduler::work_finished() (scheduler.hpp:108)
==4131335== by 0x68A45B: boost::asio::io_context::basic_executor_type<std::allocator, 0ul>::on_work_finished() const (io_context.hpp:264)
==4131335== by 0x691A23: boost::asio::executor_work_guard<boost::asio::io_context::basic_executor_type<std::allocator, 0ul>, void, void>::~executor_work_guard() (executor_work_guard.hpp:122)
==4131335== by 0x70C228: boost::detail::sp_ms_deleter<boost::asio::executor_work_guard<boost::asio::io_context::basic_executor_type<std::allocator, 0ul>, void, void> >::destroy() (make_shared_object.hpp:55)
==4131335== by 0x7144F7: boost::detail::sp_ms_deleter<boost::asio::executor_work_guard<boost::asio::io_context::basic_executor_type<std::allocator, 0ul>, void, void> >::operator()(boost::asio::executor_work_guard<boost::asio::io_context::basic_executor_type<std::allocator, 0ul>, void, void>) (make_shared_object.hpp:89)
==4131335== by 0x7141F0: boost::detail::sp_counted_impl_pd<boost::asio::executor_work_guard<boost::asio::io_context::basic_executor_type<std::allocator, 0ul>, void, void>, boost::detail::sp_ms_deleter<boost::asio::executor_work_guard<boost::asio::io_context::basic_executor_type<std::allocator, 0ul>, void, void> > >::dispose() (sp_counted_impl.hpp:113)
==4131335== by 0x564F0C: boost::detail::sp_counted_base::release() (sp_counted_base_std_atomic.hpp:118)
==4131335== by 0x565012: boost::detail::shared_count::~shared_count() (shared_count.hpp:352)
==4131335== by 0x6E7B1B: boost::shared_ptr<boost::asio::executor_work_guard<boost::asio::io_context::basic_executor_type<std::allocator, 0ul>, void, void> >::~shared_ptr() (shared_ptr.hpp:253)
==4131335== by 0x6D107F: module::ReservationHandler::~ReservationHandler() (ReservationHandler.cpp:34)
==4131335== by 0x715833: module::AuthHandler::~AuthHandler() (AuthHandler.cpp:59)
Describe your changes
Issue ticket number and link
Checklist before requesting a review