boost filesystem crash

Bug #1696386 reported by Andrey Batyiev
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
boost1.58 (Ubuntu)
New
Undecided
Unassigned

Bug Description

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.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.