Public bug reported:

I'm using Ubuntu 16.04.

I'm trying to compile simple program using boost::filesystem:

#include <iostream>

#include <boost/filesystem.hpp>

namespace boostfs = boost::filesystem;

int main(int argc, char **argv)
{
    boostfs::path p = boostfs::path("/tmp/test/test2.txt").parent_path();

    std::cout << p.native() << std::endl;
    return 0;
}

However it crashes:

==3548== Invalid read of size 1
==3548==    at 0x4E49793: boost::filesystem::path::m_parent_path_end() const 
(in /usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.58.0)
==3548==    by 0x4E499B9: boost::filesystem::path::parent_path() const (in 
/usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.58.0)
==3548==    by 0x4016E8: main (main.cpp:9)
==3548==  Address 0xb51dc488d5803297 is not stack'd, malloc'd or (recently) 
free'd
==3548== 
==3548== 
==3548== Process terminating with default action of signal 11 (SIGSEGV)
==3548==  General Protection Fault
==3548==    at 0x4E49793: boost::filesystem::path::m_parent_path_end() const 
(in /usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.58.0)
==3548==    by 0x4E499B9: boost::filesystem::path::parent_path() const (in 
/usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.58.0)
==3548==    by 0x4016E8: main (main.cpp:9)

It seems there is a bug in the boost filesystem package.

** Affects: boost1.58 (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1696386

Title:
  boost filesystem crash

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/boost1.58/+bug/1696386/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to