[Bug 1696386] [NEW] boost filesystem crash

Andrey Batyiev batyiev at gmail.com
Wed Jun 7 10:26:08 UTC 2017


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
Foundations Bugs, which is subscribed to boost1.58 in Ubuntu.
https://bugs.launchpad.net/bugs/1696386

Title:
  boost filesystem crash

Status in boost1.58 package in Ubuntu:
  New

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 manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/boost1.58/+bug/1696386/+subscriptions



More information about the foundations-bugs mailing list