Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1548)

Issue 6249067: compress/flate: fix overflow on 2GB input. Reset hashOf...

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 11 months ago by Ivan Krasin
Modified:
10 years, 9 months ago
Reviewers:
imkrasin, rsc
CC:
rsc, golang-dev
Visibility:
Public.

Description

compress/flate: fix overflow on 2GB input. Reset hashOffset every 16 MB. This bug has been introduced in the following revision: changeset: 11404:26dceba5c610 user: Ivan Krasin <krasin@golang.org> date: Mon Jan 23 09:19:39 2012 -0500 summary: compress/flate: reduce memory pressure at cost of additional arithmetic operation. This is the review page for that CL: http://codereview.appspot.com/5555070/

Patch Set 1 #

Patch Set 2 : diff -r 21b2ae0204b0 https://code.google.com/p/go #

Patch Set 3 : diff -r 0b547443cfa5 https://code.google.com/p/go #

Patch Set 4 : diff -r 0b547443cfa5 https://code.google.com/p/go #

Patch Set 5 : diff -r 0b547443cfa5 https://code.google.com/p/go #

Patch Set 6 : diff -r 0b547443cfa5 https://code.google.com/p/go #

Patch Set 7 : diff -r 0b547443cfa5 https://code.google.com/p/go #

Total comments: 10

Patch Set 8 : diff -r 0b547443cfa5 https://code.google.com/p/go #

Patch Set 9 : diff -r 0b547443cfa5 https://code.google.com/p/go #

Unified diffs Side-by-side diffs Delta from patch set Stats (+64 lines, -0 lines) Patch
M src/pkg/compress/flate/deflate.go View 1 2 chunks +20 lines, -0 lines 0 comments Download
M src/pkg/compress/flate/deflate_test.go View 1 2 3 4 5 6 7 8 1 chunk +44 lines, -0 lines 0 comments Download

Messages

Total messages: 13
Ivan Krasin
11 years, 11 months ago (2012-05-30 01:28:42 UTC) #1
rsc
Looks good. Now that you understand the bug, is it possible to write a simple ...
11 years, 11 months ago (2012-05-30 03:19:10 UTC) #2
imkrasin
Hi Russ, I have added the test (a very long, sparse input). Also, I don't ...
11 years, 11 months ago (2012-05-30 17:11:21 UTC) #3
rsc
I patched this in, reverted deflate.go, and changed 2*maxHashOffset to 1<<25 in the test, and ...
11 years, 11 months ago (2012-05-30 17:23:01 UTC) #4
imkrasin
Just a sec.
11 years, 11 months ago (2012-05-30 17:25:21 UTC) #5
imkrasin
On 2012/05/30 17:25:21, imkrasin wrote: > Just a sec. My estimation was about 3600x more ...
11 years, 11 months ago (2012-05-30 18:26:12 UTC) #6
imkrasin
The idea of the test: the bug is reproduced when hashHead contains a very (> ...
11 years, 11 months ago (2012-05-30 18:31:13 UTC) #7
rsc
Thanks for working out a test. http://codereview.appspot.com/6249067/diff/6004/src/pkg/compress/flate/deflate_test.go File src/pkg/compress/flate/deflate_test.go (right): http://codereview.appspot.com/6249067/diff/6004/src/pkg/compress/flate/deflate_test.go#newcode103 src/pkg/compress/flate/deflate_test.go:103: type sparseReader struct ...
11 years, 11 months ago (2012-05-30 18:39:18 UTC) #8
imkrasin
http://codereview.appspot.com/6249067/diff/6004/src/pkg/compress/flate/deflate_test.go File src/pkg/compress/flate/deflate_test.go (right): http://codereview.appspot.com/6249067/diff/6004/src/pkg/compress/flate/deflate_test.go#newcode103 src/pkg/compress/flate/deflate_test.go:103: type sparseReader struct { On 2012/05/30 18:39:18, rsc wrote: ...
11 years, 11 months ago (2012-05-30 20:01:19 UTC) #9
rsc
*** Submitted as http://code.google.com/p/go/source/detail?r=00a1ca1ea3bd *** compress/flate: fix overflow on 2GB input. Reset hashOffset every 16 ...
11 years, 11 months ago (2012-05-30 20:08:44 UTC) #10
rsc
LGTM Thanks for all the revisions. I feel good about this fix now.
11 years, 11 months ago (2012-05-30 20:08:52 UTC) #11
imkrasin
On 2012/05/30 20:08:52, rsc wrote: > LGTM > > Thanks for all the revisions. I ...
11 years, 11 months ago (2012-05-30 20:21:55 UTC) #12
remyoudompheng
10 years, 9 months ago (2013-07-21 19:57:26 UTC) #13
R=close
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b