New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 829218 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner: ----
Closed: Apr 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Chrome , Mac
Pri: 2
Type: Bug



Sign in to add a comment

DCHECK when changing destination in Print Preview

Project Member Reported by rbpotter@chromium.org, Apr 5 2018

Issue description

Chrome Version: 67.0.3389.0, developer build.
OS: tested on Linux but this likely impacts all desktop OSes.

What steps will reproduce the problem?
(1) Run with DCHECKs on.
(2) Open print preview on any page (ctrl + P)
(3) Click "change" button to change destination

What is the expected result?
Print Preview destination change dialog opens and displays list of printers

What happens instead?
Browser crashes with a DCHECK: FATAL:web_request_permissions.cc(96) Check failed: !is_network_request || !is_request_from_webui_renderer. Unsupported network request from WebUI for https://www.google.com/cloudprint/search?xsrf=&connection_status=ALL&client=chrome&use_cdd=true&q=%5Erecent

Stack trace pasted at bottom of description.

This was working until very recently. It appears that the DCHECK was added in https://chromium-review.googlesource.com/c/chromium/src/+/972425, so cc-ing rockot@.

The DCHECK seems to be failing when print preview sends a search request to cloud print to obtain the list of cloud printers, see https://cs.chromium.org/chromium/src/chrome/browser/resources/print_preview/cloud_print_interface.js?l=142. This search message is sent when the destinations dialog is opened, which is why it fails at that point. More generally, Print Preview's communication with the cloud print server is handled by the print preview WebUI (e.g. print, printer capabilities fetch, etc), so it needs to be able to send network requests to the GCP server.

[219362:219375:0404/212734.894808:FATAL:web_request_permissions.cc(96)] Check failed: !is_network_request || !is_request_from_webui_renderer. Unsupported network request from WebUI for https://www.google.com/cloudprint/search?xsrf=&connection_status=ALL&client=chrome&use_cdd=true&q=%5Erecent
#0 0x7f353076355d base::debug::StackTrace::StackTrace()
#1 0x7f3530761b1c base::debug::StackTrace::StackTrace()
#2 0x7f35307e85aa logging::LogMessage::~LogMessage()
#3 0x55f6d1ffd1a4 IsSensitiveURL()
#4 0x55f6d1ffd7a8 WebRequestPermissions::HideRequest()
#5 0x55f6d1f9f761 extensions::(anonymous namespace)::ShouldHideEvent()
#6 0x55f6d1f9edfe extensions::ExtensionWebRequestEventRouter::OnBeforeRequest()
#7 0x55f6d2eeaa86 (anonymous namespace)::ChromeExtensionsNetworkDelegateImpl::OnBeforeURLRequest()
#8 0x55f6d2ee7135 ChromeNetworkDelegate::OnBeforeURLRequest()
#9 0x7f352de5689a net::NetworkDelegate::NotifyBeforeURLRequest()
#10 0x7f352de2fc87 net::LayeredNetworkDelegate::OnBeforeURLRequest()
#11 0x7f352de5689a net::NetworkDelegate::NotifyBeforeURLRequest()
#12 0x7f352de2fc87 net::LayeredNetworkDelegate::OnBeforeURLRequest()
#13 0x7f352de5689a net::NetworkDelegate::NotifyBeforeURLRequest()
#14 0x7f352e6ef23d net::URLRequest::Start()
#15 0x7f352abb3ea4 content::ResourceLoader::StartRequestInternal()
#16 0x7f352abb356b content::ResourceLoader::Resume()
#17 0x7f352abb5b29 content::ResourceLoader::ScopedDeferral::~ScopedDeferral()
#18 0x7f352abacf3e content::ResourceLoader::StartRequest()
#19 0x7f352ab9661e content::ResourceDispatcherHostImpl::StartLoading()
#20 0x7f352ab8a180 content::ResourceDispatcherHostImpl::BeginRequestInternal()
#21 0x7f352ab869b7 content::ResourceDispatcherHostImpl::ContinuePendingBeginRequest()
#22 0x7f352ab811c6 content::ResourceDispatcherHostImpl::BeginRequest()
#23 0x7f352ab7fe2e content::ResourceDispatcherHostImpl::OnRequestResourceInternal()
#24 0x7f352ab95d0d content::ResourceDispatcherHostImpl::OnRequestResourceWithMojo()
#25 0x7f352abc8576 content::URLLoaderFactoryImpl::CreateLoaderAndStart()
#26 0x7f352abb8396 content::ResourceMessageFilter::CreateLoaderAndStart()
#27 0x7f352abb8430 content::ResourceMessageFilter::CreateLoaderAndStart()
#28 0x7f3529426cb6 network::mojom::URLLoaderFactoryStubDispatch::Accept()
#29 0x7f352a32cae3 network::mojom::URLLoaderFactoryStub<>::Accept()
#30 0x7f352ebfcb55 mojo::InterfaceEndpointClient::HandleValidatedMessage()
#31 0x7f352ebfb5a1 mojo::InterfaceEndpointClient::HandleIncomingMessageThunk::Accept()
#32 0x7f352ebf9a52 mojo::FilterChain::Accept()
#33 0x7f352ebff785 mojo::InterfaceEndpointClient::HandleIncomingMessage()
#34 0x7f352e9fb05c IPC::(anonymous namespace)::ChannelAssociatedGroupController::Accept()
#35 0x7f352ebf9a52 mojo::FilterChain::Accept()
#36 0x7f352ebeba8f mojo::Connector::ReadSingleMessage()
#37 0x7f352ebecada mojo::Connector::ReadAllAvailableMessages()
#38 0x7f352ebec8a5 mojo::Connector::OnHandleReadyInternal()
#39 0x7f352ebec78b mojo::Connector::OnWatcherHandleReady()

 
Cc: creis@chromium.org jam@chromium.org nasko@chromium.org
Yes, this indicates that Web UI is violating a constraint we would like to enforce moving forward, that Web UI resources should not directly initiate network requests.

