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

javac core dumps compilling a java source file

XMLWordPrintable

    • 1.0alpha2
    • sparc
    • solaris_2.4
    • Not verified

      I get a consistent Null Pointer exception by compiling the QuoteHttpServer
      file in:

      /net/benden/export/home/benden0/hotjava/quoteserver/server2/

      Go to that directory and run:

      javac QuoteHttpServer.java

      Here is the dump after the crash:

      79 flar@bendenweyr :0.0> javac QuoteHttpServer.java
      java.lang.NullPointerException
      at java.util.Hashtable.get(Hashtable.java)
      at java.tools.asm.ConstantPool.put(ConstantPool.java)
      at java.tools.asm.Instruction.collect(Instruction.java)
      at java.tools.asm.Assembler.collect(Assembler.java)
      at java.tools.javac.SourceClass.compile(SourceClass.java:423)
      at java.tools.javac.Main.main(Main.java)
      -- listing --
      39: aload 1
      39: getfield java.lang.String file
      39: ldc2 java/tools/tree/Node.java/tools/tree/Expression.java/tools/tree/ConstantExpression.java/tools/tree/StringExpression[value=java/lang/String, type=java/tools/java/Type.java/tools/java/ClassType, op=69, where=10225125]
      39: invokevirtual boolean startsWith(java.lang.String)
      39: ifeq 7190344
      40: aload 0
      40: getfield boolean expectsMime
      40: ifeq 7190416
      41: aload 0
      41: getfield java.io.PrintStream clientOutput
      42: new class java.lang.StringBuffer
      42: dup
      42: invokenonvirtual java.lang.StringBuffer()
      41: ldc2 java/tools/tree/Node.java/tools/tree/Expression.java/tools/tree/ConstantExpression.java/tools/tree/StringExpression[value=java/lang/String, type=java/tools/java/Type.java/tools/java/ClassType, op=69, where=10749510]
      41: invokevirtual java.lang.StringBuffer append(java.lang.String)
      42: aload 0
      42: invokevirtual java.lang.Class getClass()
      42: invokevirtual java.lang.String getName()
      42: invokevirtual java.lang.StringBuffer append(java.lang.String)
      42: ldc2 java/tools/tree/Node.java/tools/tree/Expression.java/tools/tree/ConstantExpression.java/tools/tree/StringExpression[value=java/lang/String, type=java/tools/java/Type.java/tools/java/ClassType, op=69, where=11011706]
      42: invokevirtual java.lang.StringBuffer append(java.lang.String)
      43: ldc2 java/tools/tree/Node.java/tools/tree/Expression.java/tools/tree/ConstantExpression.java/tools/tree/StringExpression[value=java/lang/String, type=java/tools/java/Type.java/tools/java/ClassType, op=69, where=11273868]
      43: invokevirtual java.lang.StringBuffer append(java.lang.String)
      42: invokevirtual java.lang.String toString()
      41: invokevirtual void print(java.lang.String)
      $7190416:
      45: ldc2 java/tools/tree/Node.java/tools/tree/Expression.java/tools/tree/ConstantExpression.java/tools/tree/StringExpression[value=java/lang/String, type=java/tools/java/Type.java/tools/java/ClassType, op=69, where=11798215]
      45: invokevirtual int length()
      45: istore 3
      46: sipush 1000
      46: istore 4
      47: new class java.util.Vector
      47: dup
      47: bipush 10
      47: invokenonvirtual java.util.Vector(int)
      47: astore 5
      48: goto 7194920
      $7194936:
      49: aload 1
      49: getfield java.lang.String file
      49: iload 3
      49: invokevirtual char charAt(int)
      49: bipush 47
      49: if_icmpeq 7194960
      50: aload 1
      50: getfield java.lang.String file
      50: iload 3
      50: invokevirtual char charAt(int)
      50: bipush 63
      50: if_icmpne 7194912
      51: try 7195200
      52: aload 1
      52: getfield java.lang.String file
      52: iload 3
      52: iconst_1 1
      52: iadd
      52: invokevirtual java.lang.String substring(int)
      52: invokestatic int parseInt(java.lang.String)
      52: istore 4
      $7195200:
      51: goto 7194912
      $7195240:
      53: astore 6
      54: aload 6
      54: invokevirtual void printStackTrace()
      51: goto 7194912
      $7194960:
      59: aload 1
      59: getfield java.lang.String file
      59: bipush 47
      59: iload 3
      59: iconst_1 1
      59: iadd
      59: invokevirtual int indexOf(int, int)
      59: istore 6
      60: iload 6
      60: ifge 7195544
      61: aload 1
      61: getfield java.lang.String file
      61: invokevirtual int length()
      61: istore 6
      $7195544:
      63: aload 5
      63: new class Quote
      63: dup
      63: aload 1
      63: getfield java.lang.String file
      63: iload 3
      63: iconst_1 1
      63: iadd
      63: iload 6
      63: invokevirtual java.lang.String substring(int, int)
      63: invokenonvirtual Quote(java.lang.String)
      63: invokevirtual void addElement(java.lang.Object)
      64: iload 6
      64: istore 3
      $7194920:
      48: aload 1
      48: getfield java.lang.String file
      48: invokevirtual int length()
      48: iload 3
      48: if_icmpgt 7194936
      $7194912:
      66: iconst_0 0
      66: istore 6
      66: goto 7195912
      $7195904:
      67: iconst_0 0
      67: istore 7
      67: goto 7196000
      $7195992:
      68: aload 5
      68: iload 7
      68: invokevirtual java.lang.Object elementAt(int)
      68: checkcast class Quote
      68: astore 8
      69: aload 0
      69: getfield java.io.PrintStream clientOutput
      69: new class java.lang.StringBuffer
      69: dup
      69: invokenonvirtual java.lang.StringBuffer()
      69: aload 8
      69: getfield java.lang.String symbol
      69: invokevirtual java.lang.StringBuffer append(java.lang.String)
      69: ldc2 java/tools/tree/Node.java/tools/tree/Expression.java/tools/tree/ConstantExpression.java/tools/tree/StringExpression[value=java/lang/String, type=java/tools/java/Type.java/tools/java/ClassType, op=69, where=18090357]
      69: invokevirtual java.lang.StringBuffer append(java.lang.String)
      69: aload 8
      69: invokevirtual void getQuote()
      69: invokevirtual
      69: invokevirtual java.lang.String toString()
      69: invokevirtual void println(java.lang.String)
      67: iinc 7, 1
      $7196000:
      67: iload 7
      67: aload 5
      67: invokevirtual int size()
      67: if_icmplt 7195992
      71: aload 0
      71: getfield java.io.PrintStream clientOutput
      71: invokevirtual void flush()
      72: iload 4
      72: invokestatic void sleep(int)
      66: iinc 6, 1
      $7195912:
      66: iload 6
      66: ldc2 10000
      66: if_icmplt 7195904
      39: return
      $7190344:
      75: aload 1
      75: getfield java.lang.String file
      75: ldc2 java/tools/tree/Node.java/tools/tree/Expression.java/tools/tree/ConstantExpression.java/tools/tree/StringExpression[value=java/lang/String, type=java/tools/java/Type.java/tools/java/ClassType, op=69, where=19663327]
      75: invokevirtual boolean equals(java.lang.Object)
      75: ifeq 7196496
      76: aload 0
      76: new class net.www.html.URL
      76: dup
      76: aload 1
      76: ldc2 java/tools/tree/Node.java/tools/tree/Expression.java/tools/tree/ConstantExpression.java/tools/tree/StringExpression[value=java/lang/String, type=java/tools/java/Type.java/tools/java/ClassType, op=69, where=19925522]
      76: invokenonvirtual net.www.html.URL(net.www.html.URL,java.lang.String)
      76: aload 2
      76: invokenonvirtual void getRequest(net.www.html.URL, java.lang.String)
      75: return
      $7196496:
      79: aload 0
      79: aload 1
      79: aload 2
      79: invokenonvirtual void getRequest(net.www.html.URL, java.lang.String)
      38: return
      java.lang.NullPointerException
      at java.tools.asm.ConstantPool.index(ConstantPool.java)
      at java.tools.javac.SourceClass.compile(SourceClass.java:490)
      at java.tools.javac.Main.main(Main.java)
      javac: An exception has occurred in the compiler, please file a bug report.
      Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException
      at java.tools.javac.BatchEnvironment.flushErrors(BatchEnvironment.java)
      at java.tools.javac.Main.main(Main.java)


      Here is a very small test case that causes an exception in the interpreter:

      -------test.java--------

      class test {
          native void foo();

          public test() {
      System.out.println("This should be a void: " + foo());
          }
      }

      ------------------------

            ahoffsunw Arthur Hoff (Inactive)
            flar Jim Graham
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: