Bug 193688 - IndexedDB: leak WebIDBConnectionToServer in layout tests
Summary: IndexedDB: leak WebIDBConnectionToServer in layout tests
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Sihui Liu
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-01-22 14:56 PST by Sihui Liu
Modified: 2019-02-04 10:51 PST (History)
9 users (show)

See Also:


Attachments
Patch (5.48 KB, patch)
2019-01-22 14:59 PST, Sihui Liu
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews104 for mac-highsierra-wk2 (2.77 MB, application/zip)
2019-01-22 16:04 PST, EWS Watchlist
no flags Details
Archive of layout-test-results from ews126 for ios-simulator-wk2 (2.59 MB, application/zip)
2019-01-22 17:05 PST, EWS Watchlist
no flags Details
Patch (7.91 KB, patch)
2019-01-23 13:15 PST, Sihui Liu
no flags Details | Formatted Diff | Diff
Patch (8.30 KB, patch)
2019-02-01 10:36 PST, Sihui Liu
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sihui Liu 2019-01-22 14:56:08 PST
WebIDBConnectionToServer and IDBConnectionToServer ref each other and never get destroyed.
Comment 1 Sihui Liu 2019-01-22 14:59:48 PST
Created attachment 359781 [details]
Patch
Comment 2 Sihui Liu 2019-01-22 15:00:30 PST
<rdar://problem/47353263>
Comment 3 Geoffrey Garen 2019-01-22 15:33:13 PST
Comment on attachment 359781 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=359781&action=review

r=me

> Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.h:149
> +    WeakPtr<IDBConnectionToServerDelegate> m_delegate;

What is the consequence when this pointer becomes null? Is that OK?
Comment 4 EWS Watchlist 2019-01-22 16:04:50 PST
Comment on attachment 359781 [details]
Patch

Attachment 359781 [details] did not pass mac-wk2-ews (mac-wk2):
Output: https://webkit-queues.webkit.org/results/10846166

New failing tests:
http/tests/websocket/tests/hybi/no-subprotocol.html
Comment 5 EWS Watchlist 2019-01-22 16:04:51 PST
Created attachment 359796 [details]
Archive of layout-test-results from ews104 for mac-highsierra-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews104  Port: mac-highsierra-wk2  Platform: Mac OS X 10.13.6
Comment 6 EWS Watchlist 2019-01-22 17:05:41 PST
Comment on attachment 359781 [details]
Patch

Attachment 359781 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: https://webkit-queues.webkit.org/results/10846668

New failing tests:
http/tests/websocket/tests/hybi/no-subprotocol.html
Comment 7 EWS Watchlist 2019-01-22 17:05:42 PST
Created attachment 359814 [details]
Archive of layout-test-results from ews126 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews126  Port: ios-simulator-wk2  Platform: Mac OS X 10.13.6
Comment 8 Sihui Liu 2019-01-23 13:15:51 PST
Created attachment 359936 [details]
Patch
Comment 9 Sihui Liu 2019-01-23 17:10:04 PST
(In reply to Geoffrey Garen from comment #3)
> Comment on attachment 359781 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=359781&action=review
> 
> r=me
> 
> > Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.h:149
> > +    WeakPtr<IDBConnectionToServerDelegate> m_delegate;
> 
> What is the consequence when this pointer becomes null? Is that OK?

If m_delegate is null, it means NetworkProcessConnection derefs WebIDBConnectionToServer and WebIDBConnectionToServer goes away. 

Before NetworkProcessConnection clears the ref to WebIDBConnectionToServer, it calls connectionToServerLost on IDBConnectionToServer and sets m_serverConnectionIsValid to true. If m_serverConnectionIsValid is true, m_delegate won't be used.

So if m_delegate is null, it will not be called.
Comment 10 Sihui Liu 2019-02-01 10:36:21 PST
Created attachment 360872 [details]
Patch
Comment 11 Geoffrey Garen 2019-02-01 13:15:37 PST
Comment on attachment 360872 [details]
Patch

r=me
Comment 12 WebKit Commit Bot 2019-02-04 10:51:26 PST
Comment on attachment 360872 [details]
Patch

Clearing flags on attachment: 360872

Committed r240931: <https://trac.webkit.org/changeset/240931>
Comment 13 WebKit Commit Bot 2019-02-04 10:51:27 PST
All reviewed patches have been landed.  Closing bug.