• 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: XCode, gdb and "Timed out fetching data"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: XCode, gdb and "Timed out fetching data"


  • Subject: Re: XCode, gdb and "Timed out fetching data"
  • From: "William H. Schultz" <email@hidden>
  • Date: Fri, 23 Mar 2007 13:00:14 -0700

Check out "MallocScribble" and "MallocPreScribble." These environment variables will set default values when memory is allocated and freed--so you can tell based on the value whether it's uninitialized or freed memory. 0xaa for uninitialized an 0x55 for freed. ;)

In Xcode, edit the active executable and set the value of these to 1 in order to use them.

Off the top of my head, I don't know if this applies to memory on the stack (as it's a malloc thing), but it's useful nonetheless.


------------------------------- Hank Schultz Cedrus Corporation http://www.cedrus.com/


On Mar 22, 2007, at 7:47 AM, Laurence Harris wrote:


On Mar 22, 2007, at 10:24 AM, Sean McBride wrote:

On 3/21/07 10:55 AM, Jim Ingham said:

Not that I know of.  Not sure this is the best solution, however:
adding another way that debug builds run differently from optimized
builds doesn't seem desirable.

Yeah, I see your point. I guess I was thinking of it as an extra, like
guard malloc. If all stack variables were inited to 0, it would make
unintentional reliance on their initial value behave consistently.

It would, but initializing to 0 would actually give you exactly the behavior you want in many cases:


CObject	*object;
if ( condition )
{	object = new ...	}
delete object;

int	count;
[...]
return count;

Then as soon as you did a release build it could start falling down in a variety of places, and as Jim points out, when you tried to debug it you'd never see the problem.

If there were an option to auto-initialize stack variables in debug builds it should do so with something akin to 0xDEADBEEF.

Larry


Jim

On Mar 21, 2007, at 10:35 AM, Sean McBride wrote:

On 3/21/07 8:40 AM, Jim Ingham said:

One common cause of problems is trying to run the data formatters on
uninitialized objects. We don't actually have any way to tell for
sure when an object is good or not. We have some heuristics, but
stack objects sometimes point to the leftovers of another stack
object
that are "almost good enough" and fool us.

Is there any way for stack variables to be automatically initialised
to
zero (or something) when debugging? I believe Visual Studio allows
this. That might help.

-- ____________________________________________________________ Sean McBride, B. Eng email@hidden Rogue Research www.rogue-research.com Mac Software Developer Montréal, Québec, Canada


_______________________________________________ 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:
40cedrus.com


This email sent to email@hidden

Attachment: PGP.sig
Description: This is a digitally signed message part

 _______________________________________________
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: XCode, gdb and "Timed out fetching data"
      • From: "Sean McBride" <email@hidden>
References: 
 >XCode, gdb and "Timed out fetching data" (From: Scott F Bayes <email@hidden>)
 >Re: XCode, gdb and "Timed out fetching data" (From: Jim Ingham <email@hidden>)
 >Re: XCode, gdb and "Timed out fetching data" (From: "Sean McBride" <email@hidden>)
 >Re: XCode, gdb and "Timed out fetching data" (From: Jim Ingham <email@hidden>)
 >Re: XCode, gdb and "Timed out fetching data" (From: "Sean McBride" <email@hidden>)
 >Re: XCode, gdb and "Timed out fetching data" (From: Laurence Harris <email@hidden>)

  • Prev by Date: Re: Multiple Install Directory Paths
  • Next by Date: Re: XCode, gdb and "Timed out fetching data"
  • Previous by thread: Re: XCode, gdb and "Timed out fetching data"
  • Next by thread: Re: XCode, gdb and "Timed out fetching data"
  • Index(es):
    • Date
    • Thread