Re: GuardMalloc not working, Xcode 4
Re: GuardMalloc not working, Xcode 4
- Subject: Re: GuardMalloc not working, Xcode 4
- From: Dave Payne <email@hidden>
- Date: Mon, 21 Mar 2011 10:58:53 -0700
Hi Shamyl, the way a process gets run with GuardMalloc is to launch it with the DYLD_INSERT_LIBRARIES environment variable set to /usr/lib/libgmalloc.dylib (see the libgmalloc man page for further info).
Perhaps that environment variable is getting set to a space character (' ') or something like that. I was able to manually produce an error message that looked like what you see by doing (in tcsh):
> % setenv DYLD_INSERT_LIBRARIES " "
> % ls
> dyld: could not load inserted library:
>
> Trace/BPT trap
How are you enabling GuardMalloc for your project? The standard way in Xcode 4 is:
1) edit your scheme
2) click on the Run action in the list on the left
3) click on the Diagnostics tab
4) check the "Enable Guard Malloc" check box
Look in the Arguments tab to see if there is a DYLD_INSERT_LIBRARIES setting in there, setting it to something other than /usr/lib/libgmalloc.dylib.
FYI, you can check what environment variables a process is running with by doing 'ps alxwwe | grep <appName>'. Alas that won't work for you since your process is crashing on launch. :-(
Dave
On Mar 20, 2011, at 6:15 PM, Shamyl Zakariya wrote:
> I have a project (C++, 32-bit) which is crashing in a manner that smells like a memory smasher, so I gave a stab at running it under GuardMalloc, which I've done plenty of times in the past.
>
> Trouble is, I can't run my binary with GM. I get this error on the log:
>
> dyld: could not load inserted library:
>
> But no listing of what the missing library is. Now, I tried making a new, simple c++ command line app and running it under guard malloc and it worked as expected. So I know guard malloc works in Xcode 4.
>
> This project happens to have originally been an Xcode 3 project, so perhaps there's something going on there? Some odd inherited setting screwing things up? Does anybody have any suggestions? I'm not looking forward to fixing this bug without guard malloc.
>
> Thanks,
>
> --
> shamyl zakariya
> so much for pathos
>
> _______________________________________________
> 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
_______________________________________________
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