Re: The bug where terminal and xcode ran "different"
Re: The bug where terminal and xcode ran "different"
- Subject: Re: The bug where terminal and xcode ran "different"
- From: "Theodore H. Smith" <email@hidden>
- Date: Sat, 10 Feb 2007 21:49:46 +0000
On 10 Feb 2007, at 21:45, Theodore H. Smith wrote:
On 10 Feb 2007, at 21:37, Rick Altherr wrote:
On Feb 10, 2007, at 1:12 PM, Theodore H. Smith wrote:
I finally figured out the bug.
Xcode was using a different kind of malloc that would fill my
data with certain values that somehow allowed my code to work
properly.
Running my app from the terminal used a different version of
malloc that used some garbage values.
Obviously, this is an error in my app. A classic memory
management error :( Shame, I really hate those things. But they
are unavoidable when you are writing high performance stuff,
because in these cases you can't rely on vectors or other easy
stuff to "do the right thing", speedwise.
Anyhow, I did solve this problem. The answer to my question was
that Xcode was linking to a different version of malloc.
No bug in Xcode, just a bug in my code that the terminal
(strangely) was better at uncovering.
If you didn't zero out the memory you got from malloc(), then
expect it to always be some form of garbage.
Yeah that's right. I normally am pretty good with memorymanagement,
so I either zero or fill it with the correct values as I'm supposed
to, I never rely on it containing good values. But we are human
mistakes slip through occassionally no matter how knowledged we are.
_______________________________________________
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