| Summary: | Dynamic import resolver bug | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Equinox | Reporter: | Glyn Normington <glyn.normington> | ||||||||
| Component: | Framework | Assignee: | Thomas Watson <tjwatson> | ||||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||||
| Severity: | major | ||||||||||
| Priority: | P3 | CC: | anbharga, jeffmcaffer | ||||||||
| Version: | 3.5.1 | ||||||||||
| Target Milestone: | 3.7 M2 | ||||||||||
| Hardware: | PC | ||||||||||
| OS: | Mac OS X - Carbon (unsup.) | ||||||||||
| Whiteboard: | |||||||||||
| Bug Depends on: | |||||||||||
| Bug Blocks: | 325883, 325885 | ||||||||||
| Attachments: |
|
||||||||||
|
Description
Glyn Normington
Created attachment 178341 [details]
testcase
In trying to create a testcase for this I have uncovered a deeper more troubling dynamic import package bug. The class space consistency checking does not take into account previously resolved dynamic imports when dynamically importing a new package. Here is a testcase that shows the issue.
Created attachment 178344 [details]
possible fix
Here is a possible fix. The fix has two parts
1) In ResolverImpl.resolveDynamicImport(BundleDescription, String) we must call ResolverConstraint.clearPossibleSuppliers(). That is necessary and the analysis by your customer is correct. Thanks!
2) But I found a more troubling bug that allowed for inconsistent class spaces to get introduced by the use of DynamicImport-Package. The testcase attached tests this as well as the first issue. To fix this we need to handle how we calculate the package roots for packages imported from already resolved bundles. In the previous code we only checked the list of imports, but this is not correct because dynamic import * can add an endless number of exports to the package space. We really need to call BundleDescription.getResolvedImports() to accurately get the package roots for already resolved bundles.
Great progress Tom. How likely do you think it is that our customer's problem is also hitting the more complex aspect that you have uncovered? And what's the timescale for 3.7 M2. They would have seen issue related to class space consistency issues. Things like cast exceptions or inability to access services because they are wired to the wrong package. Created attachment 178361 [details]
Patch against 3.5.1
This is Tom's possible fix back ported to 3.5.1. I can confirm that the testcase now passes.
Patch released to head. (In reply to comment #6) > Patch released to head. How do we get the jar file for 3.5.1 with this fix ? Thanks for providing this fix so promptly. I have sent the fix to the customer and am awaiting their feedback. I will close this bug when they confirm their problem is fixed. Looks like the changes fix the issue that was originally happening. We should look to apply it in the 3.5 and 3.6 maintenance streams. |