Uploaded image for project: 'Code Tools'
  1. Code Tools
  2. CODETOOLS-6906953

Signature file writer is not thread safe

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • st2.2
    • st2.1
    • tools
    • b06
    • b07
    • generic
    • generic
    • Verified

      The com.sun.tdk.signaturetest.sigfile.F40Writer is not thread safe and may throw an exception when generating sigfiles in one JVM in parallel. Here is an exception I got during the JCK build that generates sigfiles for the compiler tests in multiply threads:

      Compiler test source ...
      Class path: "/home/ag153348/ws/jck7/common/out/precompile/compiler/tmp/workdir/lang/ANNOT/annot101/annot10101m01101/classes:/home/ag153348/ws/jck7/common/out/shared/suite/JCK-compiler-7/classes:/net/jse-st01.russia/export4/java/re/jdk/7/promoted/ea/b76/binaries/solaris-x64/jre/lib/rt.jar"
      java.lang.IndexOutOfBoundsException: Index: 2, Size: 1
      at java.util.ArrayList.rangeCheck(ArrayList.java:570)
      at java.util.ArrayList.get(ArrayList.java:348)
      at com.sun.tdk.signaturetest.sigfile.F40Writer.write(F40Writer.java:114)
      at com.sun.tdk.signaturetest.Setup.create(Setup.java:483)
      at com.sun.tdk.signaturetest.Setup.run(Setup.java:163)
      at javasoft.sqe.jckutils.lib.GenLangSigFileCommand.generate(GenLangSigFileCommand.java:110)
      at javasoft.sqe.jckutils.lib.GenLangBaseCommand.run(GenLangBaseCommand.java:89)
      at com.sun.javatest.Script.invokeClass(Script.java:1063)
      at com.sun.javatest.Script.invokeCommand(Script.java:974)
      at com.sun.jck.lib.IntermediateScript.invokeCommand(IntermediateScript.java:107)
      at com.sun.javatest.Script.compileTogether(Script.java:577)
      at com.sun.javatest.Script.compileTogether(Script.java:619)
      at com.sun.jck.lib.JCKScript.precompileTest(JCKScript.java:1126)
      at com.sun.jck.lib.JCKScript.run(JCKScript.java:95)
      at com.sun.javatest.Script.run(Script.java:228)
      at com.sun.jck.lib.IntermediateScript.run(IntermediateScript.java:219)
      at com.sun.javatest.DefaultTestRunner.runTest(DefaultTestRunner.java:174)
      at com.sun.javatest.DefaultTestRunner.access$100(DefaultTestRunner.java:43)
      at com.sun.javatest.DefaultTestRunner$1.run(DefaultTestRunner.java:66)


      The problem appears to be that one static instance of F40Writer changes its state each time when it writes signature data. If it happens in multiply threads in parallel the exception above may be thrown.

            ersh Mikhail Ershov (Inactive)
            agavrilosunw Alexey Gavrilov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: