Boost logo

Boost Users :

Subject: [Boost-users] filesystem path constructor fails when passing in std::string (Visual studio project)
From: Sillence, Martin (GE Oil & Gas) (Martin.Sillence_at_[hidden])
Date: 2012-03-15 13:28:03


Hi,

 

The simple code:

      std::string str("d:\\New folder");

      bfs::path base(str);

 

Is causing an illegal memory access giving the following stack trace:

 

 
msvcp90d.dll!std::basic_string<char,std::char_traits<char>,std::_DebugHe
apAllocator<char> >::assign(const
std::basic_string<char,std::char_traits<char>,std::_DebugHeapAllocator<c
har> > & _Right="*") Line 1052 C++

 
msvcp90d.dll!std::basic_string<char,std::char_traits<char>,std::_DebugHe
apAllocator<char> >::operator=(const
std::basic_string<char,std::char_traits<char>,std::_DebugHeapAllocator<c
har> > & _Right="*") Line 927 C++

     msvcp90d.dll!std::_DebugHeapString::operator=(const
std::_DebugHeapString & __that={...}) + 0x15 bytes C++

     app.exe!std::locale::locale<windows_file_codecvt>(const std::locale
& _Loc={...}, const windows_file_codecvt * _Facptr=0x18972860) Line 316
+ 0x27 bytes C++

     app.exe!`anonymous namespace'::default_locale() Line 735 C++

     app.exe!`anonymous namespace'::path_locale() Line 777 + 0x2a bytes
C++

     app.exe!boost::filesystem3::path::wchar_t_codecvt_facet() Line 797
+ 0x25 bytes C++

     app.exe!boost::filesystem3::path::codecvt() Line 389 + 0x5 bytes
C++

 
app.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="D:\New folder", void * __formal=0x00000000) Line 135 + 0x5
bytes C++

> app.exe!CDpiExport::configure() Line 188 + 0xe bytes C++

 

The project is set to use muti byte character support and this hasn't
changed in a while

 

I'm sure this was working before and I've reviewed the changes to the
project file and I can't see anything that might have broken it.

 

Any suggestions gratefully received.

 

Thanks,

M



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net