https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90050
Bug ID: 90050
Summary: std::filesystem::path segfault in destructor
Product: gcc
Version: 8.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: mpreda at gmail dot com
Target Milestone: ---
#include <filesystem>
int main() {
std::filesystem::path p = "foo";
}
g++ -g --std=c++17 path.cpp
./a.out
Segmentation fault (core dumped)
g++ --version
g++ (Ubuntu 8.3.0-6ubuntu1) 8.3.0
uname -a
Linux x2 5.0.6-050006-generic #201904030534 SMP Wed Apr 3 05:36:14 UTC 2019
x86_64 x86_64 x86_64 GNU/Linux
Ubuntu 19.04.
Core was generated by `./a.out'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x000055c2ac25149b in std::vector<std::filesystem::__cxx11::path::_Cmpt,
std::allocator<std::filesystem::__cxx11::path::_Cmpt> >::~vector (this=0x23,
__in_chrg=<optimized out>) at /usr/include/c++/8/bits/stl_vector.h:567
567 std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
(gdb) bt
#0 0x000055c2ac25149b in std::vector<std::filesystem::__cxx11::path::_Cmpt,
std::allocator<std::filesystem::__cxx11::path::_Cmpt> >::~vector (this=0x23,
__in_chrg=<optimized out>) at /usr/include/c++/8/bits/stl_vector.h:567
#1 0x000055c2ac251314 in std::filesystem::__cxx11::path::~path (this=0x3,
__in_chrg=<optimized out>) at /usr/include/c++/8/bits/fs_path.h:208
#2 0x000055c2ac251f5c in std::filesystem::__cxx11::path::_Cmpt::~_Cmpt
(this=0x3, __in_chrg=<optimized out>) at /usr/include/c++/8/bits/fs_path.h:643
#3 0x000055c2ac251f77 in std::_Destroy<std::filesystem::__cxx11::path::_Cmpt>
(__pointer=0x3) at /usr/include/c++/8/bits/stl_construct.h:98
#4 0x000055c2ac251e27 in
std::_Destroy_aux<false>::__destroy<std::filesystem::__cxx11::path::_Cmpt*>
(__first=0x3, __last=0x0) at /usr/include/c++/8/bits/stl_construct.h:108
#5 0x000055c2ac251a98 in std::_Destroy<std::filesystem::__cxx11::path::_Cmpt*>
(__first=0x3, __last=0x0) at /usr/include/c++/8/bits/stl_construct.h:137
#6 0x000055c2ac2517a9 in std::_Destroy<std::filesystem::__cxx11::path::_Cmpt*,
std::filesystem::__cxx11::path::_Cmpt> (__first=0x3, __last=0x0) at
/usr/include/c++/8/bits/stl_construct.h:206
#7 0x000055c2ac2514b1 in std::vector<std::filesystem::__cxx11::path::_Cmpt,
std::allocator<std::filesystem::__cxx11::path::_Cmpt> >::~vector
(this=0x7ffe3ad201d0, __in_chrg=<optimized out>)
at /usr/include/c++/8/bits/stl_vector.h:567
#8 0x000055c2ac251314 in std::filesystem::__cxx11::path::~path
(this=0x7ffe3ad201b0, __in_chrg=<optimized out>) at
/usr/include/c++/8/bits/fs_path.h:208
#9 0x000055c2ac251230 in main () at path.cpp:4