Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 353540

Summary: FilteredItemsSelectionDialog dialog hangs on big selection
Product: [Eclipse Project] Platform Reporter: Andrey Rodionov <dernasherbrezon>
Component: UIAssignee: Platform UI Triaged <platform-ui-triaged>
Status: CLOSED WONTFIX QA Contact:
Severity: critical    
Priority: P3 CC: daniel_megert, ob1.eclipse, remy.suen, saravanavela
Version: 3.7Keywords: performance
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard: stalebug

Description Andrey Rodionov CLA 2011-08-02 04:02:25 EDT
Build Identifier: 

While opening "Open Resource" dialog with multiline big selection, it becomes irresponsive and IDE completely hangs.

Expected:
 * while opening "Open Resource" dialog verify number of symbols in selection
 ** if its more than, let's say, 140 symbols, show "Open Resource" dialog with empty search 
 ** otherwise, show dialog is of now

Workaround:
 * check selection before opening dialog

Reproducible: Always

Steps to Reproduce:
1. Open big text file. For example 1631 lines of:
"asdaskdjbsdmvbxmcnxkdjhgwgo48iwesgnd,mnxb,xmcbn,xcmnx,mcnx,mcbnx,cmbnx,cmbnxldksjpedgjsdroigj"
2. Select all text (ctrl-a)
3. Open dialog "Open Resource"
Comment 1 Andrey Rodionov CLA 2011-08-02 04:03:08 EDT
Build id: 20100218-1602
Comment 2 Oleg Besedin CLA 2011-08-03 11:37:12 EDT
Can you attach a stack dump as described here:

http://wiki.eclipse.org/index.php/How_to_report_a_deadlock

- When you say "hangs" do you mean "becomes slow/unresponsive for a few seconds" or "becomes unresponsive and has to be killed in a few minutes"?

-  Do you have Perforce plugin installed?
Comment 3 Andrey Rodionov CLA 2011-08-04 02:07:47 EDT
- "hangs" means irresponsive. Eclipse doesnt deadlock, but this window couldnt be closed. "Open Resource" got focus, so whole eclipse unreachable.

- I had perforce plugin installed, but deleted it.
Comment 4 Dani Megert CLA 2011-08-04 03:22:33 EDT
I cannot reproduce this. Please create a stack trace while waiting and attach it here.
Comment 5 Remy Suen CLA 2011-08-08 14:56:17 EDT
The problem comes from the dialog deciding to set the contents of the current selection into the dialog's text control. This ends up being a problem due to its ridiculous length.

