Priority: P2: Important
Affects Version/s: 5.10.1
Fix Version/s: None
Environment:Mac OS 10.13.2, Qt Creator 4.5.2, Qt 5.9.4
We are using Qt 5.9.4 and Qt Creator 4.5.2 to debug a 64-bit application on Mac OS 10.13.2.
We consistently get a hang when we hit a breakpoint if we happen to copy text to the clipboard before we hit the breakpoint. The same thing happens if we crash after copying to the clipboard. Qt Creator hangs for 3 to 20 minutes during which time we get a spinning pizza. Eventually, Qt Creator becomes responsive and we can continue. This issue is a significant impediment for debugging.
I believe that the hang is related to Macintosh clipboard "promises" fulfilled by QMacPasteboard::promiseKeeper in qmacclipboard.mm, but I don't know exactly why it happens or how to avoid it.
I can reproduce the hang using the qtbase/examples/widgets/textedit example program as follows:
1. Open the qtbase/examples/widgets/richtext/textedit project in Qt Creator and launch the debug configuration.
2. Set a breakpoint at the start of TextEdit::fileOpen in textedit.cpp.
3. In the Qt textedit example program, select some text from the sample document and copy it to the clipboard.
4. Choose File->Open File.
On my machine, this hung Qt Creator with a spinning pizza for 12 minutes.
When Qt Creator finally responded, I continued the application and repeated the test with a similar result - a 3-minute delay before breaking.
You can avoid the problem by activating Qt Creator after copying the text in the Qt textedit example but before the breakpoint is hit, if you remember to do activate Qt Creator before you trigger the hang.