Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-12533

infinit loop at QKQueueFileSystemWatcher - Mac OS X

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 4.7.1
    • 4.6.3
    • Core: Event loop, Core: I/O
    • None
    • macOS
    • 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.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            dzyubenk Denis Dzyubenko (Inactive)
            bholm Benedikte Holm (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes