Bug 578275 - eclipse hung when paste (stuck in ole.win32.COM.VtblCall) during JDT debug at breakpoint
Summary: eclipse hung when paste (stuck in ole.win32.COM.VtblCall) during JDT debug at...
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.22   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-01-19 04:44 EST by Jörg Kubitz CLA
Modified: 2022-03-08 08:50 EST (History)
3 users (show)

See Also:


Attachments
Screenshot Paste Sampled.png (127.70 KB, image/png)
2022-01-19 04:44 EST, Jörg Kubitz CLA
no flags Details
stacktrace all Threads.txt (67.62 KB, text/plain)
2022-01-19 04:46 EST, Jörg Kubitz CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jörg Kubitz CLA 2022-01-19 04:44:54 EST
Created attachment 287852 [details]
Screenshot Paste Sampled.png

total freeze until debugged application was killed:
I just tried to paste a string to java editor (normally works), but eclipse does not progress. (did not respond for like 15 min).
Stacktrace is most time:

        at org.eclipse.swt.internal.ole.win32.COM.VtblCall(Native Method)
        at org.eclipse.swt.internal.ole.win32.IDataObject.GetData(Unknown Source)
        at org.eclipse.swt.dnd.Transfer.getData(Unknown Source)
        at org.eclipse.swt.dnd.TextTransfer.nativeToJava(Unknown Source)
        at org.eclipse.swt.dnd.Clipboard.getContents(Unknown Source)
        at org.eclipse.swt.custom.StyledText.getClipboardContent(Unknown Source)
        at org.eclipse.swt.custom.StyledText.paste(Unknown Source)
        at org.eclipse.jface.text.TextViewer.paste(Unknown Source)
        at org.eclipse.jface.text.TextViewer.doOperation(Unknown Source)
        at org.eclipse.jface.text.source.SourceViewer.doOperation(Unknown Source)
        at org.eclipse.jface.text.source.projection.ProjectionViewer.doOperation(Unknown Source)
        at org.eclipse.jdt.internal.ui.javaeditor.JavaSourceViewer.doOperation(Unknown Source)
        at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor$AdaptedSourceViewer.doOperation(Unknown Source)
        at org.eclipse.jdt.internal.ui.javaeditor.ClipboardOperationAction.doPasteWithImportsOperation(Unknown Source)
        at org.eclipse.jdt.internal.ui.javaeditor.ClipboardOperationAction.internalDoOperation(Unknown Source)
        at org.eclipse.jdt.internal.ui.javaeditor.ClipboardOperationAction$$Lambda$1876/0x0000000800e9c040.run(Unknown Source)
        at org.eclipse.swt.custom.BusyIndicator.showWhile(Unknown Source)
        at org.eclipse.jdt.internal.ui.javaeditor.ClipboardOperationAction.run(Unknown Source)
        at org.eclipse.jface.action.Action.runWithEvent(Unknown Source)
...

however i also took a sample with visualvm which show thats sometimes also other stacktraces appear (see screenshot).

one of them was (from jstack) for example:

"main" #1 prio=6 os_prio=0 cpu=151593.75ms elapsed=8563.30s tid=0x0000018772da8800 nid=0x4c30 runnable  [0x0000005ae1ef6000]
   java.lang.Thread.State: RUNNABLE
        at org.eclipse.swt.widgets.Tree.windowProc(Tree.java:5825)
        at org.eclipse.swt.widgets.Display.windowProc(Display.java:5010)
        at org.eclipse.swt.internal.win32.OS.SendMessage(Native Method)
        at org.eclipse.swt.widgets.Tree.imageIndex(Tree.java:3696)
        at org.eclipse.swt.widgets.Tree.wmNotifyChild(Tree.java:7378)
        at org.eclipse.swt.widgets.Control.wmNotify(Control.java:5807)
        at org.eclipse.swt.widgets.Composite.wmNotify(Composite.java:1961)
        at org.eclipse.swt.widgets.Control.WM_NOTIFY(Control.java:5375)
        at org.eclipse.swt.widgets.Control.windowProc(Control.java:4809)
        at org.eclipse.swt.widgets.Display.windowProc(Display.java:5002)
        at org.eclipse.swt.internal.win32.OS.CallWindowProc(Native Method)
        at org.eclipse.swt.widgets.Tree.callWindowProc(Tree.java:1542)
        at org.eclipse.swt.widgets.Control.windowProc(Control.java:4854)
        at org.eclipse.swt.widgets.Tree.windowProc(Tree.java:5997)
        at org.eclipse.swt.widgets.Display.windowProc(Display.java:5010)
        at org.eclipse.swt.internal.ole.win32.COM.VtblCall(Native Method)
...


Sometimes i saw at least a cursor blinking.

similiar stacktrace was posted 2 month ago at https://stackoverflow.com/questions/69855678/swt-clipboard-getcontents-seems-to-hang-on-windows

It happend while i was debugging a java application. And the application was in a breakpoint.
After i killed the debugged application a string (some text i copied long time after i started to paste) was pasted and eclipse responded again.
Comment 1 Jörg Kubitz CLA 2022-01-19 04:46:50 EST
Created attachment 287853 [details]
stacktrace all Threads.txt

Version: 2021-12 (4.22)
Build id: I20211124-1800
Comment 2 Jörg Kubitz CLA 2022-01-19 05:51:15 EST
similar report in bug 131647

After reading the comments in org.eclipse.swt.dnd.Clipboard.getContents(Transfer, int)
i can be reproduce it:

1. start eclipse
2. debug - run a product "org.eclipse.sdk.ide"
3. copy a text from the started product
4. place a breakpoint in the "main" (SWT) thread
5. do something in the product to run into the breakpoint
6. paste the text in eclipse

=>

Eclipse can not progress because waiting for input from the debugged application.
The debugged application can not progress because stopped in a breakpoint.

=> Deadlock
Comment 3 Jörg Kubitz CLA 2022-01-19 06:25:46 EST
I would prefer if Swt would show a "OLE Server busy" dialog or just a timeout when such happens.
Like in microsoft products https://docs.microsoft.com/en-us/cpp/mfc/reference/colemessagefilter-class?view=msvc-170#enablenotrespondingdialog

but i am not deep enough into that topic to provide a patch