Summary: | REGRESSION(r259034): access to null UniqueIDBDatabase in UniqueIDBDatabaseConnection::~UniqueIDBDatabaseConnection() | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Sihui Liu <sihui_liu> | ||||||
Component: | New Bugs | Assignee: | Sihui Liu <sihui_liu> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | achristensen, alecflett, beidson, cdumez, ews-watchlist, ggaren, jsbell, webkit-bug-importer | ||||||
Priority: | P2 | Keywords: | InRadar | ||||||
Version: | WebKit Nightly Build | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Attachments: |
|
Description
Sihui Liu
2020-03-26 13:30:00 PDT
Created attachment 394654 [details]
Patch
Comment on attachment 394654 [details]
Patch
It's not great for correctness to rely on destruction order. We don't have a smart reliable way to guarantee destruction order.
I think a better solution in this case would be to change UniqueIDBDatabaseConnection to hold a direct pointer to IDBServer. That way, there's no need to deference UniqueIDBDatabase in the destructor. Also, it would be good to change UniqueIDBDatabaseConnection::m_database to be a WeakPtr, for memory safety. (That way, a bug like this will be detectable even without guard malloc, and will not become a security bug.)
Created attachment 394662 [details]
Patch
Comment on attachment 394662 [details]
Patch
r=me
Committed r259090: <https://trac.webkit.org/changeset/259090> All reviewed patches have been landed. Closing bug and clearing flags on attachment 394662 [details]. |