Bug 69386

Summary: REGRESSION: Curious Location of StorageTracker.db
Product: WebKit Reporter: Martin Stricker <martin.stricker>
Component: WebKit Misc.Assignee: David Kilzer (:ddkilzer) <ddkilzer>
Status: RESOLVED FIXED    
Severity: Normal CC: adauria, amaral, ap, beidson, ddkilzer
Priority: P1 Keywords: InRadar, Regression
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.6   
Attachments:
Description Flags
Patch
none
Now with more thread-safe\! ap: review+

Martin Stricker
Reported 2011-10-04 16:55:30 PDT
WebKit Version 5.1 (6534.50, r96515) Since a few days, WebKit on Mac 10.6.8 creates StorageTracker.db at '/~/Library/Safari/LocalStorage/StorageTracker.db' (directory literally named "~" at root). Also, extensions like Adblock reinstall on each browser startup.
Attachments
Patch (2.01 KB, patch)
2011-10-05 13:46 PDT, David Kilzer (:ddkilzer)
no flags
Now with more thread-safe\! (2.90 KB, patch)
2011-10-05 14:22 PDT, David Kilzer (:ddkilzer)
ap: review+
Martin Stricker
Comment 1 2011-10-04 17:06:26 PDT
This only happens when extensions like Adblock (http://safariadblock.com) are used.
Alexey Proskuryakov
Comment 2 2011-10-04 21:45:34 PDT
Alexey Proskuryakov
Comment 3 2011-10-04 21:47:51 PDT
<http://trac.webkit.org/changeset/96255> is a suspicious change.
José Pedro Sousa do Amaral
Comment 4 2011-10-05 09:13:36 PDT
I can confirm this bug. In my case, it does not seem to be caused by AdBlock, for I disabled AdBlock and the bug persisted. However when I disabled _all_ extensions, the misplaced StorageTracker.db was no longer created. 5.1 (6534.50, r96636)
David Kilzer (:ddkilzer)
Comment 5 2011-10-05 13:46:09 PDT
Alexey Proskuryakov
Comment 6 2011-10-05 13:51:15 PDT
Comment on attachment 109853 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=109853&action=review > Source/WebKit/mac/Storage/WebStorageManager.mm:93 > static NSString *sLocalStoragePath; Is this code only ever running on main thread? > Source/WebKit/mac/Storage/WebStorageManager.mm:98 > NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; I wonder why it's reading defaults every time, not just on initialization. > Source/WebKit/mac/Storage/WebStorageManager.mm:105 > + sLocalStoragePath = [[sLocalStoragePath stringByStandardizingPath] retain]; This code will retain each time, but the function is not a "copy" one.
Alexey Proskuryakov
Comment 7 2011-10-05 13:57:11 PDT
Comment on attachment 109853 [details] Patch My bad. I didn't notice the early return (we usually use a different pattern in WebCore, something like static NSString *sLocalStoragePath = calculateStoragePath();
David Kilzer (:ddkilzer)
Comment 8 2011-10-05 14:22:33 PDT
Created attachment 109862 [details] Now with more thread-safe\!
Alexey Proskuryakov
Comment 9 2011-10-05 14:25:44 PDT
Comment on attachment 109862 [details] Now with more thread-safe\! View in context: https://bugs.webkit.org/attachment.cgi?id=109862&action=review I don't know if thread safety is a real issue for this function, but the patch looks good. > Source/WebKit/mac/Storage/WebStorageManager.mm:35 > +#import <pthread.h> > #import <WebCore/SecurityOrigin.h> > #import <WebCore/StorageTracker.h> Alphabetically, upper case comes first.
David Kilzer (:ddkilzer)
Comment 10 2011-10-05 14:39:21 PDT
Note You need to log in before you can comment on or make changes to this bug.