Bug 149083 - LayoutTestHelper crashes if a color profile isn't set for a 3rd party monitor
Summary: LayoutTestHelper crashes if a color profile isn't set for a 3rd party monitor
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Michael Saboff
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-11 16:58 PDT by Michael Saboff
Modified: 2015-09-11 17:16 PDT (History)
1 user (show)

See Also:


Attachments
Patch (1.83 KB, patch)
2015-09-11 17:02 PDT, Michael Saboff
ap: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Saboff 2015-09-11 16:58:36 PDT
You get a crash at
* thread #1: tid = 0x3bafd6, 0x00007fff8df47f26 CoreFoundation`CFDictionaryGetValue + 38, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
    frame #0: 0x00007fff8df47f26 CoreFoundation`CFDictionaryGetValue + 38
CoreFoundation`CFDictionaryGetValue:
->  0x7fff8df47f26 <+38>: movq   (%rbx), %rax
    0x7fff8df47f29 <+41>: testq  %rax, %rax
    0x7fff8df47f2c <+44>: je     0x7fff8df47f6e            ; <+110>
    0x7fff8df47f2e <+46>: leaq   -0x14889efd(%rip), %rcx   ; __CFConstantStringClassReferencePtr

bt
    frame #0: 0x00007fff8df47f26 CoreFoundation`CFDictionaryGetValue + 38
    frame #1: 0x000000010000152f LayoutTestHelper`main + 157 at LayoutTestHelper.m:73
    frame #1: 0x0000000100001492 LayoutTestHelper`main + 259 at LayoutTestHelper.m:123
    frame #2: 0x000000010000138f LayoutTestHelper`main [inlined] installLayoutTestColorProfile + 21 at LayoutTestHelper.m:167
    frame #3: 0x000000010000137a LayoutTestHelper`main(argc=<unavailable>, argv=<unavailable>) + 176 at LayoutTestHelper.m:256
    frame #4: 0x00007fff9a1bb5ad libdyld.dylib`start + 1

From LayoutTestHelper.m::static NSURL *colorProfileURLForDisplay(NSString *displayUUIDString):
66    CFURLRef profileURL;
67    CFDictionaryRef profileInfo = (CFDictionaryRef)CFDictionaryGetValue(deviceInfo, kColorSyncCustomProfiles);
68    if (profileInfo)
69        profileURL = (CFURLRef)CFDictionaryGetValue(profileInfo, CFSTR("1"));
70    else {
71        profileInfo = (CFDictionaryRef)CFDictionaryGetValue(deviceInfo, kColorSyncFactoryProfiles);
72        CFDictionaryRef factoryProfile = (CFDictionaryRef)CFDictionaryGetValue(profileInfo, CFSTR("1"));
73        profileURL = (CFURLRef)CFDictionaryGetValue(factoryProfile, kColorSyncDeviceProfileURL);
74    }
75    

It appears that factoryProfile can be nil.
Comment 1 Michael Saboff 2015-09-11 17:02:27 PDT
Created attachment 261034 [details]
Patch
Comment 2 Michael Saboff 2015-09-11 17:16:00 PDT
Committed r189639: <http://trac.webkit.org/changeset/189639>