Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: f6305e2e3567e25d0565bf39f66c00433c3252a0
      
https://github.com/WebKit/WebKit/commit/f6305e2e3567e25d0565bf39f66c00433c3252a0
  Author: Chris Dumez <[email protected]>
  Date:   2024-02-17 (Sat, 17 Feb 2024)

  Changed paths:
    M Source/WebCore/platform/sql/SQLiteDatabase.h
    M Source/WebCore/platform/sql/SQLiteStatement.h
    M Source/WebCore/platform/sql/SQLiteTransaction.h
    M Source/WebKit/NetworkProcess/storage/SQLiteStorageArea.cpp

  Log Message:
  -----------
  Crash under SQLiteDatabase::~SQLiteDatabase
https://bugs.webkit.org/show_bug.cgi?id=269648
rdar://123160407

Reviewed by David Kilzer.

The crash was occurring because 
SQLiteStorageArea::handleDatabaseCorruptionIfNeeded()
was destroying the SQLiteDatabase object (m_database) but was failing to 
destroy the
potential transaction (m_transaction) and cached statements 
(m_cachedStatements), all
of which have a CheckedRef pointing to the database.

Update handleDatabaseCorruptionIfNeeded() to call close(), which clears m_cache,
m_cacheSize, m_transaction, m_cachedStatements and m_database.

Also update SQLiteStatement / SQLiteTransaction to keep a WeakRef to the 
database
instead of a CheckedRef, as per our updated smart pointer guidelines. Using
CheckedPtr/CheckedRef for database members is no longer recommended.

* Source/WebCore/platform/sql/SQLiteDatabase.h:
* Source/WebCore/platform/sql/SQLiteStatement.h:
* Source/WebCore/platform/sql/SQLiteTransaction.h:
* Source/WebKit/NetworkProcess/storage/SQLiteStorageArea.cpp:
(WebKit::SQLiteStorageArea::handleDatabaseCorruptionIfNeeded):

Canonical link: https://commits.webkit.org/274937@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to