Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 351269 - Display#asyncExec causes deadlock
Summary: Display#asyncExec causes deadlock
Status: RESOLVED WORKSFORME
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: 1.3   Edit
Hardware: All All
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-06 02:54 EDT by maoxuepeng CLA
Modified: 2011-12-22 09:10 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description maoxuepeng CLA 2011-07-06 02:54:24 EDT
Build Identifier: 20090619-0625

when we call the Display.asyncExec a little more frequently, then, the thread who call Display.asyncExec and the UIThread were dead locked.

stack info-------------------------
Found one Java-level deadlock:
=============================
"UIThread [1318389028214@180F4F39B29FFC8C43A72AE025367F56]":
  waiting to lock monitor 0x00002aaabd515d10 (object 0x00002aaab138d008, a java.lang.Object),
  which is held by "pool-5-thread-12"
"pool-5-thread-12":
  waiting to lock monitor 0x00002aaac0b8d1e0 (object 0x00002aaab27c2168, a java.lang.Object),
  which is held by "UIThread [1318342863314@0EB611216119E381C23A320412CA3939]"
"UIThread [1318342863314@0EB611216119E381C23A320412CA3939]":
  waiting to lock monitor 0x00002aaabd43db40 (object 0x00002aaab27b8930, a java.lang.Object),
  which is held by "pool-5-thread-12"


"pool-5-thread-12":
	at org.eclipse.rwt.internal.lifecycle.UICallBackManager.sendUICallBack(UICallBackManager.java:69)
	- waiting to lock <0x00002aaab27c2168> (a java.lang.Object)
	at org.eclipse.swt.widgets.Display$2.run(Display.java:1161)
	at org.eclipse.rwt.internal.lifecycle.FakeContextUtil.runNonUIThreadWithFakeContext(FakeContextUtil.java:60)
	at org.eclipse.rwt.lifecycle.UICallBack.runNonUIThreadWithFakeContext(UICallBack.java:48)
	at org.eclipse.swt.widgets.Display.wakeThread(Display.java:1159)
	at org.eclipse.swt.widgets.Synchronizer.addLast(Synchronizer.java:73)
	at org.eclipse.swt.widgets.Synchronizer.asyncExec(Synchronizer.java:95)
	at org.eclipse.ui.internal.UISynchronizer.asyncExec(UISynchronizer.java:129)
	at org.eclipse.swt.widgets.Display.asyncExec(Display.java:984)
	- locked <0x00002aaab27b8930> (a java.lang.Object)
	at imap.vts.osmu.maint.ui.BoardListComposite$BoardIPNetMaskListener.stateChanged(BoardListComposite.java:951)
	at imap.vts.osmu.svc.impl.boardstate.ServerContextMgr.notifyIPAndNetmaskChangedListeners(ServerContextMgr.java:885)
	- locked <0x00002aaab138d008> (a java.lang.Object)
	at imap.vts.osmu.svc.impl.boardstate.device.DeviceStateBase.notifyIPAndNetmaskChangedListeners(DeviceStateBase.java:135)
	at imap.vts.osmu.svc.impl.boardstate.device.DeviceStateBase.notifyListeners(DeviceStateBase.java:118)
	- locked <0x00002aaab1b99130> (a java.lang.Object)
	at imap.vts.osmu.svc.impl.boardstate.device.DeviceStateBase.resetStateContext(DeviceStateBase.java:92)
	at imap.vts.osmu.svc.impl.boardstate.MultiQueryState$1.executeDetailHandler(MultiQueryState.java:36)
	at imap.vts.osmu.common.threadpool.DataHandleThread.call(DataHandleThread.java:83)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:619)
"UIThread [1318342863314@0EB611216119E381C23A320412CA3939]":
	at org.eclipse.swt.graphics.Device.isDisposed(Device.java:300)
	- waiting to lock <0x00002aaab27b8930> (a java.lang.Object)
	at org.eclipse.rwt.internal.lifecycle.UICallBackManager.hasRunnables(UICallBackManager.java:100)
	at org.eclipse.rwt.internal.lifecycle.UICallBackManager.notifyUIThreadEnd(UICallBackManager.java:91)
	- locked <0x00002aaab27c2168> (a java.lang.Object)
	at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.sleep(RWTLifeCycle.java:297)
	at org.eclipse.swt.widgets.Display.sleep(Display.java:1128)
	at org.eclipse.ui.application.WorkbenchAdvisor.eventLoopIdle(WorkbenchAdvisor.java:361)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2391)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2351)
	at org.eclipse.ui.internal.Workbench.access$5(Workbench.java:2206)
	at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:424)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.jface.internal.databinding.realmadapter.RealmAdapter.run(RealmAdapter.java:44)
	at org.eclipse.rap.ui.internal.RealmAdapterHook.runWithDefault(RealmAdapterHook.java:48)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:427)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:157)
	at imap.vts.ui.internal.RapApplication.createUI(RapApplication.java:81)
	at org.eclipse.rwt.internal.lifecycle.EntryPointManager.createUI(EntryPointManager.java:92)
	at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWTLifeCycle.java:245)
	at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadController.run(RWTLifeCycle.java:114)
	- locked <0x00002aaab2721328> (a org.eclipse.rwt.internal.lifecycle.UIThread)
	at java.lang.Thread.run(Thread.java:619)
	at org.eclipse.rwt.internal.lifecycle.UIThread.run(UIThread.java:102)

-------------------------------

it is easy to reproduce, is there any workround about it?

Reproducible: Sometimes

Steps to Reproduce:
1. In an object that hold a collection of listeners.
2. Start a backround thered every seconds, e.g 30s, notify the listeners.
3. In the listeners, call Display.asyncExec(new Runnable()...).
4. Open many browser, after a few minuts, it maybe dead locked.
Comment 1 Ralf Sternberg CLA 2011-07-10 04:58:11 EDT
Could you try to reproduce this issue with RAP 1.4? There are no further builds planned for 1.3, so if we can only repair it in 1.4 if the issue still exists there.
Thanks.
Comment 2 Ralf Sternberg CLA 2011-12-22 09:10:16 EST
Resolving this issue as it has been reported for 1.3 and there is no indication that is is present also in 1.4+.
Please reopen if you can reproduce it with RAP 1.4 or later.