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

SIGABRT in dragEnterEvent handler when accessing QMimeData of the event.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P2: Important
    • None
    • 5.6.1
    • None
    • Ubuntu 14.04 x64

    Description

      It looks like a race condition with QMimeData object in QDragEnterEvent.

      If we wait some time in dragEnterEvent handler, or if our reimplemented handler takes much time, then we could face such crash.

      void DragWidget::dragEnterEvent(QDragEnterEvent *event)
      {
          // mime data is checked if it has any urls
          if (event->mimeData()->hasUrls())
          {
              sleep(1);
              // after sleep it crashes because QList with urls appears to be empty.
              auto url = event->mimeData()->urls().first();
          }
          event->accept();
      }
      

      Stdout, then, has the following output:
      ASSERT: "!isEmpty()" in file /opt/qt561-debug/include/QtCore/qlist.h, line 335
      The program has unexpectedly finished.

      Attachments

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

        Activity

          People

            paeglis Gatis Paeglis
            rzhurov Roman
            Veli-Pekka Heinonen Veli-Pekka Heinonen
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes