harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mikhail Markov (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-4753) [drlvm][kernel] Cyclic dependency when specify user-defined security manager through the property
Date Thu, 06 Sep 2007 12:16:31 GMT
[drlvm][kernel] Cyclic dependency when specify user-defined security manager through the property
-------------------------------------------------------------------------------------------------

                 Key: HARMONY-4753
                 URL: https://issues.apache.org/jira/browse/HARMONY-4753
             Project: Harmony
          Issue Type: Bug
          Components: DRLVM
         Environment: Win XP
            Reporter: Mikhail Markov


The simple call: "drlvm -cp foo -Djava.security.manager=Foo Foo" produces the following stack
trace:

java.lang.IllegalStateException: Recursive invocation while initializing system class loader
        at java.lang.ClassLoader.initSystemClassLoader(ClassLoader.java:672)
        at java.lang.ClassLoader.getSystemClassLoader(ClassLoader.java:161)
        at org.apache.harmony.archive.internal.nls.Messages$1.run(Messages.java:227)
        at java.security.AccessController.doPrivilegedImpl(AccessController.java:171)
        at java.security.AccessController.doPrivileged(AccessController.java:53)
        at org.apache.harmony.archive.internal.nls.Messages.setLocale(Messages.java:223)
        at org.apache.harmony.archive.internal.nls.Messages.<clinit>(Messages.java:239)
        at java.util.zip.ZipFile.openZip(ZipFile.java:120)
        at java.util.zip.ZipFile.<init>(ZipFile.java:93)
        at java.util.jar.JarFile.<init>(JarFile.java:172)
        at org.apache.harmony.luni.internal.net.www.protocol.jar.JarURLConnection.openJarFile(JarURLConnection.java:145)
        at org.apache.harmony.luni.internal.net.www.protocol.jar.JarURLConnection.findJarFile(JarURLConnection.java:121)
        at org.apache.harmony.luni.internal.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:87)
        at org.apache.harmony.luni.internal.net.www.protocol.jar.JarURLConnection.getJarFile(JarURLConnection.java:104)
        at java.net.URLClassLoader.createURLJarHandler(URLClassLoader.java:1040)
        at java.net.URLClassLoader.makeNewHandler(URLClassLoader.java:997)
        at java.net.URLClassLoader.getHandler(URLClassLoader.java:980)
        at java.net.URLClassLoader.findClassImpl(URLClassLoader.java:1189)
        at java.net.URLClassLoader$4.run(URLClassLoader.java:888)
        at java.net.URLClassLoader$4.run(URLClassLoader.java:1)
        at java.security.AccessController.doPrivilegedImpl(AccessController.java:171)
        at java.security.AccessController.doPrivileged(AccessController.java:64)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:890)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:575)
        at java.lang.ClassLoader$SystemClassLoader.loadClass(ClassLoader.java:963)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:319)
        at java.lang.ClassLoader.initSystemClassLoader(ClassLoader.java:684)
        at java.lang.ClassLoader.getSystemClassLoader(ClassLoader.java:161)

If modify the line to call a normal code like: "drlvm -cp foo:. -Djava.security.manager=ValidUserSecurityManager
HelloWorld" then this stack trace is still printed although after that HelloWorld prints it's
message as if working ok.

I've looked at ClassLoader implementation in DRLVM and found the following issue:
ClassLoader.getSystemClassLoader() calls private method initSystemClassLoader() and only after
that sets the flag 'initialized' to true.
But initSystemClassLoader() tries to initialize SecurityManager (loads and instantiates the
class specified in -Djava.security.manager property) - this leads to call to getSystemClassLoader()
again, but as 'iinitialized' flag is still false, initSystemClassLoader() is called again
and it throws the exception in the beginning of the method.

I did not found an easy solution so far as we could not set 'initialized' flag to true before
we set SecurityManager & user-defined system class loader to not break the java build-in
security.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message