Bug 3006 - [tests] ElementTree.immutable() (1GCCLPE)
Summary: [tests] ElementTree.immutable() (1GCCLPE)
Status: RESOLVED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Resources (show other bugs)
Version: 2.0   Edit
Hardware: All Windows NT
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-Resources-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: test
Depends on:
Blocks:
 
Reported: 2001-10-10 22:47 EDT by Rodrigo Peretti CLA
Modified: 2003-03-13 16:31 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 Rodrigo Peretti CLA 2001-10-10 22:47:43 EDT
The method ElementTree.immutable() seems to have possible concurrency problems
(reader and writers). Further investigation is needed.

NOTES:

RTP (4/17/01 6:23:32 PM)
	DeltaDataTree.lookup
		This is the method related to the problem of having readers while calling
ElementTree.immutable(). If this method is ok, we are safe.
Comment 1 John Arthorne CLA 2001-10-15 15:27:41 EDT
This is a tricky situation.  The vulnerability is in the following two lines 
(from DeltaDataTree#reroot(DeltaDataTree)):

parent.setRootNode(backwardDelta.getRootNode());
parent.setParent(sourceTree);

Between the method calls to setRootNode and setParent, the tree
pointed to by "parent" will be inconsistent.  Any form of read
on the tree during that critical period will probably fail.  Note
that writes are not possible anyway because the tree must be immutable at this 
point already.  The failure mode could be bad, as it could hit an assertion (for 
example in DeltaDataTree#getChildNodes) that results in a runtime exception.  At 
least such a failure would only affect the read that happened during the 
critical region, and wouldn't leave the tree in a bad state.

This is expensive to fix.  Making it safe would require an extra sync block for 
every tree read, where currently no sync block is needed.  This would slow down 
all tree reads.

So the final question is: do we make it safe, thus impacting performance for all 
tree operations, or risk the rare failure and leave it as-is?  Since there has 
never been a report of failure here, and it would only cause read-only 
operations to fail (which by definition can't do much damage), I would suggest 
leaving it.
Comment 2 DJ Houghton CLA 2001-10-24 06:40:50 EDT
PRODUCT VERSION:
	Eclipse SDK 0.044

Comment 3 John Arthorne CLA 2002-02-04 16:53:40 EST
Not critical, defer.
Comment 4 DJ Houghton CLA 2002-09-10 12:02:05 EDT
Reopening for investigation.
Comment 5 John Arthorne CLA 2003-03-13 16:31:23 EST
Closing.  Although there is a theoretical vulnerability, we have never seen a 
problem in practice in the two years since this bug was opened.