Bug 222136 - [regression] [zlib] [patch] embedded Tomcat web server gzip compression broken after latest zlib import
Summary: [regression] [zlib] [patch] embedded Tomcat web server gzip compression broke...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 11.1-STABLE
Hardware: Any Any
: --- Affects Some People
Assignee: FreeBSD Release Engineering
URL: https://github.com/madler/zlib/commit...
Keywords: patch, regression
Depends on:
Blocks:
 
Reported: 2017-09-08 10:29 UTC by Eugene Grosbein
Modified: 2017-09-14 13:09 UTC (History)
2 users (show)

See Also:
marius: mfc-stable10+
marius: mfc-stable11+


Attachments
upstream fix for deflate.c (932 bytes, patch)
2017-09-08 10:29 UTC, Eugene Grosbein
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eugene Grosbein freebsd_committer 2017-09-08 10:29:38 UTC
Created attachment 186164 [details]
upstream fix for deflate.c

I've just upgraded my FreeBSD 11.0 server upto recent 11.1-STABLE without touching other software. The server runs UniFi Controller containing embedded Tomcat web server that uses gzip to compress HTML responses.

After FreeBSD upgrade, it started producing broken gzip stream and "curl -vvvv --compress localhost:8880/guest/s/default/" confirms that complaining "Error while processing content unencoding: invalid block type".

The problem is exactly the same described in https://bugs.launchpad.net/ubuntu/+source/zlib/+bug/1692870 that points to the upstream fix: https://github.com/madler/zlib/commit/f9694097dd69354b03cb8af959094c7f260db0a1#diff-766e4159febe3390b2e58127d6c973d3 that I've attached to this PR (deflate.c part, without comment part in zlib.h)

This patch fixes the problem.
Comment 1 Eugene Grosbein freebsd_committer 2017-09-08 13:56:08 UTC
delphij privetely reported not being able to test/commit this handily and 10.4 release cycle is rolling fast, so re-assign this to the Release Engineering team.
Comment 2 commit-hook freebsd_committer 2017-09-10 01:25:39 UTC
A commit references this bug:

Author: marius
Date: Sun Sep 10 01:25:16 UTC 2017
New revision: 323382
URL: https://svnweb.freebsd.org/changeset/base/323382

Log:
  MFV: r323381

  Permit a deflateParams() parameter change as soon as possible.

  This change fixes compression errors seen when the embedded Tomcat
  web server of a UniFi Controller zlib compresses responses. Given
  that Tomcat just uses Java/OpenJDK which in turn employs zlib for
  its compression/decompression support, this bug might very well
  affect other applications, too.

  PR:	222136

Changes:
_U  head/contrib/zlib/
  head/contrib/zlib/deflate.c
  head/contrib/zlib/zlib.h
Comment 3 commit-hook freebsd_committer 2017-09-13 21:22:31 UTC
A commit references this bug:

Author: marius
Date: Wed Sep 13 21:21:33 UTC 2017
New revision: 323563
URL: https://svnweb.freebsd.org/changeset/base/323563

Log:
  MFC: 323382, MFV: r323381

  Permit a deflateParams() parameter change as soon as possible.

  This change fixes compression errors seen when the embedded Tomcat
  web server of a UniFi Controller zlib compresses responses. Given
  that Tomcat just uses Java/OpenJDK which in turn employs zlib for
  its compression/decompression support, this bug might very well
  affect other applications, too.

  PR:	222136

Changes:
_U  stable/11/
  stable/11/contrib/zlib/deflate.c
  stable/11/contrib/zlib/zlib.h
Comment 4 commit-hook freebsd_committer 2017-09-13 21:57:02 UTC
A commit references this bug:

Author: marius
Date: Wed Sep 13 21:56:49 UTC 2017
New revision: 323565
URL: https://svnweb.freebsd.org/changeset/base/323565

Log:
  MFC: r323382, MFV: r323381

  Permit a deflateParams() parameter change as soon as possible.

  This change fixes compression errors seen when the embedded Tomcat
  web server of a UniFi Controller zlib compresses responses. Given
  that Tomcat just uses Java/OpenJDK which in turn employs zlib for
  its compression/decompression support, this bug might very well
  affect other applications, too.

  PR:		222136
  Approved by:	re (gjb)

Changes:
_U  stable/10/
  stable/10/contrib/zlib/deflate.c
  stable/10/contrib/zlib/zlib.h
Comment 5 Xin LI freebsd_committer 2017-09-14 12:07:40 UTC
Eugene, should we issue an EN for this one?
Comment 6 Eugene Grosbein freebsd_committer 2017-09-14 13:09:53 UTC
(In reply to Xin LI from comment #5)

I'm not sure. Ubuntu had this problem reported and unfixed for half a year and no catastrophe occured. We had it committed and MFC'd for half a year too and I found no reports in our Bugzilla. It seems the problem is not so fearsome.