[cfe-dev] recent versions failing to catch omitted releases?

Ted Kremenek kremenek at apple.com
Mon May 18 13:51:34 PDT 2009


Hi Gary,

That check has been disabled for quite some time.  It was part of a  
larger set of checks (i.e., "missing -dealloc") that produced far too  
many false positives to be enabled by default.  The plan is to re-work  
those checks to produce far more acceptable results.

You are free to use these checks if you like.  To do so, see the  
options from 'scan-build -help':

AVAILABLE ANALYSES (multiple analyses may be specified):

  (+) -checker-cfref                       - Run the [Core] Foundation  
reference count checker
  (+) -warn-dead-stores                    - Warn about stores to dead  
variables
  (+) -warn-objc-methodsigs                - Warn about Objective-C  
method signatures with type incompatibilities
      -warn-objc-missing-dealloc           - Warn about Objective-C  
classes that lack a correct implementation of -dealloc
  (+) -warn-objc-unused-ivars              - Warn about private ivars  
that are never used


The ones with the (+) are those that are run if no specific check  
options are provided.  If you explicitly provide a check option,  
however, you must also explicitly provide the options of the other  
checks you want to run.  This may change in the future.

The option you are interested in is -warn-objc-missing-dealloc.


On May 17, 2009, at 11:21 AM, Gary Boone wrote:

>
> It seems like the last working version I have (0.195) no longer  
> catches release leaks. Here's how I test:
>
> 1. pick an synthesized instance variable, eg:
>
> 	GraphOverlayView	*selectionView;
> 	
> 	@property (nonatomic, retain)	GraphOverlayView	*selectionView;
>
> 	@synthesize	selectionView;
>
> In this object's dealloc, comment out the variable's release:
>
> 	- (void)dealloc {
> 	//	[selectionView release];
> 	}
>
> 2. If I build with an old version:
> 	xcodebuild clean; ~/development/checker-0.147/scan-build -k -V  
> xcodebuild
>
> the missing release is detected:
>
> 	missing ivar release (leak)
>
> 3. But if I build with a recent version (0.195)
> 	xcodebuild clean; ~/development/checker-0.195/scan-build -k -V  
> xcodebuild
>
> nothing is noted; there's no output that includes the missing release.
>
>
> Thanks,
> Gary
>
>
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20090518/b0c85c49/attachment.html>


More information about the cfe-dev mailing list