Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 368331 - CDOStateMachine.detach() is not robust against sideeffects of process() call
Summary: CDOStateMachine.detach() is not robust against sideeffects of process() call
Status: CLOSED WORKSFORME
Alias: None
Product: EMF
Classification: Modeling
Component: cdo.core (show other bugs)
Version: 4.2   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Eike Stepper CLA
QA Contact: Eike Stepper CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-11 06:21 EST by Ronald Krijgsheld CLA
Modified: 2013-06-27 04:00 EDT (History)
1 user (show)

See Also:


Attachments
testcase (2.09 KB, application/octet-stream)
2012-01-11 08:29 EST, Ronald Krijgsheld CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ronald Krijgsheld CLA 2012-01-11 06:21:06 EST
Build Identifier: 

The detach() method determines a set of objects to detach. then calls process() to update the statemachine, however this method calls objectStateChanged to its listeners. That in turn leads to objects that can be detached. 

The effect is that the processing after the process() call can never assume the the objectsToDetach collection are not already detached by a listener.    

Reproducible: Sometimes
Comment 1 Ronald Krijgsheld CLA 2012-01-11 08:29:55 EST
Created attachment 209308 [details]
testcase
Comment 2 Ronald Krijgsheld CLA 2012-01-11 08:34:45 EST
the resulting stacktrace:

java.lang.NullPointerException
	at java.util.concurrent.ConcurrentHashMap.remove(Unknown Source)
	at org.eclipse.emf.internal.cdo.transaction.CDOSavepointImpl$1.put(CDOSavepointImpl.java:74)
	at org.eclipse.emf.internal.cdo.transaction.CDOSavepointImpl$1.put(CDOSavepointImpl.java:1)
	at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.detachObject(CDOTransactionImpl.java:1365)
	at org.eclipse.emf.internal.cdo.view.CDOStateMachine.detach(CDOStateMachine.java:286)
	at org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl.detached(CDOResourceImpl.java:1322)
	at org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl$ContentsCDOList.inverseRemove(CDOResourceImpl.java:1575)
	at org.eclipse.emf.common.notify.impl.DelegatingNotifyingListImpl.remove(DelegatingNotifyingListImpl.java:731)
	at org.eclipse.emf.common.util.DelegatingEList.remove(DelegatingEList.java:506)
	at org.eclipse.emf.cdo.tests.Test368331.testDetach(Test368331.java:52)
Comment 3 Eike Stepper CLA 2012-08-14 22:50:54 EDT
Moving all open issues to 4.2. Open bugs can be ported to 4.1 maintenance after they've been fixed in master.
Comment 4 Eike Stepper CLA 2012-11-01 02:40:38 EDT
The test case passes and is committed. Maybe the problem has been fixed via a different bugzilla.

commit 3c5eb544ff2e8db8e94fe2cf97033a2affe403b4
Comment 5 Eike Stepper CLA 2013-06-27 04:00:57 EDT
Closing