Summary: | IndexedDB Index Corruption after upgrade from iOS 13 to iOS 14 | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Darryl Pogue <dvpdiner2> | ||||||||||
Component: | New Bugs | Assignee: | Sihui Liu <sihui_liu> | ||||||||||
Status: | RESOLVED FIXED | ||||||||||||
Severity: | Critical | CC: | alecflett, beidson, darin, ews-watchlist, jsbell, niklasmerz, sihui_liu, simon.fraser, tim.brust, webkit-bug-importer | ||||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||||
Version: | Safari 14 | ||||||||||||
Hardware: | iPhone / iPad | ||||||||||||
OS: | Other | ||||||||||||
Attachments: |
|
Description
Darryl Pogue
2020-09-24 22:57:02 PDT
Thanks for reporting! This is pretty bad since the corrupted records cannot be recovered. Created attachment 409726 [details]
Testcase file
Here's a testcase file which can be used to demonstrate the problem.
I ran this in an iOS simulator on iOS 13.5 and opened it in Safari, then used `xcrun simctl upgrade` to upgrade the simulator to iOS 14.0 and opened it again. Looking at it with the Safari Inspector shows that one of the indexes is now missing.
Created attachment 409900 [details]
Patch
Created attachment 409924 [details]
Patch
Comment on attachment 409924 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=409924&action=review > Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:242 > +static String indexInfoTableSchema(const String& tableName) This argument should be ASCIILiteral or const char*, not const String&. It’s wastefully inefficient to turn an ASCII literal into a String and then destroy that string. I tested this patch in both Safari and in my WKWebView-based app on the iOS simulator, and the corruption was fixed in both cases. Thanks Sihui for jumping on this! :) Created attachment 409928 [details]
Patch
(In reply to Darin Adler from comment #6) > Comment on attachment 409924 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=409924&action=review > > > Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:242 > > +static String indexInfoTableSchema(const String& tableName) > > This argument should be ASCIILiteral or const char*, not const String&. It’s > wastefully inefficient to turn an ASCII literal into a String and then > destroy that string. Right, changed to use ASCIILiteral. Committed r267753: <https://trac.webkit.org/changeset/267753> All reviewed patches have been landed. Closing bug and clearing flags on attachment 409928 [details]. |