Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 340996 - Some widgets not repainting (on some systems)
Summary: Some widgets not repainting (on some systems)
Status: CLOSED NOT_ECLIPSE
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.6.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-25 15:28 EDT by Gary Karasiuk CLA
Modified: 2011-03-30 12:01 EDT (History)
3 users (show)

See Also:


Attachments
screenshot (51.76 KB, image/gif)
2011-03-29 10:33 EDT, Gary Karasiuk CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gary Karasiuk CLA 2011-03-25 15:28:55 EDT
We have a problem (in our adopting product) where a modal dialog causes the main Eclipse window to not repaint. In fact even part of the dialog doesn't repaint.

This happens on some systems, but not others. 

What sort of information do you need to debug a problem like this?

This is the version we are using:

org.eclipse.swt.win32.win32.x86_3.6.2.v3659c.jar

Here is a snippet from the UI thread:

3XMTHREADINFO      "main" J9VMThread:0x41A01300, j9thread_t:0x008C6184, java/lang/Thread:0x009D2950, state:CW, prio=6
3XMTHREADINFO1            (native thread ID:0x8DC, native priority:0x6, native policy:UNKNOWN)
3XMTHREADINFO3           Java callstack:
4XESTACKTRACE                at org/eclipse/swt/internal/win32/OS.WaitMessage(Native Method)
4XESTACKTRACE                at org/eclipse/swt/widgets/Display.sleep(Bytecode PC:38(Compiled Code))
4XESTACKTRACE                at org/eclipse/jface/window/Window.runEventLoop(Bytecode PC:30)
4XESTACKTRACE                at org/eclipse/jface/window/Window.open(Bytecode PC:49)
4XESTACKTRACE                at com/ibm/support/feedback/crashreports/ui/internal/JavaCoreControlContribution$1.widgetSelected(Bytecode PC:16)
4XESTACKTRACE                at org/eclipse/swt/widgets/TypedListener.handleEvent(Bytecode PC:1005(Compiled Code))
4XESTACKTRACE                at org/eclipse/swt/widgets/EventTable.sendEvent(Bytecode PC:216(Compiled Code))
4XESTACKTRACE                at org/eclipse/swt/widgets/Widget.sendEvent(Bytecode PC:25(Compiled Code))
4XESTACKTRACE                at org/eclipse/swt/widgets/Display.runDeferredEvents(Bytecode PC:92(Compiled Code))
4XESTACKTRACE                at org/eclipse/swt/widgets/Display.readAndDispatch(Bytecode PC:69(Compiled Code))
4XESTACKTRACE                at org/eclipse/ui/internal/Workbench.runEventLoop(Bytecode PC:9)
4XESTACKTRACE                at org/eclipse/ui/internal/Workbench.runUI(Bytecode PC:555)
4XESTACKTRACE                at org/eclipse/ui/internal/Workbench.access$4(Bytecode PC:1)
4XESTACKTRACE                at org/eclipse/ui/internal/Workbench$7.run(Bytecode PC:55)
4XESTACKTRACE                at org/eclipse/core/databinding/observable/Realm.runWithDefault(Bytecode PC:14)
4XESTACKTRACE                at org/eclipse/ui/internal/Workbench.createAndRunWorkbench(Bytecode PC:18)
4XESTACKTRACE                at org/eclipse/ui/PlatformUI.createAndRunWorkbench(Bytecode PC:2)
Comment 1 Felipe Heidrich CLA 2011-03-28 11:31:10 EDT
Sorry Gary, we do not have enough information to start investigating your problem. Based on your description it sounds like there is too much processing happening in the UI thread (the UI thread is too busy and can't processes paints messages fast enough) - this usually means a bug in the application code (UI thread is doing work that should be done in background threads).
Please reopen this problem if you find more information that can help us to reprduce the problem here.
Comment 2 Gary Karasiuk CLA 2011-03-29 09:29:41 EDT
I don't think that the problem is the UI thread being busy. The CPU is idle while the window is still not repainting.

It has other odd symptoms as well. 

If we start the product from a development environment the problem does not occur. Although we can start it with remote debug enabled, and the problem does occur.

I tried turning on these debug options:

org.eclipse.ui/debug=true
org.eclipse.ui/debug/swtdebug=true
org.eclipse.ui/debug/swtdebugglobal=true

but nothing interesting was written to the log. 

To me it seems like the Windows events are not being dispatched to the Windows Controls.
Comment 3 Gary Karasiuk CLA 2011-03-29 09:32:00 EDT
(In reply to comment #1)
> ... if you find more information that can help us to
> reprduce the problem here.

What kind of information would you like?
Comment 4 Felipe Heidrich CLA 2011-03-29 09:40:57 EDT
(In reply to comment #3)
> What kind of information would you like?

a) a testcase that shows the bug
b) stacktraces
c) set of steps (using eclipse) that trigger the bug
Comment 5 Felipe Heidrich CLA 2011-03-29 09:44:55 EDT
(In reply to comment #2)
> I don't think that the problem is the UI thread being busy. The CPU is idle
> while the window is still not repainting.

what about other events ?
is the window responding to key or mouse events ?

> To me it seems like the Windows events are not being dispatched to the Windows
> Controls.

is it the entire window that is not painting or only part of it ?

the events are not dispatched when the ui thread does not run the event loop, if the UI thread is not busy then maybe it is waiting on a lock.

can you debug eclipse (self host) and stop the ui thread when the problem happens ? that will show as what the ui thread is doing.
Comment 6 Gary Karasiuk CLA 2011-03-29 10:21:47 EDT
This is getting even more bizarre.

I was doing my original testing on a remote system, using Window's remote desktop feature.

I went to the system that was having the problem, and accessed it locally. When accessed locally, there is no problem. I went back and connected via remote desktop and the problem reoccurred. 

This problem only happens with this one modal dialog, and it only effects the Main Eclipse Window. (i.e. all the Windows that I have open, Firefox, Explorer, ..,  are working correctly.
Comment 7 Gary Karasiuk CLA 2011-03-29 10:30:52 EDT
(In reply to comment #5)
> (In reply to comment #2)
> > I don't think that the problem is the UI thread being busy. The CPU is idle
> > while the window is still not repainting.
> 
> what about other events ?
> is the window responding to key or mouse events ?

The modal dialog is responding to other mouse events. The main Eclipse Window is not responding to anything.

> 
> > To me it seems like the Windows events are not being dispatched to the Windows
> > Controls.
> 
> is it the entire window that is not painting or only part of it ?

The title and the menu bar still repaint, the rest of the Window does not repaint. I will attach an example screen shot, where I moved the modal dialog around a bit.

> 
> the events are not dispatched when the ui thread does not run the event loop,
> if the UI thread is not busy then maybe it is waiting on a lock.
> 
> can you debug eclipse (self host) and stop the ui thread when the problem
> happens ? that will show as what the ui thread is doing.

The stack trace that I added to the description is while the problem is occurring. It shows that the UI thread in the normal state of waiting  for the next event. i.e. OS.WaitMessage(Native Method)
Comment 8 Gary Karasiuk CLA 2011-03-29 10:33:08 EDT
Created attachment 192094 [details]
screenshot
Comment 9 Gary Karasiuk CLA 2011-03-29 10:45:41 EDT
I was able to take the bundles for this dialog (there were only 8 of them), and install them into Eclipse 3.6.2.

The problem still occurs when viewing Eclipse through a Windows Remote Desktop.

Felipe, given that this is a remote desktop problem only, is this still something that you want to pursue? It may be a Windows bug, but it seems odd that I am only hitting this problem with this one dialog. The other dialogs that I tried (like New Project Wizard) are fine.
Comment 10 Gary Karasiuk CLA 2011-03-30 11:06:21 EDT
The developer of the dialog fixed a problem, and the repainting problem has now been fixed. 

If you would like you can close this defect, or if you would like to investigate how a dialog change could affect repainting only when running a remote desktop, I could try to get you the before and after dialog plug-ins.
Comment 11 Felipe Heidrich CLA 2011-03-30 11:47:32 EDT
Thank you for the update Gary, I would like to know what he was doing wrong but mostly for my curiosity at this point.
Comment 12 Troy Bishop CLA 2011-03-30 12:01:18 EDT
(In reply to comment #11)
> Thank you for the update Gary, I would like to know what he was doing wrong but
> mostly for my curiosity at this point.

I was populating a tree (via a content provider implementing org.eclipse.jface.viewers.ILazyTreeContentProvider) which ended up showing duplicate nodes (i.e. each node in the tree was, incorrectly, added twice).  I'm not sure how that caused the repainting problem that Gary was experiencing.