| Summary: | IProject#getDescription is not thread safe with #setDescription | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | James Blackburn <jamesblackburn+eclipse> | ||||
| Component: | Resources | Assignee: | James Blackburn <jamesblackburn+eclipse> | ||||
| Status: | CLOSED WONTFIX | QA Contact: | |||||
| Severity: | major | ||||||
| Priority: | P3 | CC: | arthorne.eclipse, Szymon.Brandys | ||||
| Version: | 3.7 | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | All | ||||||
| Whiteboard: | stalebug | ||||||
| Bug Depends on: | 329142 | ||||||
| Bug Blocks: | |||||||
| Attachments: |
|
||||||
|
Description
James Blackburn
Created attachment 182104 [details]
test 1
Test for the issue.
You'll need to apply the patch on bug 329142 before this test starts failing for the right reasons... (In reply to comment #0) > I noticed that Project getDescription & setDescription are not thread-safe. > While the element tree is synchronized, the project description for subsequent > tree generations is modified (and read) outside of the element tree lock. > Moreover the same instance that's modified during #set is visible to the #get > path. I see the bug - ProjectInfo#getDescription should return a clone, and have a separate method for returning the actual object for read-only purposes (like ResourceInfo#getMarkers). I don't see where the description is modified outside of the tree lock though... Project#setDescription does hold the workspace lock while making its changes. (In reply to comment #3) > I see the bug - ProjectInfo#getDescription should return a clone, and have a > separate method for returning the actual object for read-only purposes (like > ResourceInfo#getMarkers). > > I don't see where the description is modified outside of the tree lock > though... Project#setDescription does hold the workspace lock while making its > changes. There is a clone() happening (Project#getDescription()). I think that's OK. The problem is that the thing being clone()d is being modified concurrently... I think the problem is that the resource info returned by #getResourceInfo(false, true /*mutable*/) creates the mutable element data which is immediately accessible to the read path. AFAICS there isn't any barrier. This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie. |