Alexey Serbin has uploaded this change for review. ( 
http://gerrit.cloudera.org:8080/22608


Change subject: KUDU-3647 more robust zlib wrapper code
......................................................................

KUDU-3647 more robust zlib wrapper code

This patch introduces much more robust error handling for both
zlib::{CompressLevel,Uncompress}() utility wrappers and fixes a few bugs
introduced along with other modifications in [1].  In addition, the code
now follows the documented API of zlib's inflate()/deflate() more
closely per docs [2] and example [3], while zlib::CompressLevel()
no longer allocates memory on the heap and uses a much smaller
stack-allocated buffer.  It seems that using a larger heap-allocated
buffer inadvertently hid the improper usage of zlib's deflate() API.

This patch adds a few test scenarios to cover the main functionality
of zlib::CompressLevel() and zlib::Uncompress(), and also a few specific
conditions attributed to truncated and corrupted input data that's fed
to zlib::Uncompress().

[1] https://issues.apache.org/jira/browse/KUDU-3201
[2] https://zlib.net/zlib_how.html
[3] https://zlib.net/zpipe.c

Change-Id: I5babcaf0a07c284d44f16201aa765e277b6464d3
Reviewed-on: http://gerrit.cloudera.org:8080/22568
Reviewed-by: Abhishek Chennaka <[email protected]>
Tested-by: Alexey Serbin <[email protected]>
(cherry picked from commit 1733cfc5adaa27e361e2f2df25a8d8c12d8c8710)
---
M src/kudu/util/CMakeLists.txt
A src/kudu/util/zlib-test.cc
M src/kudu/util/zlib.cc
M src/kudu/util/zlib.h
4 files changed, 236 insertions(+), 37 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/08/22608/1
--
To view, visit http://gerrit.cloudera.org:8080/22608
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: branch-1.18.x
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5babcaf0a07c284d44f16201aa765e277b6464d3
Gerrit-Change-Number: 22608
Gerrit-PatchSet: 1
Gerrit-Owner: Alexey Serbin <[email protected]>

Reply via email to