Opened 10 years ago

Last modified 5 years ago

#7698 new Bugs

Boost directory iterator constructor crashes when folder gives input/output error

Reported by: cpl Owned by: Beman Dawes
Milestone: To Be Determined Component: filesystem
Version: Boost 1.47.0 Severity: Problem
Keywords: Cc:

Description

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.

Change History (2)

comment:1 by anonymous, 9 years ago

Any movement here? I catch a construct error No such file or directory on the curlftpfs mountpoint.

comment:2 by zeal_goswami@…, 5 years ago

I am also facing issue any update

Note: See TracTickets for help on using tickets.