c++ - Boosts say boost::log does not support forked processes. Is this still the case if the logger wasn't initialized until after the fork? -



c++ - Boosts say boost::log does not support forked processes. Is this still the case if the logger wasn't initialized until after the fork? -

i have process forks, , creates boost loggers, different file names , different channel names in each kid process.

still, when effort log anything, deadlocks occur. don't see how matter if logging create/initialized after fork occurred.

child 1: #0 in pthread_rwlock_wrlock () /lib64/libpthread.so.0 #1 in boost::log::v2s_mt_posix::aux::light_rw_mutex::lock() () /usr/local/php54/lib/php/extensions/x.so #2 in boost::log::v2s_mt_posix::sources::multi_thread_model<boost::log::v2s_mt_posix::aux::light_rw_mutex>::lock() const () /usr/local/php54/lib/php/extensions/x.so #3 in boost::log::v2s_mt_posix::aux::exclusive_lock_guard<boost::log::v2s_mt_posix::sources::multi_thread_model<boost::log::v2s_mt_posix::aux::light_rw_mutex> >::exclusive_lock_guard(boost::log::v2s_mt_posix::sources::multi_thread_model<boost::log::v2s_mt_posix::aux::light_rw_mutex>&) () /usr/local/php54/lib/php/extensions/x.so #4 in boost::log::v2s_mt_posix::record boost::log::v2s_mt_posix::sources::basic_composite_logger<char, boost::log::v2s_mt_posix::sources::severity_channel_logger_mt<boost::log::v2s_mt_posix::trivial::severity_level, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, boost::log::v2s_mt_posix::sources::multi_thread_model<boost::log::v2s_mt_posix::aux::light_rw_mutex>, boost::log::v2s_mt_posix::sources::features<boost::log::v2s_mt_posix::sources::severity<boost::log::v2s_mt_posix::trivial::severity_level>, boost::log::v2s_mt_posix::sources::channel<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, void, void, void, void, void, void, void, void> >::open_record<boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::severity, boost::log::v2s_mt_posix::trivial::severity_level const> >(boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::severity, boost::log::v2s_mt_posix::trivial::severity_level const> const&) () /usr/local/php54/lib/php/extensions/x.so kid 2: #0 in pthread_rwlock_wrlock () /lib64/libpthread.so.0 #1 in boost::log::v2s_mt_posix::aux::light_rw_mutex::lock() () /usr/local/php54/lib/php/extensions/x.so #2 in boost::log::v2s_mt_posix::sources::multi_thread_model<boost::log::v2s_mt_posix::aux::light_rw_mutex>::lock() const () /usr/local/php54/lib/php/extensions/x.so #3 in boost::log::v2s_mt_posix::aux::exclusive_lock_guard<boost::log::v2s_mt_posix::sources::multi_thread_model<boost::log::v2s_mt_posix::aux::light_rw_mutex> >::exclusive_lock_guard(boost::log::v2s_mt_posix::sources::multi_thread_model<boost::log::v2s_mt_posix::aux::light_rw_mutex>&) () /usr/local/php54/lib/php/extensions/x.so #4 in boost::log::v2s_mt_posix::record boost::log::v2s_mt_posix::sources::basic_composite_logger<char, boost::log::v2s_mt_posix::sources::severity_channel_logger_mt<boost::log::v2s_mt_posix::trivial::severity_level, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, boost::log::v2s_mt_posix::sources::multi_thread_model<boost::log::v2s_mt_posix::aux::light_rw_mutex>, boost::log::v2s_mt_posix::sources::features<boost::log::v2s_mt_posix::sources::severity<boost::log::v2s_mt_posix::trivial::severity_level>, boost::log::v2s_mt_posix::sources::channel<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, void, void, void, void, void, void, void, void> >::open_record<boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::severity, boost::log::v2s_mt_posix::trivial::severity_level const> >(boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::severity, boost::log::v2s_mt_posix::trivial::severity_level const> const&) () /usr/local/php54/lib/php/extensions/x.so

this library has @ to the lowest degree 1 non-trivial static initializer runs before main. did not trace initializes, expect initializes pthreads mutex inherited upon fork. away logging 1 kid process, logging 2 fails because shared state rwlock maintains not shared between 2 kid processes. 1 solution move boost logging , kid code different executable , fork , exec executable. possible solution load boost logging dynamically, seems bit complicated because of templates.

c++ logging boost fork

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -