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

URL.openStream() throws NULL ptr exception with FTP protocol and .zip file

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 1.3.0
    • 1.3.0
    • core-libs
    • beta
    • generic
    • solaris_9

      daniel.daugherty@Eng 1999-06-25

      I encountered this problem during my Kestrel Build I Quick Look.
      The OS on which the test was running is Solaris 2.6. I have
      reproduced the bug with the following java command configs:

          - green threads, JIT enabled
          - green threads, no JIT
          - native threads, JIT enabled
          - native threads, no JIT

      I retested using Kestrel Build H and the failure does not occur.

      From tests/url/GetURL.java:

                  } else {
                      logdebug("parsing URL: " + theurl);
                      URL url = new URL(theurl);
                      connected = false;
                      for(int i=0; i<3; i++) {
                          try {
                              logdebug("opening stream to URL: " + theurl);
                              in = url.openStream(); <=== NULL pointer execption
                              connected = true;
                              break;

      Here is the no-JIT portion of the reproduction log:

      java version "1.3"
      Classic VM (build JDK-1.3-I, green threads, nojit)
      + java -Djava.compiler= -DproxyHost=webcache.east.sun.com -DproxyPort=8080 -Dftp.proxyHost=webcache.east.sun.com -Dftp.proxyPort=8080 GetURL -v -d -u ftp://ftp.javasoft.com/docs/jdk1.0.2/JDK-1_0_2-apidocs.zip -o do_repro.out
      DEBUG: parsing URL: ftp://ftp.javasoft.com/docs/jdk1.0.2/JDK-1_0_2-apidocs.zip
      DEBUG: opening stream to URL: ftp://ftp.javasoft.com/docs/jdk1.0.2/JDK-1_0_2-apidocs.zip
      ERROR: GetURL.main(): exception occurred:
      java.lang.NullPointerException
      java.lang.NullPointerException
      at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:522)
      at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:475)
      at java.net.URL.openStream(URL.java:808)
      at GetURL.main(GetURL.java:103)
      FINALSTATUS:GetURL:EXIT_ERROR:2:Number of ERRORS:1:TEST INCOMPLETE
      + set +x

      daniel.daugherty@Eng 1999-07-15

      I just retested Kestrel Build I and the failure still occurs with a
      different stack trace:

      java version "1.3"
      Classic VM (build JDK-1.3-L, green threads, nojit)
      + java -DproxyHost=webcache.east.sun.com -DproxyPort=8080 -Dftp.proxyHost=webcache.east.sun.com -Dftp.proxyPort=8080 GetURL -v -d -u ftp://ftp.javasoft.com/docs/jdk1.0.2/JDK-1_0_2-apidocs.zip -o do_repro.out
      Warning: JIT compiler "sunwjit" not found. Will use interpreter.
      DEBUG: parsing URL: ftp://ftp.javasoft.com/docs/jdk1.0.2/JDK-1_0_2-apidocs.zip
      DEBUG: opening stream to URL: ftp://ftp.javasoft.com/docs/jdk1.0.2/JDK-1_0_2-apidocs.zip
      ERROR: GetURL.main(): exception occurred:
      java.lang.ClassCastException: java.io.BufferedInputStream
      java.lang.ClassCastException: java.io.BufferedInputStream
      at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:538)
      at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:475)
      at java.net.URL.openStream(URL.java:805)
      at GetURL.main(GetURL.java:103)
      FINALSTATUS:GetURL:EXIT_ERROR:2:Number of ERRORS:1:TEST INCOMPLETE

      I reproduced the failure using both the java.net test suite *and* the
      attached archive 4249722_repro.tar.Z. Was the archive used to test
      the proposed fix? It certainly reproduces the bug with Build L so I'm
      curious if the bug is not always reproducible.

            ywangsunw Yingxian Wang (Inactive)
            dcubed Daniel Daugherty
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: