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

daily_file_sink crash when day switch because of double free fd_ #1612

Closed
SnowfallDan opened this issue Jul 8, 2020 · 2 comments
Closed

Comments

@SnowfallDan
Copy link

core dump:

#0 0x00007fa0b5545b77 in abort () from /lib64/libc.so.6
[Current thread is 1 (Thread 0x7f9ff4fa9700 (LWP 756))]
(gdb) bt
#0 0x00007fa0b5545b77 in abort () from /lib64/libc.so.6
#1 0x00007fa0b5586e87 in _libc_message () from /lib64/libc.so.6
#2 0x00007fa0b558f679 in int_free () from /lib64/libc.so.6
#3 0x00007fa0b557c167 in fclose@@GLIBC_2.2.5 () from /lib64/libc.so.6
#4 0x00007fa0b6d52c87 in spdlog::details::file_helper::close() () from /lib/libspd_log.so
#5 0x00007fa0b6d52a5a in spdlog::details::file_helper::open(std::string const&, bool) () from /lib/libspd_log.so
#6 0x00007fa0b6d84241 in spdlog::sinks::daily_file_sink<spdlog::details::null_mutex, spdlog::sinks::daily_filename_calculator>::sink_it
(spdlog::details::log_msg const&) () from /lib/libspd_log.so
#7 0x00007fa0b6d83f1a in spdlog::sinks::base_sinkspdlog::details::null_mutex::log(spdlog::details::log_msg const&) () from /lib/libspd_log.so
#8 0x0000000000521442 in spdlog::logger::sink_it
(spdlog::details::log_msg&) ()
#9 0x0000000000542881 in void spdlog::logger::log<char [6], std::string, std::string, std::string>(spdlog::source_loc, spdlog::level::level_enum, char const*, char const (&) [6], std::string const&, std::string const&, std::string const&) ()
#10 0x000000000053ba26 in void spdlog::logger::log<char [6], std::string, std::string, std::string>(spdlog::level::level_enum, char const*, char const (&) [6], std::string const&, std::string const&, std::string const&) ()
#11 0x000000000052ed91 in void spdlog::logger::error<char [6], std::string, std::string, std::string>(char const*, char const (&) [6], std::string const&, std::string const&, std::string const&) ()
#12 0x00000000005218b3 in log_error(std::string const&, std::string const&, std::string const&) ()
#13 0x00007fa0b7b30478 in CCS::UploadSubTask::upload_subtask_done(unsigned int, unsigned int) () from /lib/libccs_sdk.so
#14 0x00007fa0b7b0df05 in boost::_mfi::mf2<void, CCS::UploadSubTask, unsigned int, unsigned int>::operator()(CCS::UploadSubTask*, unsigned int, unsigned int) const ()
from /lib/libccs_sdk.so
#15 0x00007fa0b7b0db9c in void boost::_bi::list3<boost::_bi::valueCCS::UploadSubTask*, boost::_bi::value, boost::_bi::value >::operator()<boost::_mfi::mf2<void, CCS::UploadSubTask, unsigned int, unsigned int>, boost::_bi::list0>(boost::_bi::type, boost::_mfi::mf2<void, CCS::UploadSubTask, unsigned int, unsigned int>&, boost::_bi::list0&, int) () from /lib/libccs_sdk.so
#16 0x00007fa0b7b0d809 in boost::_bi::bind_t<void, boost::_mfi::mf2<void, CCS::UploadSubTask, unsigned int, unsigned int>, boost::_bi::list3<boost::_bi::valueCCS::UploadSubTask*, boost::_bi::value, boost::_bi::value > >::operator()() () from /lib/libccs_sdk.so
#17 0x00007fa0b7b0d609 in boost::detail::function::void_function_obj_invoker0<boost::_bi::bind_t<void, boost::_mfi::mf2<void, CCS::UploadSubTask, unsigned int, unsigned int>, boost::_bi::list3<boost::_bi::valueCCS::UploadSubTask*, boost::_bi::value, boost::_bi::value > >, void>::invoke(boost::detail::function::function_buffer&) () from /lib/libccs_sdk.so
#18 0x00000000005b9506 in boost::function0::operator()() const ()
#19 0x00000000005b9451 in void boost::asio::asio_handler_invoke<boost::function<void ()> >(boost::function<void ()>&, ...) ()
#20 0x00000000005b92c8 in void boost_asio_handler_invoke_helpers::invoke<boost::function<void ()>, boost::function<void ()> >(boost::function<void ()>&, boost::function<void ()>&) ()
#21 0x00000000005b8fd9 in void boost::asio::detail::handler_work<boost::function<void ()>, boost::asio::system_executor, boost::asio::system_executor>::complete<boost::function<void ()> >(boost::function<void ()>&, boost::function<void ()>&) ()
#22 0x00000000005b8b4e in boost::asio::detail::completion_handler<boost::function<void ()> >::do_complete(void*, boost::asio::detail::scheduler_operation*, boost::system::error_code const&, unsigned long) ()
#23 0x0000000000570442 in boost::asio::detail::scheduler_operation::complete(void*, boost::system::error_code const&, unsigned long) ()
#24 0x00000000005729d8 in boost::asio::detail::scheduler::do_run_one(boost::asio::detail::conditionally_enabled_mutex::scoped_lock&, boost::asio::detail::scheduler_thread_info&, boost::system::error_code const&) ()
#25 0x0000000000572666 in boost::asio::detail::scheduler::run(boost::system::error_code&) ()
#26 0x000000000059c039 in boost::asio::io_context::run() ()
#27 0x00000000005b3f29 in boost::_mfi::mf0<unsigned long, boost::asio::io_context>::operator()(boost::asio::io_context*) const ()
#28 0x00000000005b3e8d in unsigned long boost::_bi::list1<boost::_bi::valueboost::asio::io_context* >::operator()<unsigned long, boost::_mfi::mf0<unsigned long, boos--Type for more, q to quit, c to continue without paging--
t::asio::io_context>, boost::_bi::list0>(boost::_bi::type, boost::_mfi::mf0<unsigned long, boost::asio::io_context>&, boost::_bi::list0&, long) ()
#29 0x00000000005b3c1f in boost::_bi::bind_t<unsigned long, boost::_mfi::mf0<unsigned long, boost::asio::io_context>, boost::_bi::list1<boost::_bi::valueboost::asio::io_context* > >::operator()() ()
#30 0x00000000005b3688 in boost::detail::thread_data<boost::_bi::bind_t<unsigned long, boost::_mfi::mf0<unsigned long, boost::asio::io_context>, boost::_bi::list1<boost::_bi::valueboost::asio::io_context* > > >::run() ()
#31 0x00007fa0b85db744 in thread_proxy () from /usr/local/lib/libboost_thread.so.1.70.0
#32 0x00007fa0b83b8e65 in start_thread () from /lib64/libpthread.so.0
#33 0x00007fa0b560c88d in clone () from /lib64/libc.so.6

this core is generate at 0 clock when day swtich.

i check the log code a lot times. i don't think it's possible to double free the fd.

maybe my code is not the newest. my version is: Version 1.1.0.

i found nothing in issuses reported or release bugfix list, os i commit this issuse.

thx

@SnowfallDan SnowfallDan changed the title daily_file_sink crash when day swtch because of double free fd_ daily_file_sink crash when day switch because of double free fd_ Jul 8, 2020
@tt4g
Copy link
Contributor

tt4g commented Jul 8, 2020

Can you update spdlog?

@SnowfallDan
Copy link
Author

i will try it again after update

bachittle pushed a commit to bachittle/spdlog that referenced this issue Dec 22, 2022
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