Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(34)

Issue 11266019: Use tcmalloc's debugallocation for Debug builds (Closed)

Created:
8 years, 1 month ago by Paweł Hajdan Jr.
Modified:
8 years ago
CC:
chromium-reviews, erikwright+watch_chromium.org, dmikurube+memory_chromium.org
Visibility:
Public.

Description

Add an option to use tcmalloc's debugallocation for Debug builds to catch memory problems early, easily, and cleanly. This is disabled by default. Because of gyp limitations, the flag is to force-disable the feature, but there is no flag to force-enable it. BUG=30715 TEST=none Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=171063

Patch Set 1 #

Patch Set 2 : gyp flag #

Patch Set 3 : win fixes #

Patch Set 4 : disable by default #

Unified diffs Side-by-side diffs Delta from patch set Stats (+26 lines, -26 lines) Patch
M base/allocator/allocator.gyp View 1 2 3 6 chunks +21 lines, -18 lines 0 comments Download
M base/allocator/allocator_shim.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
A + base/allocator/debugallocation_shim.cc View 1 chunk +4 lines, -4 lines 0 comments Download
M build/common.gypi View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download

Messages

Total messages: 15 (0 generated)
Paweł Hajdan Jr.
8 years, 1 month ago (2012-10-24 22:36:51 UTC) #1
willchan no longer on Chromium
If this doesn't break tests, then LGTM.
8 years, 1 month ago (2012-10-24 22:43:09 UTC) #2
Dai Mikurube (NOT FULLTIME)
Does this introduce debugallocation unconditionally? And, can't we use any flag to select debugallocation, actually? ...
8 years, 1 month ago (2012-10-25 00:06:44 UTC) #3
willchan no longer on Chromium
debugallocation allocates extra bytes around each block to mark them as unused, freed, in use, ...
8 years, 1 month ago (2012-10-25 00:53:16 UTC) #4
Dai Mikurube (NOT FULLTIME)
It may work only with release_extra_cflags=-fno-omit-frame-pointer on Release builds. But, Chromium developers usually/sometimes use Debug ...
8 years, 1 month ago (2012-10-25 02:19:56 UTC) #5
Paweł Hajdan Jr.
On 2012/10/25 02:19:56, Dai Mikurube wrote: > It may work only with release_extra_cflags=-fno-omit-frame-pointer on Release ...
8 years, 1 month ago (2012-10-25 17:18:00 UTC) #6
Dai Mikurube (NOT FULLTIME)
On 2012/10/25 17:18:00, Paweł Hajdan Jr. wrote: > On 2012/10/25 02:19:56, Dai Mikurube wrote: > ...
8 years, 1 month ago (2012-10-26 03:25:41 UTC) #7
Paweł Hajdan Jr.
PTAL debugallocation is disabled in Release builds and for now there is no flag to ...
8 years, 1 month ago (2012-10-26 17:08:46 UTC) #8
Paweł Hajdan Jr.
PTAL debugallocation is disabled in Release builds and for now there is no flag to ...
8 years, 1 month ago (2012-10-26 17:09:18 UTC) #9
Paweł Hajdan Jr.
PTAL debugallocation is disabled in Release builds and for now there is no flag to ...
8 years, 1 month ago (2012-10-26 17:10:43 UTC) #10
Dai Mikurube (NOT FULLTIME)
On 2012/10/26 17:10:43, Paweł Hajdan Jr. wrote: > PTAL > > debugallocation is disabled in ...
8 years, 1 month ago (2012-10-27 02:03:01 UTC) #11
willchan no longer on Chromium
allocator_shim.cc shouldn't do anything in posix, right? I think that's a windows only file. I ...
8 years, 1 month ago (2012-10-27 02:35:20 UTC) #12
Dai Mikurube (NOT FULLTIME)
Yes, I think allocator_shim.cc is posix-only. But, allocator.gyp looked using debugallocation_shim.cc unconditionally even for Windows. ...
8 years, 1 month ago (2012-10-29 07:07:11 UTC) #13
willchan no longer on Chromium
I see. While I think we could make debugallocation_shim.cc work on Windows too (and that'd ...
8 years, 1 month ago (2012-10-29 17:29:23 UTC) #14
Dai Mikurube (NOT FULLTIME)
8 years, 1 month ago (2012-10-30 07:46:10 UTC) #15
Ah, I said a wrong thing.  allocator_shim.cc is *Windows*-only, and
debugallocation_shim.cc looks used also in Windows.

Both ways sound reasonable.  I defer it to phajdan how to do it, too.


On 2012/10/29 17:29:23, willchan wrote:
> I see. While I think we could make debugallocation_shim.cc work on Windows
> too (and that'd be neat!), it might be better to start with just posix. I
> defer to phajdan for how he wants to execute on this.
> 
> 
> On Mon, Oct 29, 2012 at 12:07 AM, <mailto:dmikurube@chromium.org> wrote:
> 
> > Yes, I think allocator_shim.cc is posix-only.  But, allocator.gyp looked
> > using
> > debugallocation_shim.cc unconditionally even for Windows.  (Though I'm not
> > sure... I'm not familiar with gyp.)
> >
> > If debugallocation_shim.cc is used only in Linux, the change looks good to
> > me.
> >
> >
> > On 2012/10/27 02:35:20, willchan wrote:
> >
> >> allocator_shim.cc shouldn't do anything in posix, right? I think that's a
> >> windows only file. I haven't checked. debugallocation_shim.cc should be
> >> posix only.
> >>
> >
> >
> >  On Fri, Oct 26, 2012 at 7:03 PM, <mailto:dmikurube@chromium.org**> wrote:
> >>
> >
> >  > On 2012/10/26 17:10:43, Paweł Hajdan Jr. wrote:
> >> >
> >> >> PTAL
> >> >>
> >> >
> >> >  debugallocation is disabled in Release builds and for now there is no
> >> >> flag to
> >> >> turn it on for Release. I don't think this is a big deal, at least for
> >> >> now.
> >> >>
> >> >
> >> >  For Debug builds, I added a new gyp flag that allows you to disable
> >> >> debugallocation.
> >> >>
> >> >
> >> > It basically looks good to me.  One question: how does it live together
> >> > with
> >> > allocator_shim.cc?  It looks that both allocator_shim.cc and
> >> > debugallocation_shim.cc are including tcmalloc.cc.  (Tell me if I'm
> >> wrong.
> >> > ;) )
> >> >
> >> >
> >>
> >
> > http://codereview.chromium.****org/11266019/%253Chttp://coderev**
> > iew.chromium.org/11266019/ <http://codereview.chromium.org/11266019/>>
> >
> >> >
> >>
> >
> >
> >
>
http://codereview.chromium.**org/11266019/%3Chttp://codereview.chromium.org/1...>
> >

Powered by Google App Engine
This is Rietveld 408576698