Bug 265304

Summary: [GTK/WPE] Web Inspector: crash in remote web inspector when connection closed during data transfer
Product: WebKit Reporter: Przemyslaw Gorszkowski <pgorszkowski>
Component: New BugsAssignee: Przemyslaw Gorszkowski <pgorszkowski>
Status: RESOLVED FIXED    
Severity: Normal CC: vidavera, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Other   
OS: Linux   

Description Przemyslaw Gorszkowski 2023-11-24 05:11:27 PST
The problem originally reported for WPE: https://github.com/WebPlatformForEmbedded/WPEWebKit/issues/1220:

Steps to reproduce:

1. Run WPE-WebKit-based browser with remote web inspector (RWI) enabled
2. Navigate to URL: https://scony.github.io/stb-lab/console-spam/index.html
3. Connect to RWI and make sure console logs are spamming to console
4. Close RWI connection (I'm basically closing the tab of the chrome browser where I connect to RWI from)
5. If no WPEWebKit-based browser crash is seen, go to step 3)


The crash can be also reproduced on latest main with remote web inspector(http/inspector) run from chrome/epiphany/webkitgtk
Comment 1 Przemyslaw Gorszkowski 2023-11-24 05:25:03 PST
It seems that after closing remote web inspector connection it is possible that some of messages can be still sent from WebProcess to UIProcess and in RemoteInspectorServer::sendMessageToFrontend there can be a crash because of missing socketConnection which was removed by previous closing remote web inspector connection(RemoteInspectorServer::close)
Comment 2 Przemyslaw Gorszkowski 2023-11-24 05:38:25 PST
Pull request: https://github.com/WebKit/WebKit/pull/20868
Comment 3 EWS 2023-11-24 07:23:13 PST
Committed 271097@main (5cf2af8221b3): <https://commits.webkit.org/271097@main>

Reviewed commits have been landed. Closing PR #20868 and removing active labels.
Comment 4 Radar WebKit Bug Importer 2023-11-24 07:24:20 PST
<rdar://problem/118773014>