Boost logo

Boost Users :

Subject: [Boost-users] boost::filesystem::extension crashes on Linux
From: Jürgen Simon (simon_at_[hidden])
Date: 2014-11-26 16:49:17


Hello,

I have a crash with boost 1.56 that happens on SUSE Linux for me (uname -a : Linux r105b.meteo.uni-bonn.de 3.7.10-1.28-desktop #1 SMP PREEMPT Mon Feb 3 14:11:15 UTC 2014 (c9a2c6c) x86_64 x86_64 x86_64 GNU/Linux)

The crash happens in filesystem::extension() when listing a file from the following directory:

$ ls -la core
total 29802736
drwxr-xr-x 2 simon users 4096 Nov 25 14:40 .
drwxr-xr-x 7 simon users 4096 Nov 25 15:05 ..
-rw-r--r-- 1 simon users 30517985568 Nov 14 2013 rico.out.xy.core.nc

As you can see there’s only one file in there that ends on “.nc”. The following code crashes on Linux but works fine on OSX (with the same data):

fs::path f = fs::path(source_path);
std::string extension = fs::extension(f);

The GDB backtrace is:

#0 0x00007fffe09403d5 in raise () from /lib64/libc.so.6
#1 0x00007fffe0941858 in abort () from /lib64/libc.so.6
#2 0x00007fffe11438cd in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib64/libstdc++.so.6
#3 0x00007fffe11419c6 in ?? () from /usr/lib64/libstdc++.so.6
#4 0x00007fffe11419f3 in std::terminate() () from /usr/lib64/libstdc++.so.6
#5 0x00007fffe1141c1e in __cxa_throw () from /usr/lib64/libstdc++.so.6
#6 0x00007fffe119336d in std::__throw_runtime_error(char const*) () from /usr/lib64/libstdc++.so.6
#7 0x00007fffe115e844 in std::locale::facet::_S_create_c_locale(__locale_struct*&, char const*, __locale_struct*) () from /usr/lib64/libstdc++.so.6
#8 0x00007fffe1153774 in std::locale::_Impl::_Impl(char const*, unsigned long) () from /usr/lib64/libstdc++.so.6
#9 0x00007fffe11547af in std::locale::locale(char const*) () from /usr/lib64/libstdc++.so.6
#10 0x00007ffff753036f in boost::filesystem::path::codecvt() () from /usr/local/lib/libboost_filesystem.so.1.55.0
#11 0x00007ffff75307ff in boost::filesystem::path::begin() const () from /usr/local/lib/libboost_filesystem.so.1.55.0
#12 0x00007ffff7530f88 in boost::filesystem::path::compare(boost::filesystem::path const&) const () from /usr/local/lib/libboost_filesystem.so.1.55.0
#13 0x00007ffff75310f4 in boost::filesystem::path::extension() const () from /usr/local/lib/libboost_filesystem.so.1.55.0
#14 0x0000000000448adb in boost::filesystem::extension (p=...) at /usr/local/include/boost/filesystem/convenience.hpp:36

Any ideas how to circumvent this problem?

Jürgen



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net