Subject: [Boost-bugs] [Boost C++ Libraries] #7698: Boost directory iterator constructor crashes when folder gives input/output error
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-11-15 13:34:43
#7698: Boost directory iterator constructor crashes when folder gives input/output
error
------------------------------+---------------------------------------------
Reporter: cpl | Owner: bemandawes
Type: Bugs | Status: new
Milestone: To Be Determined | Component: filesystem
Version: Boost 1.47.0 | Severity: Problem
Keywords: |
------------------------------+---------------------------------------------
By using the directory iterator on a non accessible forlder under Linux,
the following crash happens:
#0 0x0000003064a329a5 in raise () from /lib64/libc.so.6
#1 0x0000003064a34185 in abort () from /lib64/libc.so.6
#2 0x0000003064a2b935 in __assert_fail () from /lib64/libc.so.6
#3 0x000000000043a7b5 in
boost::shared_ptr<boost::filesystem3::detail::dir_itr_imp>::operator->
(this=0x7fffd216cf30)
at /usr/include/boost/smart_ptr/shared_ptr.hpp:414
#4 0x00000000005e89f2 in
boost::filesystem3::detail::directory_iterator_increment (it=..., ec=0x0)
at libs/filesystem/v3/src/operations.cpp:1947
#5 0x00000000004363af in
boost::filesystem3::directory_iterator::increment (this=0x7fffd216cf30) at
/usr/include/boost/filesystem/v3/operations.hpp:630
#6 0x00000000005e8810 in
boost::filesystem3::detail::directory_iterator_construct (it=..., p=...,
ec=0x7fffd216cf40)
at libs/filesystem/v3/src/operations.cpp:1918
#7 0x000000000054a120 in
boost::filesystem3::directory_iterator::directory_iterator
(this=0x7fffd216cf30, p=..., ec=...)
at /usr/include/boost/filesystem/v3/operations.hpp:598
A sample code that generates the crash is the following:
boost::system::error_code ec;
boost::filesystem3::directory_iterator itr(dir_path, ec);
Where the dir_path is a folder that is not accessible. Using the ls
command from terminal on the same folder returns:
input/output error
If the error returned is permission denied, everything works fine. I
triggered the input/output error using the curlftpfs library which mounts
a ftp as a folder on the system. The permission denied error can be
generated on the same folder using nfs share.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/7698> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:11 UTC