Closed
Bug 392118
Opened 19 years ago
Closed 19 years ago
port trace-malloc to Mac OS X
Categories
(Core :: General, defect)
Tracking
()
RESOLVED
FIXED
mozilla1.9alpha8
People
(Reporter: dbaron, Assigned: dbaron)
References
Details
Attachments
(3 files, 1 obsolete file)
|
5.09 KB,
patch
|
brendan
:
review+
brendan
:
approval1.9+
|
Details | Diff | Splinter Review |
|
1.04 KB,
patch
|
benjamin
:
review+
bzbarsky
:
approval1.9+
|
Details | Diff | Splinter Review |
|
505 bytes,
patch
|
benjamin
:
review+
bzbarsky
:
approval1.9+
|
Details | Diff | Splinter Review |
I have patches to get trace-malloc working on Mac OS X, modulo the Mac OS X stack walking code in XPCOM, which I don't have working yet.
It was pretty easy; I checked that the thread-local storage stuff using pthreads seem to think we have a new thread at about the right places, and the nsGetTypeName code even works.
The malloc-hooking required a quick look at Apple's APSL-ed Libc code to find out what the hooks were, since they're not documented in the headers.
| Assignee | ||
Comment 1•19 years ago
|
||
Attachment #276564 -
Flags: review?(brendan)
| Assignee | ||
Comment 2•19 years ago
|
||
So I hit a bad dependency rule that I think nobody's hit yet. I'm not even sure the rule is necessary; the correct solution may be to remove it. But instead I made it work, I think, although I'm not sure how portably.
The problem was that EXTRA_DSO_LIBS is not a sensible thing to append to DSO_LDOPS_DEPS; there's no file called "-ltracemalloc". To work around that, I made an EXTRA_DSO_LIB_FILES variable. But then, the makefile where I was having the problem happened to override DLL_PREFIX and DLL_SUFFIX, which my definition of EXTRA_DSO_LIB_FILES depended on, so I gave that makefile a different way to do what it was doing (IS_FRAMEWORK).
I'm not sure if EXTRA_DSO_LIBS are always shared libraries, though. In fact, I'm pretty sure they're not, which means this patch is wrong. But I'm not sure what we *do* want to do here. Advice?
Attachment #276565 -
Flags: review?(benjamin)
| Assignee | ||
Comment 3•19 years ago
|
||
Patch 3 isn't written yet, but I need to reorganize tools/trace-malloc/Makefile.in somehow so that it links leaksoup with the C++ compiler rather than the C compiler. That may involve moving spacetrace into its own subdirectory.
Comment 4•19 years ago
|
||
Comment on attachment 276564 [details] [diff] [review]
patch 1: trace-malloc port to Mac OS X
The declarator name in the function typedef doesn't need parens around it, but I guess that's how the hidden Apple source wrote it.
r/a=me.
/be
Attachment #276564 -
Flags: review?(brendan)
Attachment #276564 -
Flags: review+
Attachment #276564 -
Flags: approval1.9+
Comment 5•19 years ago
|
||
GNU make can calculate dependencies of the form -lfoo, kinda. It uses the VPATH to determine where to look, which is IMO not ideal.
I'll look at this more tomorrow when I can concentrate.
| Assignee | ||
Comment 6•19 years ago
|
||
Patch 1 landed on trunk 2007-08-14 09:35 -0700.
| Assignee | ||
Comment 7•19 years ago
|
||
Right, it turns out that the half of the patch that I wrote second is sufficient on its own. Whatever makes -ltracemalloc work requires DLL_PREFIX and DLL_SUFFIX (or at least one of them) to be set correctly.
Attachment #276565 -
Attachment is obsolete: true
Attachment #276984 -
Flags: review?(benjamin)
Attachment #276565 -
Flags: review?(benjamin)
Updated•19 years ago
|
Attachment #276984 -
Flags: review?(benjamin) → review+
| Assignee | ||
Comment 8•19 years ago
|
||
This is the other half of the required build system changes: this makefile is pretty weird already, and this minimal fix makes us use g++ as the linker, which is needed for leaksoup. rules.mk sets CPP_PROG_LINK if CPPSRCS or CMMSRCS are set; we're setting SIMPLE_CPPSRCS instead.
Attachment #276986 -
Flags: review?(benjamin)
| Assignee | ||
Updated•19 years ago
|
Attachment #276984 -
Flags: approval1.9?
Updated•19 years ago
|
Attachment #276986 -
Flags: review?(benjamin) → review+
| Assignee | ||
Updated•19 years ago
|
Attachment #276986 -
Flags: approval1.9?
Comment 9•19 years ago
|
||
Comment on attachment 276984 [details] [diff] [review]
patch 2: build system patch, part 1: fix bad dependency
a=bzbarsky
Attachment #276984 -
Flags: approval1.9? → approval1.9+
Comment 10•19 years ago
|
||
Comment on attachment 276986 [details] [diff] [review]
patch 3: build system patch, part 2: set CPP_PROG_LINK
a=bzbarsky
Attachment #276986 -
Flags: approval1.9? → approval1.9+
| Assignee | ||
Comment 11•19 years ago
|
||
Both build system patches checked in, 2007-08-19 17:00 -0700.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•