Bug 195890 - [iOS] The network process sometimes gets killed for trying to suspend while holding locked files
Summary: [iOS] The network process sometimes gets killed for trying to suspend while h...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-03-18 09:10 PDT by Chris Dumez
Modified: 2019-03-18 11:27 PDT (History)
6 users (show)

See Also:


Attachments
Patch (2.45 KB, patch)
2019-03-18 09:13 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2019-03-18 09:10:26 PDT
The network process sometimes gets killed for trying to suspend while holding locked files:
14  libsqlite3.dylib              	0x00000001e06ecd9c sqlite3LockAndPrepare + 1024 (sqlite3.c:129700)
15  WebCore                       	0x00000001e6588840 WebCore::SQLiteStatement::prepare() + 176 (SQLiteStatement.cpp:74)
16  WebCore                       	0x00000001e65855e4 WebCore::SQLiteDatabase::open(WTF::String const&, bool) + 716 (SQLiteStatement.h:56)
17  WebKit                        	0x00000001d8954478 WTF::Function<void ()>::CallableWrapper<WebKit::NetworkHTTPSUpgradeChecker::NetworkHTTPSUpgradeChecker()::$_14>::call() + 92 (NetworkHTTPSUpgradeChecker.cpp:71)
18  JavaScriptCore                	0x00000001e3eb5bc8 WTF::BlockPtr<void ()> WTF::BlockPtr<void ()>::fromCallable<WTF::WorkQueue::dispatch(WTF::Function<void ()>&&)::$_0>(WTF::WorkQueue::dispatch(WTF::Function<void ()>&&)::$_0)::'lambda'(void*)::__invoke(void*) + 32 (Function.h:56)

The SQLiteDatabaseTracker normally keeps tracking of "transactions" in progress so we know that we're holding locked files and the WebSQLiteDatabaseTracker takes care of notifying the UIProcess via IPC that it should hold a background assertion on our behalf to avoid trying to suspend while holding locked files.
However, we were missing a SQLiteTransactionInProgressAutoCounter when trying to execute the PRAGMA statement.

Note that we have a similar SQLiteTransactionInProgressAutoCounter in SQLiteDatabase::useWALJournalMode() when executing such PRAGMA statement already.
Comment 1 Chris Dumez 2019-03-18 09:10:39 PDT
<rdar://problem/48934338>
Comment 2 Chris Dumez 2019-03-18 09:13:44 PDT
Created attachment 365019 [details]
Patch
Comment 3 Geoffrey Garen 2019-03-18 10:29:42 PDT
Comment on attachment 365019 [details]
Patch

r=me
Comment 4 WebKit Commit Bot 2019-03-18 11:27:47 PDT
Comment on attachment 365019 [details]
Patch

Clearing flags on attachment: 365019

Committed r243085: <https://trac.webkit.org/changeset/243085>
Comment 5 WebKit Commit Bot 2019-03-18 11:27:49 PDT
All reviewed patches have been landed.  Closing bug.