Subject: Re: bug#11541: 24.0.97; Crash when visiting file on OS X 10.7.3

From: Florian Ebeling <[email-masked]>
Date: Fri, 1 Jun 2012 07:43:57 +0200

>> So right after the crash the font_spec still looks like a legit lisp
>> object. Don't ask me why that was different before. The values here
>> and in other mails were copy-pasted, so that did happen.
>
> My guess is that the earlier attempts were made on an optimized build.

Heh, good guess. That's the case, indeed. I changed optimization when
gdb said some variable was optimized away. What I did was

rm nsfont.o
make CFLAGS='-O0 -ggdb'
make install

> Does the following simple test program crash for you (compile it with
> the option "-framework Cocoa") ?  If so, I'd suspect font cache
> corruption or other system-wide problems.

This program does not crash but outputs a lot of font description objects.

>
>                                     YAMAMOTO Mitsuharu
>                                [email-masked]
>
> #import <Cocoa/Cocoa.h>
>
> main ()
> {
>  NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
>  NSDictionary *attributes = [NSDictionary dictionary];
>  NSFontDescriptor *descriptor = [NSFontDescriptor fontDescriptorWithFontAttributes:attributes];
>  NSSet *keys = [NSSet set];
>  NSArray *descs = [descriptor matchingFontDescriptorsWithMandatoryKeys:keys];
>
>  CFShow (descs);
>  [pool release];
> }