erikzenker / inotify-cpp

A C++ interface for linux inotify
MIT License
136 stars 37 forks source link

wdToPath crashes #90

Open belousotroll opened 1 year ago

belousotroll commented 1 year ago

0 0x0000000000585cc4 in boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector >::clone_impl(boost::exception_detail::error_info_injector const&) ()

1 0x00000000005847bb in boost::wrapexcept::wrapexcept(boost::exception_detail::error_info_injector const&) ()

2 0x0000000000582d91 in boost::wrapexcept<boost::exception_detail::remove_error_info_injector::type> boost::exception_detail::enable_both(std::out_of_range const&) ()

3 0x0000000000580f9f in void boost::throw_exception(std::out_of_range const&) ()

4 0x000000000057f50b in std::filesystem::cxx11::path const& boost::bimaps::detail::non_mutable_data_unique_map_view_access<boost::bimaps::views::map_view<boost::bimaps::relation::member_at::left, boost::bimaps::detail::bimap_core<int, std::filesystem::_cxx11::path, mpl::na, mpl::na, mpl::na> >, boost::bimaps::relation::member_at::left, boost::bimaps::detail::bimap_core<int, std::filesystem::cxx11::path, mpl::na, mpl::na, mpl_::na> >::at(int const&) const ()

5 0x000000000057d2e5 in inotify::Inotify::wdToPathabi:cxx11 ()

6 0x000000000057da2d in inotify::Inotify::readEventsFromBuffer(unsigned char*, int, std::vector<inotify::FileSystemEvent, std::allocator >&) ()

7 0x000000000057d457 in inotify::Inotify::getNextEvent() ()

8 0x0000000000577ac3 in inotify::NotifierBuilder::runOnce() ()

Something went wrong in that area.

belousotroll commented 1 year ago

I don't understand C++ and Linux well enough, so it's hard for me to find the cause of the crash. As I understand it, the reason is that event->wd passes an invalid file descriptor, but I don't understand how.

Maybe you can help me to figure out this issue. It happens once per 2-3 months, hard to detect/reproduce.