id summary reporter owner description type status milestone component version severity resolution keywords cc 6320 race condition in boost::filesystem::path leads to crash when used in multithreaded programs aris.basic@… Beman Dawes "following app crashes on VC10 (Windows 7) (multibyte and Unicode builds) at point of creation of path (im working around the issue by doing dummy string to wstring conversion) [ wstring r; std::copy(s.begin(),s.end(),r.begin()); ] {{{ #!c++ #include #include int main(void) { std::string sPath(""c:\\Development""); boost::thread_group tg; for(int i = 0; i < 2; i++) { tg.create_thread([&sPath](){ boost::this_thread::sleep(boost::posix_time::milliseconds(10)); boost::filesystem::path p(sPath); boost::filesystem::directory_iterator di(p), end; while(di != end) std::cout << (*(di++)).path().string() << std::endl; }); } tg.join_all(); int a; std::cin >> a; } }}} VC10 CallStack: {{{ > msvcp100d.dll!std::codecvt::in(int & _State, const char * _First1, const char * _Last1, const char * & _Mid1, wchar_t * _First2, wchar_t * _Last2, wchar_t * & _Mid2) Line 1521 + 0x1f bytes C++ filesystem_crash.exe!`anonymous namespace'::convert_aux(const char * from, const char * from_end, wchar_t * to, wchar_t * to_end, std::basic_string,std::allocator > & target, const std::codecvt & cvt) Line 84 + 0x25 bytes C++ filesystem_crash.exe!boost::filesystem3::path_traits::convert(const char * from, const char * from_end, std::basic_string,std::allocator > & to, const std::codecvt & cvt) Line 165 + 0x20 bytes C++ filesystem_crash.exe!boost::filesystem3::path_traits::dispatch,std::allocator > >(const std::basic_string,std::allocator > & c, std::basic_string,std::allocator > & to, const std::codecvt & cvt) Line 174 + 0x7e bytes C++ filesystem_crash.exe!boost::filesystem3::path::path,std::allocator > >(const std::basic_string,std::allocator > & source, void * __formal) Line 135 + 0x13 bytes C++ filesystem_crash.exe!`anonymous namespace'::::operator()() Line 15 + 0x10 bytes C++ filesystem_crash.exe!boost::detail::thread_data<`anonymous namespace':: >::run() Line 62 C++ filesystem_crash.exe!boost::`anonymous namespace'::thread_start_function(void * param) Line 177 C++ msvcr100d.dll!_callthreadstartex() Line 314 + 0xf bytes C msvcr100d.dll!_threadstartex(void * ptd) Line 297 C }}} " Bugs reopened To Be Determined filesystem Boost 1.64.0 Showstopper raad@… daniel.kruegler@…