• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
re: trouble using MallocDebug
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

re: trouble using MallocDebug


  • Subject: re: trouble using MallocDebug
  • From: Dave Payne <email@hidden>
  • Date: Mon, 20 Sep 2004 13:13:44 -0700

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
_______________________________________________
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


  • Follow-Ups:
    • Re: trouble using MallocDebug
      • From: "Michael B. Johnson" <email@hidden>
  • Prev by Date: Re: Viewing arrays in the debugger?
  • Next by Date: Re: trouble using MallocDebug
  • Previous by thread: Re: Need help viewing variables while debugging
  • Next by thread: Re: trouble using MallocDebug
  • Index(es):
    • Date
    • Thread