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

QClipboard::setMimeData() crash when another application try to copy data into the clipboard

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • Not Evaluated
    • None
    • 4.8.0
    • GUI: Drag and Drop
    • None
    • Windows7

    Description

      Hi,

      [Some information]

      • My application is able to export data to microsoft Excel.
      • To do such a thing, I use the class QClipboard to copy data into the clipboard
      • And I use an Excel ActiveX to paste data from the clipboard into Excel

      But the problem comes from the copy of data into the clipboard...

      [How the crash happened]

      • Open notepad and type a text
      • lauch my application and add data into it
      • run the export to excel process of my application (it will copy data into the clipboard)
      • At this moment, switch quickly to notepad, select the text and press "ctrl+c" to copy it into the clipboard
      • My application crashes..

      [Summary]
      QClipboard::setMimeData() crashes if at the same time, you copy something from the operating system into the clipboard

      [A litle part of the call stack]
      ole32 : SetClipboardDataObject : 0xb6
      ole32 : OleSetClipboard : 0x4a
      QtGui4 : QClipboard::setMimeData : 0x72 : j:\qt\4.7.2\src\gui\kernel\qclipboard_win.cpp @ 266
      QtGui4 : QClipboard::setText : 0x6c : j:\qt\4.7.2\src\gui\kernel\qclipboard.cpp @ 353

      [Faulty source code]
      265:
      266: if (OleSetClipboard(d->iData) != S_OK)

      { <===================================== HERE 267: d->releaseIData(); 268: qErrnoWarning("QClipboard::setMimeData: Failed to set data on clipboard"); 269: return; 270: }

      [Reason]
      Win32 exception - Access violation at 0x00000002: Bad read on 0x00000002

      If you need more information, do not hesitate to ask for details. It is not so hard for me to reproduce the issue.

      Best regards,

      Rémy

      Attachments

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

        Activity

          People

            paeglis Gatis Paeglis
            remyy CALLIGRAFI_REMY
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes