Bug 55412 - Frequent crashes in CFURLCache code on Snow Leopard
Summary: Frequent crashes in CFURLCache code on Snow Leopard
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.6
: P1 Normal
Assignee: Alexey Proskuryakov
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2011-02-28 14:32 PST by Alexey Proskuryakov
Modified: 2015-04-28 10:48 PDT (History)
0 users

See Also:


Attachments
proposed fix (4.81 KB, patch)
2011-02-28 14:40 PST, Alexey Proskuryakov
mitz: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Proskuryakov 2011-02-28 14:32:22 PST
We're passing a wrong path when creating an NSURLCache, so it can't initialize an SQL database, and misbehaves.

<rdar://problem/9063922>
Comment 1 Alexey Proskuryakov 2011-02-28 14:40:30 PST
Created attachment 84125 [details]
proposed fix
Comment 2 mitz 2011-02-28 14:50:05 PST
Comment on attachment 84125 [details]
proposed fix

View in context: https://bugs.webkit.org/attachment.cgi?id=84125&action=review

> Source/WebKit2/ChangeLog:18
> +        like have liked trailing slash).

extra “like”

> Source/WebKit2/Shared/WebProcessCreationParameters.h:83
> +    // FIXME: These should not be merged with CFURLCache counterparts below.

not?

> Source/WebKit2/UIProcess/mac/WebContextMac.mm:85
> +    ASSERT(parameters.nsURLCachePath.data()[strlen(parameters.nsURLCachePath.data()) - 1] != '/'); // Necessary for NSURLCache to find the cache file.

Should we assert that strlen(…) is > 0 first?

> Source/WebKit2/UIProcess/win/WebContextWin.cpp:68
> +    if (parameters.cfURLCachePath[parameters.cfURLCachePath.length() - 1] == '/')

and here
Comment 3 Alexey Proskuryakov 2011-02-28 15:07:16 PST
Fixed in http://trac.webkit.org/changeset/79927.

Note that there is some controversy around whether it's really OK for CString length to not match strlen. But we already use strlen with -[NSFileManager stringWithFileSystemRepresentation:length:] elsewhere.