Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.6, 5.7.0
-
-
ad0d2f463a0905c4705660d96e8a514539c51d36 64475272a251b3ba773fec4bc6d00cfe46d1854b
Description
symptoms:
- load a qt-based plugin
- start a 'drag' operation of a text
- terminate the host
- crash
stack trace:
stack trace:
> Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
> 0 com.apple.CoreFoundation 0x00007fff940f3662 CFPasteboardGetGenerationCount + 66
> 1 com.apple.HIServices 0x00007fff894693ad IndexToItem(OpaquePasteboardRef*, long) + 30
> 2 com.apple.HIServices 0x00007fff8948c46c PasteboardCopyDataProc(void*, __CFPasteboard*, long, long, __CFString const*) + 190
> 3 com.apple.CoreFoundation 0x00007fff941a6e1b __CFPasteboardResolvePromiseForItemLocal + 539
> 4 com.apple.CoreFoundation 0x00007fff94176a75 CFPasteboardResolveAllPromisedData + 757
> 5 com.apple.CoreFoundation 0x00007fff941a170c _CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER_ + 12
> 6 com.apple.CoreFoundation 0x00007fff941a167f ___CFXRegistrationPost_block_invoke + 63
> 7 com.apple.CoreFoundation 0x00007fff941a0d47 _CFXRegistrationPost + 407
> 8 com.apple.CoreFoundation 0x00007fff941a0ab2 ___CFXNotificationPost_block_invoke + 50
> 9 com.apple.CoreFoundation 0x00007fff9419ad42 -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1922
> 10 com.apple.CoreFoundation 0x00007fff94089145 _CFXNotificationPost + 693
> 11 com.apple.Foundation 0x00007fff8c32d921 -[NSNotificationCenter postNotificationName:object:userInfo:] + 66
> 12 com.apple.AppKit 0x00007fff89c1490c -[NSApplication terminate:] + 1696
doing some tracing i figured out that this crash happens after the
QMacPasteboards have been destroyed.
> QMacPasteboard::~QMacPasteboard()
> {
> // commit all promises for paste after exit close
> for (int i = 0; i < promises.count(); ++i)
>
> if (paste)
> CFRelease(paste);
> }
apparently "lazy" promises are not cleaned up, which seems to be done on
purpose: https://codereview.qt-project.org/#/c/95091/
if i remove of if(lazyrequest) call, the crash disappears.
–
morten sorvig's comment:
The intended behavior of “lazy" promises is to delay pulling the data from
the application until the drop/paste happens and the target data type/flavor
is known.
“eager” promises can leave data behind after app exit, but as the comment
states I did not want to pull data from he application at shutdown time
for the lazy type.
I’d then like to find some way to cancel/resolve the promises without application
data. Provide fake (empty) data?
–
Attachments
Issue Links
- duplicates
-
QTBUG-54663 Crash for Mac apps involving resolving promises on the paste board
- Closed
- relates to
-
QTBUG-76263 Support lazy requests in QMacPasteboard::setMimeData
- Closed