• 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: Debugging: do CFZombieLevel and objc_exception_throw() work for you?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Debugging: do CFZombieLevel and objc_exception_throw() work for you?


  • Subject: Re: Debugging: do CFZombieLevel and objc_exception_throw() work for you?
  • From: "Sean McBride" <email@hidden>
  • Date: Tue, 11 Jul 2006 17:15:05 -0400
  • Organization: Rogue Research

On 2006-07-12 07:07, Chris Suter said:

>> I tried the same thing with an NSString, and with CFZombieLevel (1,
>> 19, 5, and a few other values based on the tech note), and all I
>> got were bad access exceptions.
>
>Just thought I'd point out that I think the numbers you used don't
>look quite right. The tech. note doesn't define what 5 would do; the
>table in the note uses bit numbers. From my understanding of the
>note, you'll get a crash for most settings of CFZombieLevel except
>for 8 (never free memory used to hold CF objects) and under certain
>circumstances 2 (when scribbling deallocated CF memory, don't
>scirbble object  header (CFRuntimeBase)). I guess you'll get similar
>results to NSZombieEnabled by setting CFZombieLevel to 9 (although
>obviously you'll get a crash rather than an exception thrown, but
>that's just as good).

Ah, you're right!  I think Scott's values were just no good.

Without CFZombieLevel, both these print twice:

	NSString*		str = [[NSString alloc] initWithFormat:@"hello"];
	NSLog (@"%@", str);
	[str release];
	NSLog (@"%@", str);

	CFStringRef		str = CFStringCreateWithFormat(0,0,CFSTR("hello"));
	CFShow(str);
	CFRelease(str);
	CFShow(str);

With CFZombieLevel=65553 both crash on the 2nd print attempt.

So all is well.

--
____________________________________________________________
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.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Debugging: do CFZombieLevel and objc_exception_throw() work for you?
      • From: Scott Ellsworth <email@hidden>
References: 
 >Debugging: do CFZombieLevel and objc_exception_throw() work for you? (From: Scott Ellsworth <email@hidden>)
 >Re: Debugging: do CFZombieLevel and objc_exception_throw() work for you? (From: Chris Suter <email@hidden>)

  • Prev by Date: Re: Debugging: do CFZombieLevel and objc_exception_throw() work for you?
  • Next by Date: list of invar names
  • Previous by thread: Re: Debugging: do CFZombieLevel and objc_exception_throw() work for you?
  • Next by thread: Re: Debugging: do CFZombieLevel and objc_exception_throw() work for you?
  • Index(es):
    • Date
    • Thread