+CC some folks who I think were involved in that discussion.

I can revert the CL which is now incidentally enforcing this constraint, but:

1) This seems to lack test coverage or the breakage would have been caught -- a few other Web UI pages were violating the constraint, and they were caught by tests and fixed before this CL could land.

2) I think we can implement this without the WebUI page making direct network requests? It only requires that the page embed a network-hosted subframe to do the fetches, rather than issuing direct XHRs.

Cc: groby@chromium.org rbpotter@chromium.org
Interacting with cloud print has been living in Print preview WebUI since its original implementation AFAIK. Although I don't have the full context of why that was done this way originally, changing this is not trivial.

> I can revert the CL which is now incidentally enforcing this constraint

Please do so. Changing how the interaction with cloud print servers works is not something our team has allocated time currently. If this is important, let's have a talk to decide which team should own this migration, and form a plan without surprises.


Status: Fixed (was: Untriaged)
Reverted in r548440. I'll file a separate bug to track the fix for cloud print UI.
Project Member

Comment 4 by bugdroid1@chromium.org, Apr 10 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c1b313b3e5b79d17e0bf5963a7ddb22c92c16bc7

commit c1b313b3e5b79d17e0bf5963a7ddb22c92c16bc7
Author: David Roger <droger@chromium.org>
Date: Tue Apr 10 15:40:34 2018

Allow sync-confirmation WebUI to make network requests.

Bug:  829218 
Change-Id: I4db1e432cbe32b6a0de5a502eba5acb1af3e16d0
Reviewed-on: https://chromium-review.googlesource.com/1005035
Reviewed-by: Ken Rockot <rockot@chromium.org>
Commit-Queue: David Roger <droger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#549541}
[modify] https://crrev.com/c1b313b3e5b79d17e0bf5963a7ddb22c92c16bc7/extensions/browser/api/web_request/web_request_permissions.cc

Sign in to add a comment