← Back to team overview

openjdk team mailing list archive

[Bug 1811324] Re: RandomAccessFile::setLength will not shrink sparse files

 

This bug was fixed in the package openjdk-8 - 8u191-b12-2ubuntu0.18.10.1

---------------
openjdk-8 (8u191-b12-2ubuntu0.18.10.1) cosmic-security; urgency=medium

  * Backport from Disco.

openjdk-8 (8u191-b12-2ubuntu0.19.04.1) disco; urgency=medium

  * Apply 11.0.2 security patches.
  * Security fixes:
    - CVE-2019-2422, S8206290: Better FileChannel transfer performance.
    - CVE-2019-2426, S8209094: Improve web server connections.
    - S8199156: Better route routing.
    - S8199552: Update to build scripts.
    - S8200659: Improve BigDecimal support.
    - S8203955: Improve robot support.
    - S8204895: Better icon support.
    - S8205709: Proper allocation handling.
    - S8205714: Initial class initialization.
    - S8210094: Better loading of classloader classes.
    - S8210606: Improved data set handling.
    - S8210866: Improve JPEG processing.
  * Update DEP8 tests:
    - debian/tests/control: updated to allow stderr output and to remove
      dpkg-dev dependency.
    - debian/tests/jtdiff-autopkgtest.sh: use dpkg --print-architecture
      instead of dpkg-architecture; log script name on any output.
    - debian/tests/jtreg-autopkgtest.in: use dpkg --print-architecture instead
      of dpkg-architecture; do not retain test temporary files; log script
      name on any output.
    - debian/tests/jtreg-autopkgtest.sh: regenerated.
  * debian/patches/jdk-8u192-S8202261.patch: RandomAccessFile::setLength will
    not shrink sparse files. (LP: #1811324)

openjdk-8 (8u191-b12-2) unstable; urgency=high

  * Upload to unstable.
  * Remove the "Team upload" for the last upload to experimental.

openjdk-8 (8u191-b12-1) experimental; urgency=medium

  * Update to 8u191-b12. (Closes: #911925, Closes: #912333, LP: #1800792)
  * debian/excludelist.jdk.jtx: no longer needed, using ProblemsList.txt
    from upstream now.
  * debian/excludelist.langtools.jtx: upstream testing does not use any
    exclusion list.
  * debian/patches/sec-webrev-8u191-b12*: removed, applied upstream.
  * debian/patches/jdk-8132985-backport-double-free.patch,
    debian/patches/jdk-8139803-backport-warning.patch: fix crash in
    freetypescaler due to double free, thanks to Heikki Aitakangas for
    the report and patches. (Closes: #911847)
  * debian/rules:
    - tar and save JTreport directory.
    - run the same limited set of tests as upstream does.
    - call the same testsuites scripts used for autopkgtest.
    - reenable jdk testsuite.
    - simplified and moved xvfb logic into check-jdk rule.
    - removed jtreg and xvfb build dependency logic and moved the bdeps
      into debian/control.in.
    - added rules to generate autopkgtest scripts from templates.
  * updated dep8 tests:
    - debian/test/control: run hotspot, langtools, and jdk testsuites.
    - debian/tests/hotspot, debian/tests/jdk, debian/tests/langtools:
      add scripts for each testsuite to be run.
    - debian/tests/jtreg-autopkgtest.sh: template to generate the jtreg
      script used by the autopkgtest tests.
    - debian/tests/jtdiff-autopkgtest.sh: used by the scripts to report
      any differences between the autopkgtest and the tests results
      generated during the openjdk package build.
    - debian/tests/jtreg-autopkgtest.sh: used by the scripts to run jtreg
      and put the resulting artifacts in the right places.
    - debian/tests/valid-tests: removed, no longer needed.

 -- Tiago Stürmer Daitx <tiago.daitx@xxxxxxxxxx>  Mon, 14 Jan 2019
21:02:00 +0000

** Changed in: openjdk-8 (Ubuntu)
       Status: New => Fix Released

** CVE added: https://cve.mitre.org/cgi-bin/cvename.cgi?name=2019-2422

** CVE added: https://cve.mitre.org/cgi-bin/cvename.cgi?name=2019-2426

** Changed in: openjdk-8 (Ubuntu)
       Status: New => Fix Released

-- 
You received this bug notification because you are a member of OpenJDK,
which is subscribed to openjdk-8 in Ubuntu.
https://bugs.launchpad.net/bugs/1811324

Title:
  RandomAccessFile::setLength will not shrink sparse files

Status in openjdk-8 package in Ubuntu:
  Fix Released

Bug description:
  This bug is filed upstream already as JDK-8202261.

  It was introduced by JDK-8168628.

  So in bionic, it was introduced on Mon, 19 Nov 2018 when 8u191-b12
  replaced 8u181-b13.

  The bug is in RandomAccessFile::setLength. This method used to call
  ftruncate whether it was growing or shrinking the file. It was changed
  to call ftruncate when shrinking the file, and fallocate when growing.
  This is a performance concern all by itself, but the more serious
  issue is the bug in how they implemented the check to see if this was
  a grow operation or a shrink operation:

  if (fstat64(fd, &sb) == 0 && length > sb.st_blocks*512) {
      // ...
  }

  Which makes the assumption that st_blocks*512 is the same as st_size,
  which is not true in some situations (e.g. sparse files or in a
  filesystem with transparent compression like zfs).

  The result is that calling randomAccessFile.setLength(length) on a
  sparse file whose length is greater than the provided length will not
  set the length at all. It will simply fallocate() the file and leave
  the length the same.

  Attached Shrink.java which reproduces the problem.

  This problem is acknowledged in Alan Bateman's comment on JDK-8168628:

  "This change has been backed out of JDK 11 as it break sparse files."

  The change that introduced the problem is being corrected in 8u202-b1,
  but I would request that bionic backport the patch to the current
  openjdk-8 as this is a regression from the state of openjdk-8 at
  bionic release time.

  Patch is here: http://hg.openjdk.java.net/jdk/jdk/rev/117501815bed

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/openjdk-8/+bug/1811324/+subscriptions


References