std:string to boost::filesystem::path, then, create directories.

Hi, all: After upgrading to boost 1.48.0, my code seems to stopping working. The original code is pretty simple: char* folderName = "./test"; if (!boost::filesystem::is_directory( folderName ) ) boost::filesystem::create_directories( folderName ); It used to work fine but after upgrading to boost 1.48.0, I got the following annoying errors always: Unhandled exception at 0x51d8ee9e (msvcr90d.dll) in myTest.exe: 0xC0000005: Access violation writing location 0xcdcdcdcd. The program stops at the line "if (!boost::filesystem::is_directory( folderName ) )", and the call stack seems to hint it's an error coming from memcpy.asm " TrailUp1: mov al,[esi] ;U - get byte from source ;V - spare mov [edi],al ;U - put byte in destination mov eax,[dst] ;V - return pointer to destination pop esi ;U - restore esi pop edi ;V - restore edi M_EXIT " Can anybody help me out? Thank you very much.... Best Regards Pei -- Pei JIA Email: jp4work@gmail.com cell: +1 604-362-5816 Welcome to Vision Open http://www.visionopen.com

Hi,
Unhandled exception at 0x51d8ee9e (msvcr90d.dll) in myTest.exe: 0xC0000005: Access violation writing location 0xcdcdcdcd.
Are you sure you use debug version of boost (as you get exception from debug version of msvcr)? I use 1.48 and is_directory on win32/win64/lin32/lin64 and I don't get any errors, also with win32 debug configurations. Regards, Bogdan

On 2012-02-10 10:48, Bogdan Slusarczyk wrote:
Hi,
Unhandled exception at 0x51d8ee9e (msvcr90d.dll) in myTest.exe: 0xC0000005: Access violation writing location 0xcdcdcdcd.
Are you sure you use debug version of boost (as you get exception from debug version of msvcr)?
I use 1.48 and is_directory on win32/win64/lin32/lin64 and I don't get any errors, also with win32 debug configurations.
I forgot to add that I use 1.48 with filesystem v2, however I've tested 1.48 v3 on win32 (also debug version) and I didn't noticed any problems.

Hi, Bogdan: Thank you for your prompt reply.... I don't even know whether debug or release of boost 1.48.0 is under use. But, I'm pretty sure under C:\boost_1_48_0\stage\lib, I've got 2 versions of built libraries for each sub-package. For example, for regex, I've got libboost_regex-vc90-mt-1_48.lib libboost_regex-vc90-mt-gd-1_48.lib I believe when debugging, libboost_regex-vc90-mt-gd-1_48.lib is under use. My code is now as simple as, still get the error. string tests = "aaa"; const char* aaa = tests.c_str(); boost::filesystem::path p ( aaa ); BTW, when I use VS2008's command prompt to build boost 1.48.0, there is no error report at all. What can I do????? BTW, I didn't specify which boost libraries I'm using at all. It seems VS2008 automatically find boost library by itself. I don't need to specify any dependent libraries in Linker-Input .... Cheers Pei On Fri, Feb 10, 2012 at 1:56 AM, Bogdan Slusarczyk < bogdan.slusarczyk@aldec.com.pl> wrote:
On 2012-02-10 10:48, Bogdan Slusarczyk wrote:
Hi,
Unhandled exception at 0x51d8ee9e (msvcr90d.dll) in myTest.exe: 0xC0000005: Access violation writing location 0xcdcdcdcd.
Are you sure you use debug version of boost (as you get exception from debug version of msvcr)?
I use 1.48 and is_directory on win32/win64/lin32/lin64 and I don't get any errors, also with win32 debug configurations.
I forgot to add that I use 1.48 with filesystem v2, however I've tested 1.48 v3 on win32 (also debug version) and I didn't noticed any problems. ______________________________**_________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/**mailman/listinfo.cgi/boost-**usershttp://lists.boost.org/mailman/listinfo.cgi/boost-users
-- Pei JIA Email: jp4work@gmail.com cell: +1 604-362-5816 Welcome to Vision Open http://www.visionopen.com

Hello, Bogdan:
Happen to notice if I change nothing else but only boost back to version
1.42.0, and use "boost::filesystem::path" , my project works fine.
I also tested examples including "tut1, tut2, tut3, tut4" of boost 1.48.0,
everything seems to work fine.
However, I seriously have no idea where the conflicts come from ( I mean
the conflicts between boost 1.48.0 and my code which has nothing to do with
boost at all )
why there seems to be no conflicts between boost 1.42.0 and my code???
So far, the only conclusion I can draw is: filesystem3 is not stable yet.
Pei
On Fri, Feb 10, 2012 at 2:32 PM, JIA Pei
Hi, Bogdan:
Thank you for your prompt reply.... I don't even know whether debug or release of boost 1.48.0 is under use. But, I'm pretty sure under C:\boost_1_48_0\stage\lib, I've got 2 versions of built libraries for each sub-package. For example, for regex, I've got
libboost_regex-vc90-mt-1_48.lib libboost_regex-vc90-mt-gd-1_48.lib
I believe when debugging, libboost_regex-vc90-mt-gd-1_48.lib is under use.
My code is now as simple as, still get the error.
string tests = "aaa"; const char* aaa = tests.c_str(); boost::filesystem::path p ( aaa );
BTW, when I use VS2008's command prompt to build boost 1.48.0, there is no error report at all. What can I do?????
BTW, I didn't specify which boost libraries I'm using at all. It seems VS2008 automatically find boost library by itself. I don't need to specify any dependent libraries in Linker-Input ....
Cheers Pei
On Fri, Feb 10, 2012 at 1:56 AM, Bogdan Slusarczyk < bogdan.slusarczyk@aldec.com.pl> wrote:
On 2012-02-10 10:48, Bogdan Slusarczyk wrote:
Hi,
Unhandled exception at 0x51d8ee9e (msvcr90d.dll) in myTest.exe: 0xC0000005: Access violation writing location 0xcdcdcdcd.
Are you sure you use debug version of boost (as you get exception from debug version of msvcr)?
I use 1.48 and is_directory on win32/win64/lin32/lin64 and I don't get any errors, also with win32 debug configurations.
I forgot to add that I use 1.48 with filesystem v2, however I've tested 1.48 v3 on win32 (also debug version) and I didn't noticed any problems. ______________________________**_________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/**mailman/listinfo.cgi/boost-**usershttp://lists.boost.org/mailman/listinfo.cgi/boost-users
--
Pei JIA
Email: jp4work@gmail.com cell: +1 604-362-5816
Welcome to Vision Open http://www.visionopen.com
-- Pei JIA Email: jp4work@gmail.com cell: +1 604-362-5816 Welcome to Vision Open http://www.visionopen.com

Happen to notice if I change nothing else but only boost back to version 1.42.0, and use "boost::filesystem::path" , my project works fine. I also tested examples including "tut1, tut2, tut3, tut4" of boost 1.48.0, everything seems to work fine. However, I seriously have no idea where the conflicts come from ( I mean the conflicts between boost 1.48.0 and my code which has nothing to do with boost at all ) why there seems to be no conflicts between boost 1.42.0 and my code???
So far, the only conclusion I can draw is: filesystem3 is not stable yet.
Most likely, this is not the reason. Check that you don't mix different boost version (eg., that you don't include some older boost headers).
participants (3)
-
Bogdan Slusarczyk
-
Igor R
-
JIA Pei