I can reproduce the issue with the 3.x I20110705-0800 build.
Comment 6 Dani Megert CLA 2011-08-09 02:48:06 EDT
(In reply to comment #5)
> The problem comes from the dialog deciding to set the contents of the current
> selection into the dialog's text control. This ends up being a problem due to
> its ridiculous length.
> 
> I can reproduce the issue with the 3.x I20110705-0800 build.

(In reply to comment #4)
> I cannot reproduce this. Please create a stack trace while waiting and attach
> it here.

OK, I can also reproduce but it needs around 20000 lines to notice something close to a "hang".

It's funny where it burns the cycles:

"main" prio=6 tid=0x0022b000 nid=0x11c4 runnable [0x00ebc000]
   java.lang.Thread.State: RUNNABLE
        at org.eclipse.swt.internal.win32.OS.DrawTextW(Native Method)
        at org.eclipse.swt.internal.win32.OS.DrawText(OS.java:2552)
        at org.eclipse.swt.widgets.Text.computeSize(Text.java:484)
        at org.eclipse.swt.layout.GridData.computeSize(GridData.java:491)
        at org.eclipse.swt.layout.GridLayout.layout(GridLayout.java:218)
        at org.eclipse.swt.layout.GridLayout.computeSize(GridLayout.java:163)
        at org.eclipse.swt.widgets.Composite.computeSize(Composite.java:233)
        at org.eclipse.swt.layout.GridData.computeSize(GridData.java:491)
        at org.eclipse.swt.layout.GridLayout.layout(GridLayout.java:218)
        at org.eclipse.swt.layout.GridLayout.computeSize(GridLayout.java:163)
        at org.eclipse.swt.widgets.Composite.computeSize(Composite.java:233)
        at org.eclipse.swt.layout.GridData.computeSize(GridData.java:491)
        at org.eclipse.swt.layout.GridLayout.layout(GridLayout.java:218)
        at org.eclipse.swt.layout.GridLayout.computeSize(GridLayout.java:163)
        at org.eclipse.swt.widgets.Composite.computeSize(Composite.java:233)
        at org.eclipse.swt.layout.GridData.computeSize(GridData.java:491)
        at org.eclipse.swt.layout.GridLayout.layout(GridLayout.java:218)
        at org.eclipse.swt.layout.GridLayout.computeSize(GridLayout.java:163)
        at org.eclipse.swt.widgets.Composite.computeSize(Composite.java:233)
        at org.eclipse.jface.window.Window.getInitialSize(Window.java:594)
        at org.eclipse.jface.dialogs.Dialog.getInitialSize(Dialog.java:1196)
        at org.eclipse.jface.window.Window.initializeBounds(Window.java:764)
        at org.eclipse.jface.dialogs.Dialog.initializeBounds(Dialog.java:714)
        at org.eclipse.ui.internal.ide.dialogs.OpenResourceDialog.initializeBounds(OpenResourceDialog.java:191
        at org.eclipse.jface.window.Window.create(Window.java:435)
        at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1089)
        at org.eclipse.ui.dialogs.SelectionStatusDialog.create(SelectionStatusDialog.java:153)
        at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.create(FilteredItemsSelectionDialog.java:357)
        at org.eclipse.jface.window.Window.open(Window.java:790)
        at org.eclipse.ui.dialogs.FilteredResourcesSelectionDialog.open(FilteredResourcesSelectionDialog.java:
Comment 7 Saravanan Rathinavel CLA 2015-11-16 02:11:59 EST
becomes slow/unresponsive for a few seconds
Comment 8 Dani Megert CLA 2019-01-29 12:04:57 EST
Same for 'Open Type'. In my big workspace it blocks for minutes!

Here's the relevant part of the stack trace:

"main" #1 prio=6 os_prio=0 cpu=563132.41ms elapsed=172142.48s tid=0x0000000000501800 nid=0x2a24 runnable  [0x0000000002778000]
   java.lang.Thread.State: RUNNABLE
        at org.eclipse.swt.internal.win32.OS.CallWindowProc(Native Method)
        at org.eclipse.swt.widgets.Table.callWindowProc(Table.java:460)
        at org.eclipse.swt.widgets.Table.callWindowProc(Table.java:454)
        at org.eclipse.swt.widgets.Table.windowProc(Table.java:5750)
        at org.eclipse.swt.widgets.Display.windowProc(Display.java:4778)
        at org.eclipse.swt.internal.win32.OS.CallWindowProc(Native Method)
        at org.eclipse.swt.widgets.Table.callWindowProc(Table.java:588)
        at org.eclipse.swt.widgets.Table.callWindowProc(Table.java:454)
        at org.eclipse.swt.widgets.Control.windowProc(Control.java:4867)
        at org.eclipse.swt.widgets.Table.windowProc(Table.java:5836)
        at org.eclipse.swt.widgets.Display.windowProc(Display.java:4770)
        at org.eclipse.swt.internal.win32.OS.SendMessage(Native Method)
        at org.eclipse.swt.widgets.TableItem.getBounds(TableItem.java:273)
        at org.eclipse.swt.widgets.TableItem.getBounds(TableItem.java:256)
        at org.eclipse.swt.widgets.TableItem.redraw(TableItem.java:722)
        at org.eclipse.swt.widgets.TableItem.setImage(TableItem.java:1130)
        at org.eclipse.jface.viewers.TableViewerRow.setImage(TableViewerRow.java:111)
        at org.eclipse.jface.viewers.ViewerCell.setImage(ViewerCell.java:172)
        at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog$ItemsListLabelProvider.update(FilteredItemsSelectionDialog.java:1633)
        at org.eclipse.jface.viewers.ViewerColumn.refresh(ViewerColumn.java:144)
        at org.eclipse.jface.viewers.AbstractTableViewer.doUpdateItem(AbstractTableViewer.java:394)
        at org.eclipse.jface.viewers.StructuredViewer$UpdateItemSafeRunnable.run(StructuredViewer.java:478)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
        at org.eclipse.ui.internal.JFaceUtil.lambda$0(JFaceUtil.java:47)
        at org.eclipse.ui.internal.JFaceUtil$$Lambda$103/0x0000000016d17040.run(Unknown Source)
        at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:176)
        at org.eclipse.jface.viewers.StructuredViewer.refreshItem(StructuredViewer.java:1550)
        at org.eclipse.jface.viewers.AbstractTableViewer.replace(AbstractTableViewer.java:1014)
        at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog$ContentProvider.updateElement(FilteredItemsSelectionDialog.java:2748)
        at org.eclipse.jface.viewers.AbstractTableViewer.getVirtualSelection(AbstractTableViewer.java:496)
        at org.eclipse.jface.viewers.AbstractTableViewer.getSelectionFromWidget(AbstractTableViewer.java:469)
        at org.eclipse.jface.viewers.StructuredViewer.getSelection(StructuredViewer.java:1037)
        at org.eclipse.jface.viewers.StructuredViewer.handleSelect(StructuredViewer.java:1225)
        at org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected(StructuredViewer.java:1254)
        at org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenStrategy.java:243)
        at org.eclipse.jface.util.OpenStrategy.access$4(OpenStrategy.java:238)
        at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:403)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
        at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4131)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1055)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1079)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1064)
        at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:778)
        at org.eclipse.ui.internal.handlers.SelectAllHandler.execute(SelectAllHandler.java:129)
Comment 9 Eclipse Genie CLA 2021-01-19 12:49:14 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.