id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 13305,memory leaks,vgtinenko@…,Andrey Semashev,"I create a logger in the main thread. If the logger is called from another std::thread there are no problems, but if it's called from the concurrency::create_task - there are lot of memory leaks. Visual Studio 2015, Boost versions: 1.57 and 1.65.1. For example: {{{ Dumping objects -> {887} normal block at 0x00B6A0F8, 128 bytes long. Data: < TimeStamp: 2017> 00 54 69 6D 65 53 74 61 6D 70 3A 20 32 30 31 37 }}} Best regards, Victor. The sample code: {{{ // ConsoleApplication_wo_MFC.cpp : Defines the entry point for the console application. // #define _CRT_SECURE_NO_WARNINGS #define BOOST_SYSTEM_NO_DEPRECATED #define BOOST_LIB_DIAGNOSTIC #define CGAL_LIB_DIAGNOSTIC #include #include #include #include #include #define _CRTDBG_MAP_ALLOC #include #include #include #include #include #include #include #include #include #include #include #include #if !defined(BOOST_LOG_NO_THREADS) #include #include #endif // !defined(BOOST_LOG_NO_THREADS) using namespace std; namespace logging = boost::log; namespace src = boost::log::sources; namespace sinks = boost::log::sinks; namespace keywords = boost::log::keywords; namespace expr = boost::log::expressions; BOOST_LOG_ATTRIBUTE_KEYWORD(a_channel, ""Channel"", std::string) int main() { int nRetCode = 0; _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); typedef sinks::synchronous_sink file_sink; src::severity_channel_logger_mt logger(keywords::channel = ""L""); boost::shared_ptr sinkT(new file_sink(keywords::file_name = ""logs\\TestLogger_%6N.log"")); sinkT->set_formatter ( expr::stream << "" TimeStamp: "" << expr::format_date_time< boost::posix_time::ptime >(""TimeStamp"", ""%Y-%m-%d %H:%M:%S"") << "" ThreadID: "" << expr::attr(""ThreadID"") << "" Message: "" << expr::smessage ); logging::core::get()->add_sink(sinkT); sinkT->set_filter(a_channel == ""L""); logging::add_common_attributes(); BOOST_LOG(logger) << L""A message from the MAIN thread""; std::thread testTthread([&]() { BOOST_LOG(logger) << L""A message from the std::thread""; }); testTthread.join(); auto task = concurrency::create_task([&]() { // Produces memory leaks BOOST_LOG(logger) << L""A message from the concurrency::create_task thread""; }); task.wait(); BOOST_LOG(logger) << L""Is concurrency::create_task done: "" << task.is_done(); return nRetCode; } }}} ",Bugs,new,To Be Determined,log,Boost 1.65.0,Problem,,,