Regression in clang. Crash when compiling simple objc file


I encounter a annoying segfault in clang when compiling simple obj-c file. This error only 1 or 2 week old.

I managed to create a simple test case:

clang --version

clang version 1.1 (trunk 93721)
Target: x86_64-apple-darwin10
Thread model: posix

This is a Release-Assert build compiled using llvm-gcc-4.2 from Xcode 3.2.1.

-------------------------------- Track.m --------------------------------

// clang -arch i386 -O0 -gdwarf-2 -c Track.m

#import <Cocoa/Cocoa.h>

@interface SATrack : NSObject {


  • (CGSize)size;

  • (id)valueForAttribute:(NSString *)anAttribute;


@implementation SATrack

  • (CGSize)size {
    NSValue *s = [self valueForAttribute:@“sapphire.aperture.clean”];
    if (!s)
    s = [self valueForAttribute:@“sapphire.track.size”];
    if (s)
    return NSSizeToCGSize([s sizeValue]);
    return CGSizeZero;

  • (id)valueForAttribute:(NSString *)anAttribute {
    return nil;


I forget to mention that it occurs only when I pass -gdwarf-2.

Hi Jean-Daniel,

Thanks for reporting this. Could you file a Bugzilla report? That way we don’t lose track of this issue.


Done. #6077