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

nullptr accessed in processEvents

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • Not Evaluated
    • None
    • 5.15.0 RC2
    • Core: Other
    • None
    • Qt Creator 4.14.2 on macOS.
    • All

    Description

      I have a call to QCoreApplication::processEvents() in a thread body.  The debugger halted because in this function:  qcoreapplication.cpp on line 1281, it reads:

      void QCoreApplication::processEvents(QEventLoop::ProcessEventsFlags flags)
      {
          QThreadData *data = QThreadData::current();    
          if (!data->hasEventDispatcher())        
              return;    
          data->eventDispatcher.loadRelaxed()->processEvents(flags);
      }
      

      There is no check on the pointer data which is nullptr and it is then dereferenced to try and call hasEventDispatcher,  Obviously the function should check data is valid before use.

      Attachments

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

        Activity

          People

            thiago Thiago Macieira
            simonplatten Simon Platten
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes