If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

mozalloc landing broke trace-malloc on Linux

RESOLVED FIXED in mozilla2.0b2

Status

()

Core
XPCOM
RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: dbaron, Assigned: dbaron)

Tracking

Trunk
mozilla2.0b2
x86
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

7 years ago
The mozalloc landing broke trace-malloc on Linux -- it now only overrides calls to malloc that go through moz_malloc, and doesn't override other calls to malloc (and likewise for the other functions).

I think the right fix is just adding:
>/*
> * We need to redefine |malloc|, etc. in this file; without this, we'll
> * end up redefining |moz_malloc|, etc. instead.
> */
>#define MOZALLOC_DONT_DEFINE_MACRO_WRAPPERS
to the top of nsTraceMalloc.c -- it looks like mozalloc doesn't actually try to override malloc itself, so nsTraceMalloc can still continue to do so.


This would probably explain the massive drop in leak stats on Linux.
(Assignee)

Comment 1

7 years ago
>#define MOZALLOC_DONT_DEFINE_MACRO_WRAPPERS

That  macro is actually just defined in one place and never used (probably dead code).  But the undef header looks like it'll work.
(Assignee)

Comment 2

7 years ago
Created attachment 455880 [details] [diff] [review]
patch
Attachment #455880 - Flags: review?(jones.chris.g)
Comment on attachment 455880 [details] [diff] [review]
patch

Hm ... bad.  I sure thought we had something like this in place.  Thanks.

I prefer -DMOZ_NO_MOZALLOC in Makefile.in to this fix.
(Assignee)

Comment 4

7 years ago
Created attachment 457952 [details] [diff] [review]
patch 2

... as requested
Attachment #455880 - Attachment is obsolete: true
Attachment #457952 - Flags: review?(jones.chris.g)
Attachment #455880 - Flags: review?(jones.chris.g)
Comment on attachment 457952 [details] [diff] [review]
patch 2

Thanks.
Attachment #457952 - Flags: review?(jones.chris.g) → review+
(Assignee)

Comment 6

7 years ago
http://hg.mozilla.org/mozilla-central/rev/46af914448ae
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla2.0b2
You need to log in before you can comment on or make changes to this bug.