Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 353829

Summary: BundleLoaderProxy.getBasicBundleLoader needs to be synchronized.
Product: [Eclipse Project] Equinox Reporter: John Ross <jwross>
Component: FrameworkAssignee: equinox.framework-inbox <equinox.framework-inbox>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: tjwatson
Version: 3.7   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Adds synchronization to getBasicBundleLoader method.
none
Alternate: Make loader variable volatile. none

Description John Ross CLA 2011-08-03 17:38:04 EDT
getBasicBundleLoader accesses the loader variable which is set within the synchronized getBundleLoader0 method.
Comment 1 John Ross CLA 2011-08-03 17:46:29 EDT
Created attachment 200862 [details]
Adds synchronization to getBasicBundleLoader method.
Comment 2 Thomas Watson CLA 2011-08-03 17:52:53 EDT
We need to evaluate if adding such synchronization could introduce deadlock.  If getBasicBundleLoader is called as a result of calling getBundleLoader0 then deadlock may occur if there are dependency cycles between bundles.
Comment 3 John Ross CLA 2011-08-03 19:21:05 EDT
Created attachment 200867 [details]
Alternate: Make loader variable volatile.
Comment 4 Thomas Watson CLA 2011-08-04 08:27:41 EDT
(In reply to comment #3)
> Created attachment 200867 [details]
> Alternate: Make loader variable volatile.

I prefer the first approach if we can determine that it is safe.  I had not done the analysis to determine if there is deadlock potential with the first patch.
Comment 5 John Ross CLA 2011-08-04 09:58:23 EDT
(In reply to comment #4)
> (In reply to comment #3)
> > Created attachment 200867 [details] [details]
> > Alternate: Make loader variable volatile.
> I prefer the first approach if we can determine that it is safe.  I had not
> done the analysis to determine if there is deadlock potential with the first
> patch.

I took a look for a bit yesterday and didn't see anything obvious but a second pair of eyes wouldn't hurt.
Comment 6 Thomas Watson CLA 2012-05-14 10:43:18 EDT
No plans to fix this.  A general restructuring of the code is going to happen when we prototype and implement OSGi inter-op with Java 8 Module system.