Bug 232986 - [RemoteInspector][Socket] Can't find the target since r277787
Summary: [RemoteInspector][Socket] Can't find the target since r277787
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tomoki Imai
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-11-11 00:21 PST by Tomoki Imai
Modified: 2021-11-11 18:28 PST (History)
9 users (show)

See Also:


Attachments
patch (1.59 KB, patch)
2021-11-11 00:28 PST, Tomoki Imai
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tomoki Imai 2021-11-11 00:21:51 PST
How to reproduce:

- Launch MiniBrowser on the target
- Launch MiniBrowser on the host (WinCairo)
- Try to connect to the target by inspector://.


Expected result:

- The target should be listed.

Actual result:

- "No targets found" message is shown.

This issue is same as bug 226908. r277787 changed WebURLSchemeTask::request()'s return type and caused the issue.
Comment 1 Tomoki Imai 2021-11-11 00:28:09 PST
Created attachment 443918 [details]
patch

Patch to fix the issue in the same way as r278748.
Comment 2 EWS 2021-11-11 11:06:05 PST
Committed r285641 (244142@main): <https://commits.webkit.org/244142@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 443918 [details].
Comment 3 Radar WebKit Bug Importer 2021-11-11 11:07:49 PST
<rdar://problem/85307053>
Comment 4 Alexey Proskuryakov 2021-11-11 11:53:03 PST
Comment on attachment 443918 [details]
patch

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

> Source/WebKit/ChangeLog:9
> +        Remote Inspector has the same issue as bug 226908.
> +        RemoteInspectorProtocolHandler needs the same fix as r278748.

I haven't seen that patch at the time, but I don't see how either of the fixes is correct. Could you please clarify?
Comment 5 Tomoki Imai 2021-11-11 18:28:55 PST
(In reply to Alexey Proskuryakov from comment #4)
> Comment on attachment 443918 [details]
> patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=443918&action=review
> 
> > Source/WebKit/ChangeLog:9
> > +        Remote Inspector has the same issue as bug 226908.
> > +        RemoteInspectorProtocolHandler needs the same fix as r278748.
> 
> I haven't seen that patch at the time, but I don't see how either of the
> fixes is correct. Could you please clarify?

Sure, sorry for not explaining in this bugzilla.

(quoted from bug 226908 comment 1)
> r277787 (Bug 226001) changed the return type of 
> WebURLSchemeTask::request() 
> from const WebCore::ResourceRequest& to WebCore::ResourceRequest.
> InspectorResourceURLSchemeHandler::platformStartTask shouldn't
> hold the reference of temporary object.

Currently, task.request() creates a temporal ResourceRequest, which is destructed immediately after "auto& requestURL = task.request().url();".
ResourceRequest.url() returns the reference of ResourceRequest.m_url, so it's also destructed immediately too.
Therefore requestURL becomes a invalid reference to destructed object, which should not be happened. (In this case, it's recognized as null URL.)

So we changed "auto&" to "auto" to copy the temporal URL.