[Webkit-unassigned] [Bug 196519] New: [iOS] Web process gets suspended while holding locked database files

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Apr 2 17:22:25 PDT 2019


https://bugs.webkit.org/show_bug.cgi?id=196519

            Bug ID: 196519
           Summary: [iOS] Web process gets suspended while holding locked
                    database files
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: New Bugs
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: sihui_liu at apple.com

Web process will take process assertion for database close after <https://trac.webkit.org/changeset/242983>, but we find there is a race between web process sending "do no suspend me" message and web process actually gets suspended. The example crash trace is:

Termination Description: ASSERTIOND, com.apple.WebKi:1834 was suspended with locked system files:

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libsystem_kernel.dylib              0x00000001ee68b93c kevent_id + 8
1   libdispatch.dylib                   0x00000001ee4ebbf0 _dispatch_kq_poll + 332 (/BuildRoot/Library/Caches/com.apple.xbs/Sources/libdispatch/libdispatch-1008.250.7/src/event/event_kevent.c:718)
2   libdispatch.dylib                   0x00000001ee4eb114 _dispatch_event_loop_poke$VARIANT$mp + 476 (/BuildRoot/Library/Caches/com.apple.xbs/Sources/libdispatch/libdispatch-1008.250.7/src/event/event_kevent.c:1644)
3   JavaScriptCore                      0x00000001f660014c WTF::WorkQueue::dispatch(WTF::Function<void ()>&&) + 140 (/BuildRoot/Library/Caches/com.apple.xbs/Sources/WTF/WTF-7607.2.3/wtf/cocoa/WorkQueueCocoa.cpp:36)
4   WebKit                              0x00000001fe969208 IPC::Connection::sendMessage(std::__1::unique_ptr<IPC::Encoder, std::__1::default_delete<IPC::Encoder> >, WTF::OptionSet<IPC::SendOption>) + 292 (/BuildRoot/Library/Caches/com.apple.xbs/Sources/WebKit2/WebKit2-7607.2.3/Platform/IPC/Connection.cpp:434)
5   WebKit                              0x00000001fea698b8 bool IPC::Connection::send<Messages::WebProcessProxy::SetIsHoldingLockedFiles>(Messages::WebProcessProxy::SetIsHoldingLockedFiles&&, unsigned long long, WTF::OptionSet<IPC::SendOption>) + 112 (/BuildRoot/Library/Caches/com.apple.xbs/Sources/WebKit2/WebKit2-7607.2.3/Platform/IPC/Connection.h:411)
6   WebKit                              0x00000001fea69814 WebKit::WebSQLiteDatabaseTracker::hysteresisUpdated(PAL::HysteresisState) + 64 (/BuildRoot/Library/Caches/com.apple.xbs/Sources/WebKit2/WebKit2-7607.2.3/Shared/WebSQLiteDatabaseTracker.cpp:73)

Thread 8 name:  WebCore: Database
Thread 8:
0   libsystem_kernel.dylib              0x00000001ee68b7f8 guarded_close_np + 8
1   libsqlite3.dylib                    0x00000001eef9cd38 unixShmPurge + 568 (/BuildRoot/Library/Caches/com.apple.xbs/Sources/SQLite/SQLite-274.22/derived_source/sqlite3.c:34950)
2   libsqlite3.dylib                    0x00000001eef97af4 unixShmUnmap + 356 (/BuildRoot/Library/Caches/com.apple.xbs/Sources/SQLite/SQLite-274.22/derived_source/sqlite3.c:40100)
3   libsqlite3.dylib                    0x00000001eef577d4 sqlite3WalClose + 644 (/BuildRoot/Library/Caches/com.apple.xbs/Sources/SQLite/SQLite-274.22/derived_source/sqlite3.c:22063)
4   libsqlite3.dylib                    0x00000001eef57338 sqlite3PagerClose + 320 (/BuildRoot/Library/Caches/com.apple.xbs/Sources/SQLite/SQLite-274.22/derived_source/sqlite3.c:60327)
5   libsqlite3.dylib                    0x00000001eef56cb4 sqlite3BtreeClose + 368 (/BuildRoot/Library/Caches/com.apple.xbs/Sources/SQLite/SQLite-274.22/derived_source/sqlite3.c:70983)
6   libsqlite3.dylib                    0x00000001eef7bcd0 sqlite3LeaveMutexAndCloseZombie + 256 (/BuildRoot/Library/Caches/com.apple.xbs/Sources/SQLite/SQLite-274.22/derived_source/sqlite3.c:154776)
7   libsqlite3.dylib                    0x00000001eef8485c sqlite3Close + 688 (/BuildRoot/Library/Caches/com.apple.xbs/Sources/SQLite/SQLite-274.22/derived_source/sqlite3.c:154711)
8   WebCore                             0x00000001f9021afc WebCore::SQLiteDatabase::close() + 260 (./platform/sql/SQLiteDatabase.cpp:152)
9   WebCore                             0x00000001f86ad2b0 WebCore::Database::closeDatabase() + 40 (./Modules/webdatabase/Database.cpp:442)
10  WebCore                             0x00000001f86ad21c WebCore::Database::performClose() + 264 (./Modules/webdatabase/Database.cpp:306)
11  WebCore                             0x00000001f86b6248 WebCore::DatabaseThread::databaseThread() + 432 (./Modules/webdatabase/DatabaseThread.cpp:121)

We see web process crashed while it is sending the SetIsHoldingLockedFiles message on the main thread.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20190403/fa5d384d/attachment-0001.html>


More information about the webkit-unassigned mailing list