Bug#432541: eclipse-cdt FTBFS with gcj-4.2

Andrew Haley aph at redhat.com
Wed Mar 5 12:36:22 UTC 2008


Andrew Haley wrote:
> Andrew Haley wrote:

>> OK, I've found it.  The ClassNotFoundException is thrown from a security
>> check
>> in libgcj.  We are calling Method m1 from method m0, and m1's class loader
>> is different from m0's class loader.  We have to check that for every arg
>> in m1, the actual type is the same in both m1.loader and m0.loader.
>>
>> The method in question is
>> org.eclipse.core.runtime.Platform.getPlugin(String), which returns an
>> instance of org.eclipse.core.runtime.Plugin.  It gets this
>> by calling org.eclipse.core.internal.plugins.PluginDescriptor.getPlugin().
>>
>> When we do the security check, we call Platform's class loader to ask it
>> to loadClass("org.eclipse.core.runtime.Plugin") and it throws a
>> ClassNotFoundException.
> 
> OK, I've discovered some more.  The class loader that's throwing the
> exception is a
> org.eclipse.osgi.framework.internal.core.BundleLoader, and
> it's being asked to find org.eclipse.core.runtime.Plugin.  Now, this
> is where it gets really interesting.
> 
> org.eclipse.core.runtime.Plugin is defined in
> eclipse/plugins/org.eclipse.core.runtime_3.3.100.v20070530.jar,
> along with a few other classes, including
> org.eclipse.core.runtime.IPluginDescriptor and
> org.eclipse.core.runtime.Platform.
> 
> *but*
> 
> IPluginDescriptor's class loader is not able to find
> org.eclipse.core.runtime.Plugin.

OK, and the *reason* for this is that IPluginDescriptor is loaded not
from eclipse/plugins/org.eclipse.core.runtime_3.3.100.v20070530.jar
but from eclipse/plugins/org.eclipse.core.runtime.compatibility.registry_3.2.100.v20070316/runtime_registry_compatibility.jar

So, if you ask IPluginDescriptor's class loader to find Plugin it
throws a ClassNotFoundException.

The only files in runtime_registry_compatibility.jar are:

org/eclipse/core/internal/registry/BundleHelper.class
org/eclipse/core/internal/registry/ExtensionHandle.class
org/eclipse/core/internal/registry/ExtensionPointHandle.class
org/eclipse/core/internal/registry/RegistryCompatibilityHelper.class
org/eclipse/core/runtime/IExtension.class
org/eclipse/core/runtime/IExtensionPoint.class
org/eclipse/core/runtime/IPluginDescriptor.class

So, I think I now have enough to write a test case.  Two class
loaders, one of which loads a subset of the other's classes.  Call
an interface in the class defined by the subset class loader and
see what happens.

Andrew.





More information about the pkg-java-maintainers mailing list