Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6832540

IllegalArgumentException in ClassLoader.definePackage when classes are loaded in parallel

XMLWordPrintable

    • b66
    • generic
    • generic

      Starting from jdk7b55, a number of VM tests from ParallelClassLoading suite start to fail intermittenlty with the following error:
      java.lang.IllegalArgumentException exception is caught in "Loading Thread #10": custom
      java.lang.IllegalArgumentException: custom
              at java.lang.ClassLoader.definePackage(ClassLoader.java:1591)
              at java.net.URLClassLoader.defineClass(URLClassLoader.java:343)
              at java.net.URLClassLoader.access$100(URLClassLoader.java:75)
              at java.net.URLClassLoader$1.run(URLClassLoader.java:294)
              at java.net.URLClassLoader$1.run(URLClassLoader.java:288)
              at java.security.AccessController.doPrivileged(Native Method)
              at java.net.URLClassLoader.findClass(URLClassLoader.java:287)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:391)
              at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:307)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:331)
              at java.lang.Class.forName0(Native Method)
              at java.lang.Class.forName(Class.java:264)
              at runtime.ParallelClassLoading.shared.ProvokeType.provoke(ProvokeType.java:83)
              at runtime.ParallelClassLoading.shared.CustomProvokeType.provoke(CustomProvokeType.java:20)
              at runtime.ParallelClassLoading.shared.ClassLoadingThread.run(ClassLoadingThread.java:81)

      Test scenario is:
      1) create custom class loader
      2) initiate loading of some class hierarchy from multiple threads
      3) go to step #1 if the time & iteration limit isn't reached

      The failure always occurs during first loading iteration. Seems like the problem relates to initialization stage.

      According to ClassLoader.definePackage contract, it throws IllegalArgumentException if "package name duplicates an existing package either in this class loader or one of its ancestors". Test code doesn't explicitly call defineClass.

      How to reproduce:
      1) login to vm-t2000-01a.sfbay
      2) cd /net/sqenfs-2.sfbay/export2/results/vm/gtee/HSX/PIT/VM/16/b01/jdk7b56/product/vm/solaris-sparc/client/mixed/solaris-sparc_client_mixed_vm.parallel_class_loading.testlist/ResultDir/anonymous-complex
      3) bash rerun.sh

      Test sources can be found at: /net/vmsqe.russia/export/testbase/sqe/vm/7/ws_int_spb/vm/src/runtime/ParallelClassLoading/shared

            valeriep Valerie Peng
            vlivanov Vladimir Ivanov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: