[filesystem] Boost 1.36 issue on Win64

Hi all I am trying to use Boost library on 64 bit windows and it is crashing whenever i call a boost function. I am using boost 1.36 with VS2008 and i have used the bellow line to compile boost's 64 bit version. bjam debug release threading=multi --toolset=msvc-9.0 architecture=x86 address-model=64 I am using BOOST_ALL_DYN_LINK preprocessor to link to boost. It crashes after saying that heap may be corrupted. Also it works fine if compiled for 32 bit windows. Here is a sample code that replicates the issue: /********************************************/ #include "boost/filesystem.hpp" int wmain(int argc, wchar_t* argv[]) { wchar_t path[] = L"c:/temp/test"; if(boost::filesystem::exists(path) ) { printf("Path exists.\n"); } else { printf("Path does not exists.\n"); } return 0; } /********************************************/ Here is the call stack at the time of the crash.
msvcr90d.dll!_CrtIsValidHeapPointer(const void *
pUserData=0x00000000005e9780) Line 2103 C++ msvcr90d.dll!_free_dbg_nolock(void * pUserData=0x00000000005e9780, int nBlockUse=1) Line 1317 + 0xa bytes C++ msvcr90d.dll!_free_dbg(void * pUserData=0x00000000005e9780, int nBlockUse=1) Line 1258 + 0xe bytes C++ msvcr90d.dll!operator delete(void * pUserData=0x00000000005e9780) Line 54 + 0x12 bytes C++ msvcp90d.dll!std::allocator<unsigned short>::deallocate(unsigned short * _Ptr=0x00000000005e9780, unsigned __int64 __formal=16) Line 147 C++ msvcp90d.dll!std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short>
::_Tidy(bool _Built=true, unsigned __int64 _Newsize=0) Line 2168 C++ msvcp90d.dll!std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> ::~basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> >() Line 916 + 0xf bytes C++
BoostTest.exe!boost::filesystem::exists<boost::filesystem::basic_path<std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t>
,boost::filesystem::wpath_traits> >(const boost::filesystem::basic_path<std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> ,boost::filesystem::wpath_traits> & ph={...}) Line 292 C++ BoostTest.exe!boost::filesystem::exists(const boost::filesystem::basic_path<std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> ,boost::filesystem::wpath_traits> & ph={...}) Line 626 + 0x2d bytes C++ BoostTest.exe!wmain(int argc=1, wchar_t * * argv=0x00000000005c9340) Line 9 + 0x1a bytes C++ BoostTest.exe!__tmainCRTStartup() Line 579 + 0x19 bytes C BoostTest.exe!wmainCRTStartup() Line 399 C
Best Regards M. Noman Khan

On Tue, Aug 26, 2008 at 10:22 AM, <Noman_Khan@elixir.com> wrote:
Hi all
[snip]
It crashes after saying that heap may be corrupted. Also it works fine if compiled for 32 bit windows. Here is a sample code that replicates the issue:
Looks like you're using a different runtime version than the compiled boost library. [snip]
Best Regards M. Noman Khan
-- Felipe Magno de Almeida

Felipe Magno de Almeida <felipe.m.almeida <at> gmail.com> writes:
[snip]
Looks like you're using a different runtime version than the compiled boost library.
As i have mentioned i have recompiled the boost code on the same machine and i am still getting the error. Also the 32 bit version compiled on the same machine works fine with a 32 bit compile of the sample application. Best Regards M. Noman Khan

On Wed, Aug 27, 2008 at 1:28 AM, Noman Khan <noman_khan@elixir.com> wrote:
Felipe Magno de Almeida <felipe.m.almeida <at> gmail.com> writes:
[snip]
Looks like you're using a different runtime version than the compiled boost library.
As i have mentioned i have recompiled the boost code on the same machine and i am still getting the error. Also the 32 bit version compiled on the same machine works fine with a 32 bit compile of the sample application.
Sorry if I can't be of more help. But what I see in the call stack is that the Heap doesn't see the address trying to be deleted by std::string as being one of its own. Which means that std::string is being created by other runtime version. Maybe you have a problem with VC9 SP1/no-SP1? If you're using the VC7.1 you might be using a single-threaded runtime. Or you might just be compiling your code with a static runtime?
Best Regards M. Noman Khan
HTH, -- Felipe Magno de Almeida
participants (3)
-
Felipe Magno de Almeida
-
Noman Khan
-
Noman_Khan@elixir.com