RandomAccessFile::setLength will not shrink sparse files
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
openjdk-8 (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
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 RandomAccessFil
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 randomAccessFil
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://
This bug was fixed in the package openjdk-8 - 8u191-b12- 2ubuntu0. 18.10.1
--------------- b12-2ubuntu0. 18.10.1) cosmic-security; urgency=medium
openjdk-8 (8u191-
* Backport from Disco.
openjdk-8 (8u191- b12-2ubuntu0. 19.04.1) disco; urgency=medium
* Apply 11.0.2 security patches. tests/control: updated to allow stderr output and to remove tests/jtdiff- autopkgtest. sh: use dpkg --print- architecture tests/jtreg- autopkgtest. in: use dpkg --print- architecture instead tests/jtreg- autopkgtest. sh: regenerated. patches/ jdk-8u192- S8202261. patch: RandomAccessFil e::setLength will
* 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/
dpkg-dev dependency.
- debian/
instead of dpkg-architecture; log script name on any output.
- debian/
of dpkg-architecture; do not retain test temporary files; log script
name on any output.
- debian/
* debian/
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) excludelist. jdk.jtx: no longer needed, using ProblemsList.txt excludelist. langtools. jtx: upstream testing does not use any patches/ sec-webrev- 8u191-b12* : removed, applied upstream. patches/ jdk-8132985- backport- double- free.patch, patches/ jdk-8139803- backport- warning. patch: fix crash in test/control: run hotspot, langtools, and jdk testsuites. tests/hotspot, debian/tests/jdk, debian/ tests/langtools : tests/jtreg- autopkgtest. sh: template to generate the jtreg tests/jtdiff- autopkgtest. sh: used by the scripts to report
* debian/
from upstream now.
* debian/
exclusion list.
* debian/
* debian/
debian/
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/
- debian/
add scripts for each testsuite to be run.
- debian/
script used by the autopkgtest tests.
- debian/
any differences between the autopkgtest and the tests results
generated during the openjdk package...