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

There is a potential bug in function socketNotifierSourceDispatch

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3: Somewhat important
    • 6.9
    • 6.8.0 Beta2
    • Core: Event loop
    • None
    • Linux/X11
    • 382c87333f06e034506624901fc2030dee5681ef

    Description

      In the function socketNotifierSourceDispatch, If we send an event here, we may enter a new event loop and then the new event loop will process the events including socket events. As a result, after exiting the new event loop, the activeNotifierPos is same as the src->pollfds.count() and activeNotifierPos will be added by one in the old event loop.

       

      So there is a potential situation that activeNotifierPos will overflow if we have too many sockets and nested event loops.

       

      Although this situation is almost impossible, we can improve the code by little effort. That's it.

       

      By the way, I have open a PR on github: Eliminate a potential bug and upload the patch file as an attachment.

      Attachments

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

        Activity

          People

            thiago Thiago Macieira
            kingysu Jim Green
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes