Subject: [Boost-bugs] [Boost C++ Libraries] #6320: creation of path from std::string on Windows (VC10) crashes (access error)
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-12-24 00:44:29
#6320: creation of path from std::string on Windows (VC10) crashes (access error)
----------------------------------+-----------------------------------------
Reporter: aris.basic@⦠| Owner: bemandawes
Type: Bugs | Status: new
Milestone: To Be Determined | Component: filesystem
Version: Boost 1.48.0 | Severity: Showstopper
Keywords: |
----------------------------------+-----------------------------------------
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 <boost/thread.hpp>
#include <boost/filesystem.hpp>
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<wchar_t,char,int>::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<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t>
> & target, const std::codecvt<wchar_t,char,int> & cvt) Line 84 + 0x25
bytes C++
filesystem_crash.exe!boost::filesystem3::path_traits::convert(const char *
from, const char * from_end,
std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t>
> & to, const std::codecvt<wchar_t,char,int> & cvt) Line 165 + 0x20 bytes
C++
filesystem_crash.exe!boost::filesystem3::path_traits::dispatch<std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t>
> >(const
std::basic_string<char,std::char_traits<char>,std::allocator<char> > & c,
std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t>
> & to, const std::codecvt<wchar_t,char,int> & cvt) Line 174 + 0x7e bytes
C++
filesystem_crash.exe!boost::filesystem3::path::path<std::basic_string<char,std::char_traits<char>,std::allocator<char>
> >(const
std::basic_string<char,std::char_traits<char>,std::allocator<char> > &
source, void * __formal) Line 135 + 0x13 bytes C++
filesystem_crash.exe!`anonymous
namespace'::<lambda0>::operator()() Line 15 + 0x10 bytes C++
filesystem_crash.exe!boost::detail::thread_data<`anonymous
namespace'::<lambda0> >::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
}}}
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/6320> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:08 UTC