Hi, I am having some trouble with the latest version of the Boost Filesystem library. The following causes a segmentation fault: boost::filesystem::create_directory(boost::filesystem::current_path()/"test"); boost::filesystem::remove_all(boost::filesystem::current_path()/"test"); It is difficult for me to debug since the call to remove_all dives into a library file. My system configuration is: Operating System: Ubuntu 11.10 Compiler: clang++ (I can reproduce the error with g++) Boost Version: 1.49.0 (compiled with clang++) Thanks, Sam
On 03/02/2012 08:25 PM, Sam Hertz wrote:
Hi,
I am having some trouble with the latest version of the Boost Filesystem library. The following causes a segmentation fault:
boost::filesystem::create_directory(boost::filesystem::current_path()/"test"); boost::filesystem::remove_all(boost::filesystem::current_path()/"test");
You know you're dividing, right? current_path() divided by constant string :-) -- Dipl.-Ing. (FH) Andreas Wehrmann Software Development -------------------------------------------------------------- Center Communication Systems GmbH A-1210 Wien, Ignaz-Köck-Straße 19 Sitz in Wien FN 796 88p, Firmenbuchgericht Wien www.centersystems.com Tel.: +43 (0) 190 199 - 3616 Mobile: +43 (0) 664 884 75916 Fax: +43 (0) 190 199 - 2110 E-Mail: a.wehrmann@centersystems.com
On Mon, Mar 05, 2012 at 08:45:20AM +0100, Andreas Wehrmann wrote:
On 03/02/2012 08:25 PM, Sam Hertz wrote:
boost::filesystem::create_directory(boost::filesystem::current_path()/"test"); boost::filesystem::remove_all(boost::filesystem::current_path()/"test");
You know you're dividing, right? current_path() divided by constant string :-)
What is this supposed to mean? It's not constructive and if it's a joke, it's a very poor one. If you truly are ignorant, Boost.Filesystem uses the binary '/' operator to mean path concatenation. As for the error, it may be due to converting the string literal into a fs::path object via an unexpected locale's codecvt or too early in the run-time to use a codecvt safely. Also, double-check that you're using matching headers to your built libraries, and that the libraries are built using the right compile-time settings. In particular, -std=c++0x tends to be a common mismatch. -- Lars Viklund | zao@acc.umu.se
On 03/05/2012 09:00 AM, Lars Viklund wrote:
On Mon, Mar 05, 2012 at 08:45:20AM +0100, Andreas Wehrmann wrote:
On 03/02/2012 08:25 PM, Sam Hertz wrote:
boost::filesystem::create_directory(boost::filesystem::current_path()/"test"); boost::filesystem::remove_all(boost::filesystem::current_path()/"test");
You know you're dividing, right? current_path() divided by constant string :-)
What is this supposed to mean? It's not constructive and if it's a joke, it's a very poor one.
I'm sorry, I was feeling lucky and took a chance. Won't happen again. -- Dipl.-Ing. (FH) Andreas Wehrmann Software Development -------------------------------------------------------------- Center Communication Systems GmbH A-1210 Wien, Ignaz-Köck-Straße 19 Sitz in Wien FN 796 88p, Firmenbuchgericht Wien www.centersystems.com Tel.: +43 (0) 190 199 - 3616 Mobile: +43 (0) 664 884 75916 Fax: +43 (0) 190 199 - 2110 E-Mail: a.wehrmann@centersystems.com
On 2012-03-02 20:25, Sam Hertz wrote:
I am having some trouble with the latest version of the Boost Filesystem library. The following causes a segmentation fault: boost::filesystem::create_directory(boost::filesystem::current_path()/"test"); boost::filesystem::remove_all(boost::filesystem::current_path()/"test");
Please narrow your problem a little bit. Do you have gpf inside oparator/? create_directory? remove_all? Do you use stlport? what returns current_path? Could you provide callstack? Regards, Bogdan
participants (4)
-
Andreas Wehrmann
-
Bogdan Slusarczyk
-
Lars Viklund
-
Sam Hertz