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

Missing Java reference in ZipFileInputStream causes crash

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 1.4.0
    • 1.3.0
    • core-libs
    • None
    • beta
    • generic, x86
    • generic, windows_2000

      Between JDK 1.2.2 and JDK 1.3, a finalizer was added to java.util.zip.ZipFile
      which calls close(). However, the jlong pointing to the underlying C data
      structure is being passed around as an identifier rather than the Java object.
      The specific application code which now fails is:
       - Create ZipFile
       - Obtain InputStream (ZipFileInputStream)
       - Release Java reference to ZipFile

      The ZipFile will then be GC'd while the application is reading from the input
      stream, leading to a crash in native code.

            zlisunw Zhenghua Li (Inactive)
            kbr Kenneth Russell (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: