Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throw filesystemerror (errno EINTR) in CIFS mounted disk. #146

Closed
bxwllzz opened this issue May 26, 2022 · 2 comments
Closed

Throw filesystemerror (errno EINTR) in CIFS mounted disk. #146

bxwllzz opened this issue May 26, 2022 · 2 comments
Assignees
Labels
available on master Fix is done on master branch, issue closed on next release bug Something isn't working POSIX POSIX type backend is affected
Milestone

Comments

@bxwllzz
Copy link

bxwllzz commented May 26, 2022

Describe the bug
Throw unexpected filesystemerror (errno EINTR) in CIFS mounted disk.

terminate called after throwing an instance of 'ghc::filesystem::filesystem_error'
  what():  Interrupted system call: '/mnt/nas_xxx'

strace shows:

...
openat(AT_FDCWD, "/mnt/nas_xxx", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 8
fstat(8, {st_mode=S_IFDIR|0777, st_size=0, ...}) = 0
getdents64(8, 0x5637c220a1c0, 1048576)  = -1 EINTR (Interrupted system call)
close(8)                                = 0
...

To Reproduce
Use ghc::filesystem::recursive_directory_iterator in disk mounted by CIFS

Expected behavior
Retry syscall if errno is EINTR (in my case ::opendir)

Additional context
std::filesystem in gcc 9.4 (Ubuntu 20.04) has same problem.

terminate called after throwing an instance of 'std::filesystem::__cxx11::filesystem_error'
  what():  filesystem error: cannot increment recursive directory iterator: Interrupted system call

boost::filesystem 1.71.0 has same problem.

terminate called after throwing an instance of 'boost::filesystem::filesystem_error'
  what():  filesystem::recursive_directory_iterator directory error: Interrupted system call

boost::filesystem >= 1.74.0 seems fix this problem by retry syscall in EINTR ?
https://www.boost.org/doc/libs/1_74_0/libs/filesystem/src/operations.cpp

@gulrak
Copy link
Owner

gulrak commented Jun 14, 2022

Thanks for the details, I need to setup some test env to check this, might take a bit of time, but I'll look into it.

@gulrak gulrak added bug Something isn't working POSIX POSIX type backend is affected labels Jun 15, 2022
@gulrak gulrak added this to the v1.5.14 milestone Jun 15, 2022
@gulrak gulrak self-assigned this Mar 3, 2023
gulrak added a commit that referenced this issue Mar 4, 2023
@gulrak gulrak added the available on master Fix is done on master branch, issue closed on next release label Mar 4, 2023
@gulrak
Copy link
Owner

gulrak commented Mar 5, 2023

Released with v1.5.14.

@gulrak gulrak closed this as completed Mar 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
available on master Fix is done on master branch, issue closed on next release bug Something isn't working POSIX POSIX type backend is affected
Projects
None yet
Development

No branches or pull requests

2 participants