Re: trouble using MallocDebug
Re: trouble using MallocDebug
- Subject: Re: trouble using MallocDebug
- From: "Michael B. Johnson" <email@hidden>
- Date: Mon, 20 Sep 2004 13:32:38 -0700
ah - that makes perfect sense. I'm debugging an app that's using a
framework from elsewhere that redefines a symbol that I define already
(because this framework is evolving, and earlier versions did not
define this symbol). Since it's a string that actually evaluates to
the same thing, I haven't worried about it.
I'll fix that.
Also, though, since I much prefer to use Shark for performance analysis
(Shark ROCKS!), I'll take a look at the memory stuff there - I looked,
but didn't see anything.
What I'm trying to do is understand where memory is being allocated in
my app on a particular operation that calls into other folks libraries
as well as my own.
On Sep 20, 2004, at 1:13 PM, Dave Payne wrote:
On Sep 20, 2004, at 12:14 PM, "Michael B. Johnson" <email@hidden>
wrote:
Using XCode 1.5 on 10.3 on a dual G5.
I add /usr/lib/libMalloc.a (I also tried the dylib, same result), I
then do a clean rebuild (for luck!) and select Debug->Launch Using
Performance Tool->MallocDebug, which comes up and then I press Launch.
After a minute or two, I finally get an alert that says:
Read Data
Unable to read malloc information from
/Volumes/Data/wave/Developer/SharedBuildFolder/Foo.app
If I launch with anything else (say Object Alloc) it works fine.
But I really want to run MallocDebug. Anybody have any good ideas?
Hi Michael, that means it wasn't able to get the libMallocDebug
thread started in the target process. That could mean that the target
process requires the use of two-level namespace, which is needed if
two separate binary modules have symbols of the same name. For
example, if two plug-ins get loaded, each of which exports the same
API.
MallocDebug (as well as GuardMalloc -- libgmalloc) requires the use of
flat namespace, due to the way they override the standard malloc() in
Libsystem. MallocDebug sets the DYLD_FORCE_FLAT_NAMESPACE environment
variable before launching the target process. See 'man dyld' for more
info on that. If you set that environment variable manually on the
command line, are you able to launch your target process from the
command line?
Depending on what you're trying to do, there may be other solutions.
If you're trying to catch bad memory access problems, you could try
setting environment variable such as MallocGuardEdges on the standard
malloc (see 'man malloc' for more info). If you're trying to see
where memory is getting allocated, you could try the memory call
tracing features of Shark 4.0 beta (downloadable from
ftp://ftp.apple.com/developer/Tool_Chest/Testing_-_Debugging/
Performance_tools/ ) or of Sampler. To look for leaks, you can also
use the 'leaks' command line tool.
- Dave
--> Michael B. Johnson, PhD
--> http://homepage.mac.com/drwave (personal)
--> http://xenia.media.mit.edu/~wave (alum)
--> MPG Lead
--> Pixar Animation Studios
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden