win32 trace-malloc sybolic function names

RESOLVED FIXED

Status

RESOLVED FIXED
17 years ago
14 years ago

People

(Reporter: blythe, Assigned: blythe)

Tracking

({memory-footprint})

Trunk
x86
Windows 2000
memory-footprint

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

17 years ago
The only thing left in order for all trace-malloc tools to work under windows is
to get the symbolic function names to work.

Right now, only a certain subset of the names get resolved by trace-malloc.

My belief is that when the win32 imghelp function SymInitialize is called, that
not all the relevant DLLs are loaded, and thus not all of their symbols are
pulled into memory and properly reported by our stack crawling code.

There are 3 possible fixes/workarounds for this:

1)  Use a static build, with no DLLs.
2)  Unverified if this works, but run it under a debugger, which will load the
symbols on your behalf.
3)  Figure out how to load the symbols on deman at runtime using SymLoadModule.


I will be attempting to resolve option #3 and finally be done with it.
(Assignee)

Updated

17 years ago
Status: NEW → ASSIGNED
Keywords: footprint
(Assignee)

Comment 1

17 years ago
Created attachment 59374 [details] [diff] [review]
Proposed changes to get all symbols to resolve under win32

Requesting for review to fix trace-malloc on win32.
(Assignee)

Comment 2

17 years ago
adding some people in the hopes I can get this reviewed and checked in soon.
Requesting R,SR
Comment on attachment 59374 [details] [diff] [review]
Proposed changes to get all symbols to resolve under win32

>Index: mozilla/xpcom/base/nsTraceMalloc.c
>+/*
>+ * Callback used by SymGetSymFromAddrEspecial
>+ */

Looks to me like it's used from SymGetModuleInfoEspecial.

Other than that, and what brendan is commenting about, r=dbaron.
Attachment #59374 - Flags: review+
Comment on attachment 59374 [details] [diff] [review]
Proposed changes to get all symbols to resolve under win32

Use ?: and avoid FALSE != for my sanity, ok?  I.e., instead of

+    if(
+	 (FALSE != addressIncreases && addr >= aModuleBase && addr <=
(aModuleBase + aModuleSize))
+	 ||
+	 (FALSE == addressIncreases && addr <= aModuleBase && addr >=
(aModuleBase - aModuleSize))
+	 )

do this:

+    if(addressIncreases
+	? (addr >= aModuleBase && addr <= (aModuleBase + aModuleSize))
+	: (addr <= aModuleBase && addr >= (aModuleBase - aModuleSize))
+	 )

sr=brendan@mozilla.org otherwise.

/be
Attachment #59374 - Flags: review+ → superreview+
(Assignee)

Comment 5

17 years ago
checked in after making the changes.
Status: ASSIGNED → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → FIXED
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.