Community
Participate
Working Groups
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.
Created attachment 287853 [details] stacktrace all Threads.txt Version: 2021-12 (4.22) Build id: I20211124-1800
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
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