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

core dumped after ZipInputStream.read(null, 0, 0) call

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.2.0
    • 1.1.8
    • core-libs
    • None
    • 1.2
    • sparc
    • solaris_2.5
    • Verified



      Name: bkC97677 Date: 11/02/99



      In some cases core dumped after
      ZipInputStream.read(byte b[], int off, int len) call.
      This bug has been fixed in jdk1.2fcs and may be closed
      as such immediately.

      Here is a sample demonstrating this bug:
      ------------------ Test11.java ---------------------
      import java.util.zip.*;
      import java.io.*;

      public class Test11 {
          public static void main(String[] args) {
              try {
                  ByteArrayOutputStream out = new ByteArrayOutputStream();
                  ZipOutputStream jo = new ZipOutputStream(out);
                  jo.putNextEntry(new ZipEntry("entry1"));
                  jo.closeEntry();
                  jo.close();
                
                  ZipInputStream in = new
        ZipInputStream(new ByteArrayInputStream(out.toByteArray()));

                  in.getNextEntry();
                  int i = in.read(null, 0, 0);

                  System.out.println("road bytes: " + i);
              } catch(IOException e) {
                  System.out.println("IOException");
      } catch(NullPointerException e) {
      System.out.println("NullPointerException");
      } catch(Throwable e) {
                  System.out.println( "Unexpected "+e+" thrown" );
      }
          }
      }
      ------------------------------------------------------
      Here is output under jdk1.1.8:
      ------------------------------------------------------
      1.8,~/tmp;
      java -fullversion
      java full version "JDK1.1.8M"
      1.8,~/tmp;
      java Test11
      SIGSEGV 11* segmentation violation
          si_signo [11]: SIGSEGV 11* segmentation violation
          si_errno [0]: Error 0
          si_code [1]: SEGV_MAPERR [addr: 0x0]

              stackbase=EFFFF430, stackpointer=EFFFF168

      Full thread dump:
          "Finalizer thread" (TID:0xee300210, sys_thread_t:0xef371db8, state:R) prio=1
          "Async Garbage Collector" (TID:0xee300258, sys_thread_t:0xef471db8, state:R) prio=1
          "Idle thread" (TID:0xee3002a0, sys_thread_t:0xef541db8, state:R) prio=0
          "Clock" (TID:0xee300088, sys_thread_t:0xef571db8, state:CW) prio=12
          "main" (TID:0xee3000b0, sys_thread_t:0x4d588, state:R) prio=5 *current thread*
              java.util.zip.ZipInputStream.read(ZipInputStream.java:109)
              Test11.main(Test11.java:16)
      Monitor Cache Dump:
      Registered Monitor Dump:
          Thread queue lock: <unowned>
          Name and type hash table lock: <unowned>
          String intern lock: <unowned>
          JNI pinning lock: <unowned>
          JNI global reference lock: <unowned>
          BinClass lock: <unowned>
          Class loading lock: <unowned>
          Java stack lock: <unowned>
          Code rewrite lock: <unowned>
          Heap lock: <unowned>
          Has finalization queue lock: <unowned>
          Finalize me queue lock: <unowned>
          Dynamic loading lock: <unowned>
          Monitor IO lock: <unowned>
          Child death monitor: <unowned>
          Event monitor: <unowned>
          I/O monitor: <unowned>
          Alarm monitor: <unowned>
              Waiting to be notified:
                  "Clock" (0xef571db8)
          Sbrk lock: <unowned>
          Monitor registry: owner "main" (0x4d588, 1 entry)
      Thread Alarm Q:
      Abort (core dumped)
      1.8,~/tmp;
      -----------------------------------------------------------
      And here is output under JDK1.2fcs:
      -----------------------------------------------------------
      2fcs,~/tmp;
      java -fullversion
      java full version "JDK-1.2-V"
      2fcs,~/tmp;
      java Test11
      NullPointerException
      2fcs,~/tmp;
      ------------------------------------------------------------
      ======================================================================

            zlisunw Zhenghua Li (Inactive)
            bkvartsk Boris Kvartskhava
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: