WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 184382
REGRESSION(
r229929
): localStorage is broken for WebInspector
https://bugs.webkit.org/show_bug.cgi?id=184382
Summary
REGRESSION(r229929): localStorage is broken for WebInspector
Devin Rousso
Reported
2018-04-06 23:02:12 PDT
The following lines added in <
https://webkit.org/b/69138
> appear to have broken WebInspector's usage of `window.localStorage`: String SQLiteStatement::getColumnBlobAsString(int col) ...| 386| if (m_database.lastError() != SQLITE_OK) 387| return String(); ...| STEPS TO REPRODUCE: 1. Open WebInspector 2. Do anything that would be "saved" for the next load (e.g. move around tabs, change settings, modify sidebar sizes, toggle paint flashing, etc.) 3. Close WebInspector 4. Reopen WebInspector => Any changes previously made will no longer be there (e.g. tabs will be back in original order, settings will revert to default value, all sidebars will be back to default size, paint flashing is disabled, etc.) NOTES: The value of `m_database.lastErrorMessage()` seems to be "unknown error" throughout `getColumnBlobAsString` (this was determined by using `syslog(LOG_ERR, "%s", m_database.lastErrorMsg());`). In the case that `m_database.lastError() != SQLITE_OK`, `blob` isn't falsy and `getColumnBlobAsString` doesn't early return.
Attachments
Patch
(1.85 KB, patch)
2018-04-07 20:14 PDT
,
Sihui Liu
no flags
Details
Formatted Diff
Diff
Patch
(1.89 KB, patch)
2018-04-08 01:51 PDT
,
Sihui Liu
no flags
Details
Formatted Diff
Diff
Patch
(4.32 KB, patch)
2018-04-09 10:46 PDT
,
Sihui Liu
no flags
Details
Formatted Diff
Diff
Patch
(4.31 KB, patch)
2018-04-09 10:59 PDT
,
Sihui Liu
no flags
Details
Formatted Diff
Diff
Archive of layout-test-results from ews101 for mac-sierra
(2.28 MB, application/zip)
2018-04-09 12:04 PDT
,
EWS Watchlist
no flags
Details
Show Obsolete
(3)
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2018-04-06 23:04:03 PDT
<
rdar://problem/39257355
>
Sihui Liu
Comment 2
2018-04-07 20:14:05 PDT
Created
attachment 337439
[details]
Patch
Daniel Bates
Comment 3
2018-04-07 23:56:05 PDT
Comment on
attachment 337439
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=337439&action=review
> Source/WebCore/ChangeLog:15 > + No new tests, removed an insufficient judgement to fix regression.
Is it not possible to write a test for this?
Sihui Liu
Comment 4
2018-04-08 01:51:36 PDT
Created
attachment 337453
[details]
Patch
Joseph Pecoraro
Comment 5
2018-04-08 02:28:05 PDT
When is the error ever cleared? If there was an error before entering this method would it have been cleared?
Chris Dumez
Comment 6
2018-04-09 09:07:42 PDT
(In reply to Joseph Pecoraro from
comment #5
)
> When is the error ever cleared? If there was an error before entering this > method would it have been cleared?
From the doc [1]: """ If the most recent sqlite3_* API call associated with database connection D failed, then the sqlite3_errcode(D) interface returns the numeric result code or extended result code for that API call. If the most recent API call was successful, then the return value from sqlite3_errcode() is undefined. """ So my understanding is: - If the call to sqlite3_column_blob() failed, sqlite3_errcode() will return a valid error code. - If the call to sqlite3_column_blob() succeeded, sqlite3_errcode() may return whatever. Unfortunately, it does not look like there is a good way to check if the call to sqlite3_column_blob() failed. This is because as per [2] sqlite3_column_blob() can return NULL due to: - An error - The blob has zero length [1]
https://www.sqlite.org/c3ref/errcode.html
[2]
https://www.sqlite.org/c3ref/column_blob.html
Chris Dumez
Comment 7
2018-04-09 09:08:38 PDT
Comment on
attachment 337453
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=337453&action=review
> Source/WebCore/platform/sql/SQLiteStatement.cpp:388 > + if (!(error == SQLITE_OK || error == SQLITE_ROW || error == SQLITE_DONE))
As per the doc, "If the most recent API call was successful, then the return value from sqlite3_errcode() is undefined." Therefore, I do not think this patch is correct.
Sihui Liu
Comment 8
2018-04-09 10:46:57 PDT
Created
attachment 337507
[details]
Patch
Sihui Liu
Comment 9
2018-04-09 10:59:32 PDT
Created
attachment 337510
[details]
Patch
EWS Watchlist
Comment 10
2018-04-09 12:04:09 PDT
Comment on
attachment 337510
[details]
Patch
Attachment 337510
[details]
did not pass mac-ews (mac): Output:
http://webkit-queues.webkit.org/results/7255578
New failing tests: imported/w3c/web-platform-tests/workers/name-property.html
EWS Watchlist
Comment 11
2018-04-09 12:04:11 PDT
Created
attachment 337518
[details]
Archive of layout-test-results from ews101 for mac-sierra The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews101 Port: mac-sierra Platform: Mac OS X 10.12.6
Chris Dumez
Comment 12
2018-04-09 16:51:25 PDT
Comment on
attachment 337510
[details]
Patch failure is unrelated.
WebKit Commit Bot
Comment 13
2018-04-09 17:17:54 PDT
Comment on
attachment 337510
[details]
Patch Clearing flags on attachment: 337510 Committed
r230456
: <
https://trac.webkit.org/changeset/230456
>
WebKit Commit Bot
Comment 14
2018-04-09 17:17:56 PDT
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug