Details
-
Bug
-
Resolution: Done
-
P2: Important
-
4.6.3
-
None
-
-
b7256b1f8c9bb43c5234d24453aaa8b1c079cf06
Description
An incoming event for a file that is already unregistered from the watch list can cause an infinite loop in QKQueueFileSystemWatcher.
In this case the code calls continue which should process the next kqueue event but that fails because the directive of processing the next event is right before the while cycle directive:
... path = idToPath.value(id); if (path.isEmpty()) { DEBUG() << "QKqueueFileSystemWatcherEngine: received a kevent for a file we're not watching"; continue; ... r = kevent(kqfd, 0, 0, &kev, 1, &ZeroTimeout); } while (r > 0);
This case leads to an infinite loop with 100% CPU consume.
The attached patch indicates how to solve this issue.