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

1.4.2_02 deadlocks when loading a signed jar file

    Details

    • Subcomponent:
    • Resolved In Build:
      b31
    • CPU:
      generic
    • OS:
      windows_2000

      Description

      I have a simple testcase that loads in a class. If the class is located in a
      signed jar a deadlock occurs, but if the jar is not signed then the app works
      fine. This works in 1.3.1_09 but fails with 1.4.1 and 1.4.2

      The testcase and signed jar are located in the attachments.

       Steps to Reproduce:
       1. Compile Test.java provided in attachment.
       2. Use the signed jar file com.jar or create an arbitrary signed jar which
          contains an arbitrary class. In our case the class is called "com.abc.Tst1".
       3. Run the following command:
       java -cp <path to Test.class>;<path of com.jar> Test com.abc.Tst1

       Expected Result:
       Following message displayed on console:
       No deadlock. We found class: "com.abc.Tst1"

      greatpoint> java -showversion -cp .:/home/atongsch/Support/SilverStream/DeadLockRandom/com.jar Test com.abc.Tst1
      java version "1.4.2_02"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_02-b03)
      Java HotSpot(TM) Client VM (build 1.4.2_02-b03, mixed mode)

      argv[0] is com.abc.Tst1
      cl is sun.misc.Launcher$AppClassLoader@53c015
      Full thread dump Java HotSpot(TM) Client VM (1.4.2_02-b03 mixed mode):

      "Thread-0" prio=5 tid=0x000e3538 nid=0xb waiting for monitor entry [f9680000..f96819f0]
              at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:260)
              - waiting to lock <0xf1416530> (a sun.misc.Launcher$AppClassLoader)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
              at java.security.Provider.loadProvider(Provider.java:149)
              at java.security.Security$3.run(Security.java:350)
              at java.security.AccessController.doPrivileged(Native Method)
              at java.security.Security.loadOneMoreProvider(Security.java:347)
              - locked <0xf54f7e08> (a java.lang.Class)
              at java.security.Security.getEngineClassName(Security.java:558)
              - locked <0xf54f7e08> (a java.lang.Class)
              at java.security.Security.getEngineClassName(Security.java:595)
              at java.security.Security.getImpl(Security.java:1044)
              at java.security.SecureRandom.getInstance(SecureRandom.java:224)
              at Test.run(Test.java:8)
              at java.lang.Thread.run(Thread.java:534)

      "Signal Dispatcher" daemon prio=10 tid=0x000c4130 nid=0x8 waiting on condition [0..0]

      "Finalizer" daemon prio=8 tid=0x000bf858 nid=0x6 in Object.wait() [fc381000..fc3819f0]
              at java.lang.Object.wait(Native Method)
              - waiting on <0xf1400490> (a java.lang.ref.ReferenceQueue$Lock)
              at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:111)
              - locked <0xf1400490> (a java.lang.ref.ReferenceQueue$Lock)
              at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:127)
              at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)

      "Reference Handler" daemon prio=10 tid=0x000bedd0 nid=0x5 in Object.wait() [fde81000..fde819f0]
              at java.lang.Object.wait(Native Method)
              - waiting on <0xf1400380> (a java.lang.ref.Reference$Lock)
              at java.lang.Object.wait(Object.java:429)
              at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:115)
              - locked <0xf1400380> (a java.lang.ref.Reference$Lock)

      "main" prio=5 tid=0x0002e6d8 nid=0x1 waiting for monitor entry [ffbec000..ffbee5ec]
              at java.security.Security.getEngineClassName(Security.java:529)
              - waiting to lock <0xf54f7e08> (a java.lang.Class)
              at java.security.Security.getEngineClassName(Security.java:595)
              at java.security.Security.getImpl(Security.java:1044)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:324)
              at java.security.cert.CertificateFactory.getInstance(CertificateFactory.java:177)
              at sun.security.pkcs.PKCS7.parseSignedData(PKCS7.java:244)
              at sun.security.pkcs.PKCS7.parse(PKCS7.java:141)
              at sun.security.pkcs.PKCS7.parse(PKCS7.java:110)
              at sun.security.pkcs.PKCS7.<init>(PKCS7.java:92)
              at sun.security.util.SignatureFileVerifier.<init>(SignatureFileVerifier.java:64)
              at java.util.jar.JarVerifier.processEntry(JarVerifier.java:261)
              at java.util.jar.JarVerifier.update(JarVerifier.java:194)
              at java.util.jar.JarFile.initializeVerifier(JarFile.java:300)
              at java.util.jar.JarFile.getInputStream(JarFile.java:362)
              - locked <0xf141eb68> (a java.util.jar.JarFile)
              at sun.misc.URLClassPath$5.getInputStream(URLClassPath.java:616)
              at sun.misc.Resource.getBytes(Resource.java:57)
              at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
              at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
              at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
              at java.security.AccessController.doPrivileged(Native Method)
              at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
              - locked <0xf1416530> (a sun.misc.Launcher$AppClassLoader)
              at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
              - locked <0xf1416530> (a sun.misc.Launcher$AppClassLoader)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
              at Test.operate(Test.java:28)
              at Test.main(Test.java:20)

      "VM Thread" prio=5 tid=0x000bd930 nid=0x4 runnable

      "VM Periodic Task Thread" prio=10 tid=0x000c6788 nid=0xa waiting on condition
      "Suspend Checker Thread" prio=10 tid=0x000c37c8 nid=0x7 runnable

      Found one Java-level deadlock:
      =============================
      "Thread-0":
        waiting to lock monitor 0x000c1780 (object 0xf1416530, a sun.misc.Launcher$AppClassLoader),
        which is held by "main"
      "main":
        waiting to lock monitor 0x000c17f0 (object 0xf54f7e08, a java.lang.Class),
        which is held by "Thread-0"

      Java stack information for the threads listed above:
      ===================================================
      "Thread-0":
              at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:260)
              - waiting to lock <0xf1416530> (a sun.misc.Launcher$AppClassLoader)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
              at java.security.Provider.loadProvider(Provider.java:149)
              at java.security.Security$3.run(Security.java:350)
              at java.security.AccessController.doPrivileged(Native Method)
              at java.security.Security.loadOneMoreProvider(Security.java:347)
              - locked <0xf54f7e08> (a java.lang.Class)
              at java.security.Security.getEngineClassName(Security.java:558)
              - locked <0xf54f7e08> (a java.lang.Class)
              at java.security.Security.getEngineClassName(Security.java:595)
              at java.security.Security.getImpl(Security.java:1044)
              at java.security.SecureRandom.getInstance(SecureRandom.java:224)
              at Test.run(Test.java:8)
              at java.lang.Thread.run(Thread.java:534)
      "main":
              at java.security.Security.getEngineClassName(Security.java:529)
              - waiting to lock <0xf54f7e08> (a java.lang.Class)
              at java.security.Security.getEngineClassName(Security.java:595)
              at java.security.Security.getImpl(Security.java:1044)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:324)
              at java.security.cert.CertificateFactory.getInstance(CertificateFactory.java:177)
              at sun.security.pkcs.PKCS7.parseSignedData(PKCS7.java:244)
              at sun.security.pkcs.PKCS7.parse(PKCS7.java:141)
              at sun.security.pkcs.PKCS7.parse(PKCS7.java:110)
              at sun.security.pkcs.PKCS7.<init>(PKCS7.java:92)
              at sun.security.util.SignatureFileVerifier.<init>(SignatureFileVerifier.java:64)
              at java.util.jar.JarVerifier.processEntry(JarVerifier.java:261)
              at java.util.jar.JarVerifier.update(JarVerifier.java:194)
              at java.util.jar.JarFile.initializeVerifier(JarFile.java:300)
              at java.util.jar.JarFile.getInputStream(JarFile.java:362)
              - locked <0xf141eb68> (a java.util.jar.JarFile)
              at sun.misc.URLClassPath$5.getInputStream(URLClassPath.java:616)
              at sun.misc.Resource.getBytes(Resource.java:57)
              at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
              at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
              at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
              at java.security.AccessController.doPrivileged(Native Method)
              at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
              - locked <0xf1416530> (a sun.misc.Launcher$AppClassLoader)
              at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
              - locked <0xf1416530> (a sun.misc.Launcher$AppClassLoader)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
              at Test.operate(Test.java:28)
              at Test.main(Test.java:20)

      Found 1 deadlock.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                andreas Andreas Sterbenz
                Reporter:
                atongschsunw Albert Tong-schmidt (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: