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

Issue 599002: Bug in wasteful_vector page allocator (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 6 months ago by Ivan Penkov
Modified:
11 years, 6 months ago
Base URL:
http://google-breakpad.googlecode.com/svn/trunk/
Visibility:
Public.

Description

Thanks to Matthew Riley who noticed this issue and provided the initial proposal
for the fix.

There's a bug in the new allocator<T> implementation used by wasteful_vector. 
It inherits the base class' implementation of allocator and doesn't implement
allocate() so it goes to the heap instead of the PageAllocator -- the very thing
wasteful_vector was trying to avoid!  As a side effect it was also leaking heap
memory.

Thanks,
-Ivan
Committed: https://code.google.com/p/google-breakpad/source/detail?r=1188

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : #

Patch Set 6 : #

Patch Set 7 : #

Patch Set 8 : #

Patch Set 9 : #

Total comments: 10

Patch Set 10 : #

Unified diffs Side-by-side diffs Delta from patch set Stats Patch
M src/common/memory.h View 1 2 3 4 5 6 7 8 9 6 chunks +28 lines, -12 lines 0 comments Download
M src/common/memory_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +8 lines, -0 lines 0 comments Download

Messages

Total messages: 6
Ivan Penkov
.
11 years, 6 months ago #1
Mark Mentovai
Good find! https://breakpad.appspot.com/599002/diff/10001/src/common/memory.h File src/common/memory.h (right): https://breakpad.appspot.com/599002/diff/10001/src/common/memory.h#newcode1 src/common/memory.h:1: // Copyright (c) 2009, Google Inc. The ...
11 years, 6 months ago #2
glandium
https://breakpad.appspot.com/599002/diff/10001/src/common/memory.h File src/common/memory.h (right): https://breakpad.appspot.com/599002/diff/10001/src/common/memory.h#newcode161 src/common/memory.h:161: inline pointer allocate(size_type n, const void* = 0) { ...
11 years, 6 months ago #3
Ivan Penkov
. https://breakpad.appspot.com/599002/diff/10001/src/common/memory.h File src/common/memory.h (right): https://breakpad.appspot.com/599002/diff/10001/src/common/memory.h#newcode1 src/common/memory.h:1: // Copyright (c) 2009, Google Inc. On 2013/05/23 ...
11 years, 6 months ago #4
Mark Mentovai
LGTM https://breakpad.appspot.com/599002/diff/10001/src/common/memory.h File src/common/memory.h (right): https://breakpad.appspot.com/599002/diff/10001/src/common/memory.h#newcode103 src/common/memory.h:103: if ((p > current) && (p < current ...
11 years, 6 months ago #5
Mark Mentovai
11 years, 6 months ago #6
LGTM
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld 1004:630ec63f810e-tainted