JDK-8184306: zlib 1.2.11 upgrade triggers j.u.zip.Deflater regression
Alan.Bateman at oracle.com
Thu Jul 13 06:52:05 UTC 2017
On 13/07/2017 00:06, Xueming Shen wrote:
> My reading of the 1.2.11 changes suggests the root cause is that the
> state "deflate_state.high_water" is not being reset
> correctly/appropriately (to 0?)
> in deflateReset/deflateResetKeep/lm_init().
> AND the change of one of the conditions in deflate.c/deflateParams(),
> "strm->total_in!=0" to "s->high_water" (in the "Flush last buffer"
> branch) as showed
> below, obvious triggers the regression from 1.2.8 to 1.2.11, in the
> scenario that
> the "strategy/levle is changed" AND a followup "reset()" is called
> (with the
> assumption that everything should be reset back to initial state and
> we start a
> new compression circle, with the new level and strategy. This is how
> it works
> in 1.2.8 and early releases).
This is good sleuthing and I think you have identified the regression.
The fix looks right although it would be good to get confirmation from
the zlib maintainers (no comments on zlib/issues/275 so far).
As this is a P1 showstopper issue then additional eyes are welcome, esp.
if we patch zlib rather than go back to an older version.
More information about the core-libs-dev