Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 351938 - ConcurrentModificationException in testTimerExecIsSerializable()
Summary: ConcurrentModificationException in testTimerExecIsSerializable()
Status: RESOLVED FIXED
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: 1.5   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-13 06:05 EDT by Holger Staudacher CLA
Modified: 2011-07-13 14:17 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Holger Staudacher CLA 2011-07-13 06:05:06 EDT
Today I executed our tests and saw a red test with a ConcurrentModificationException.

The test was: org.eclipse.swt.widgets.DisplaySerialization_Test.testTimerExecIsSerializable()

Here is the stack trace:

java.util.ConcurrentModificationException
	at java.util.LinkedList$ListItr.checkForComodification(LinkedList.java:761)
	at java.util.LinkedList$ListItr.next(LinkedList.java:696)
	at org.eclipse.swt.widgets.TimerExecScheduler.rescheduleTasks(TimerExecScheduler.java:81)
	at org.eclipse.swt.widgets.TimerExecScheduler.access$2(TimerExecScheduler.java:78)
	at org.eclipse.swt.widgets.TimerExecScheduler$PostDeserializationValidation$1.run(TimerExecScheduler.java:133)
	at org.eclipse.rwt.internal.engine.PostDeserialization.runProcessors(PostDeserialization.java:27)
	at org.eclipse.rwt.internal.engine.RWTClusterSupport.beforeService(RWTClusterSupport.java:56)
	at org.eclipse.rwt.internal.engine.RWTClusterSupport.beforeService(RWTClusterSupport.java:47)
	at org.eclipse.rwt.internal.engine.RWTClusterSupport.doFilter(RWTClusterSupport.java:31)
	at org.eclipse.swt.widgets.DisplaySerialization_Test.runClusterSupportFilter(DisplaySerialization_Test.java:257)
	at org.eclipse.swt.widgets.DisplaySerialization_Test.testTimerExecIsSerializable(DisplaySerialization_Test.java:221)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at junit.framework.TestCase.runTest(TestCase.java:164)
	at junit.framework.TestCase.runBare(TestCase.java:130)
	at junit.framework.TestResult$1.protect(TestResult.java:106)
	at junit.framework.TestResult.runProtected(TestResult.java:124)
	at junit.framework.TestResult.run(TestResult.java:109)
	at junit.framework.TestCase.run(TestCase.java:120)
	at junit.framework.TestSuite.runTest(TestSuite.java:230)
	at junit.framework.TestSuite.run(TestSuite.java:225)
	at junit.framework.TestSuite.runTest(TestSuite.java:230)
	at junit.framework.TestSuite.run(TestSuite.java:225)
	at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Comment 1 Rüdiger Herrmann CLA 2011-07-13 14:17:36 EDT
Access to the 'tasks' field from TimerExecScheduler#rescheduleTasks() was unsynchronized. This could lead to newly added tasks that are already being executed interfere with iterating over the list of tasks.
Guarded rescheduleTasks() with sync lock. Changes are in CVS HEAD.