|
Boost : |
From: Noman_Khan_at_[hidden]
Date: 2008-08-26 09:22:49
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
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk