New issue
Advanced search Search tips

Issue 830292 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: May 2018
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 1
Type: Bug

Blocked on:
issue 829251

Blocking:
issue 828331



Sign in to add a comment

NetS13nServiceWorker: request with FetchEvent#body which goes to network (fallback) hits a NOTREACHED()

Project Member Reported by shimazu@chromium.org, Apr 9 2018

Issue description

I've not digged into detail, but I saw the failure on a layout test (fetch-events.https.html) when patching crrev.com/c/996734.

service_worker_loader_helpers.cc(186) Check failed: false. There should be no blob elements in NetworkService

Probably ServiceWorkerServicification without NetworkService has a bug on blob handling. We need to investigate more.
 
Stack trace of the crash on "FetchEvent#body is a blob" in fetch-events.https.html

[1:1:0405/160834.322687:FATAL:service_worker_loader_helpers.cc(186)] Check failed: false. There should be no blob elements in NetworkService
#0 0x7f76047c340c base::debug::StackTrace::StackTrace()
#1 0x7f76047ed71b logging::LogMessage::~LogMessage()
#2 0x7f760311fa48 content::ServiceWorkerLoaderHelpers::CloneResourceRequestBody()
#3 0x7f7603dfc1ac content::ServiceWorkerSubresourceLoader::DispatchFetchEvent()
#4 0x7f7603dfbccf content::ServiceWorkerSubresourceLoader::StartRequest()
#5 0x7f7603dfb98b content::ServiceWorkerSubresourceLoader::ServiceWorkerSubresourceLoader()
#6 0x7f7603dfe5a7 content::ServiceWorkerSubresourceLoaderFactory::CreateLoaderAndStart()
#7 0x7f76030974c6 network::mojom::URLLoaderFactoryProxy_CreateLoaderAndStart_Message::Dispatch()
#8 0x7f76030973d5 network::mojom::URLLoaderFactoryStubDispatch::Accept()
#9 0x7f7604c842f2 mojo::InterfaceEndpointClient::HandleValidatedMessage()
#10 0x7f7604c83be6 mojo::FilterChain::Accept()
#11 0x7f7604c857a2 mojo::InterfaceEndpointClient::HandleIncomingMessage()
#12 0x7f7604c8c5fd mojo::internal::MultiplexRouter::ProcessIncomingMessage()
#13 0x7f7604c8b9c0 mojo::internal::MultiplexRouter::Accept()
#14 0x7f7604c83be6 mojo::FilterChain::Accept()
#15 0x7f7604c7e43b mojo::Connector::ReadSingleMessage()
#16 0x7f7604c7eff4 mojo::Connector::ReadAllAvailableMessages()
#17 0x7f7604c7ee56 mojo::Connector::OnHandleReadyInternal()
#18 0x7f7604c7f824 mojo::SimpleWatcher::DiscardReadyState()
#19 0x7f7604cb2535 mojo::SimpleWatcher::OnHandleReady()
#20 0x7f7604cb2abe _ZN4base8internal7InvokerINS0_9BindStateIMN4mojo13SimpleWatcherEFvijRKNS3_18HandleSignalsStateEEJNS_7WeakPtrIS4_EEijS5_EEEFvvEE7RunImplIRKS9_RKNSt3__15tupleIJSB_ijS5_EEEJLm0ELm1ELm2ELm3EEEEvOT_OT0_NSI_16integer_sequenceImJXspT1_EEEE
#21 0x7f76047c3d2f base::debug::TaskAnnotator::RunTask()
#22 0x7f75fd515b26 blink::scheduler::internal::ThreadControllerImpl::DoWork()
#23 0x7f75fd517b98
Blocking: 828331
Cc: -shimazu@chromium.org
Owner: shimazu@chromium.org
Status: Started (was: Available)
I tried to create a blob ptr in ServiceWorkerSubresourceLoader in crrev.com/c/1046426 , but I found that I've misunderstood what's the blob in the service worker request.
We may need to create one blob including multiple data elements in the subresource loader.

Now we have two options to send request bodies properly:
1. Make resource dispatcher work with the data pipe body.
2. Make a blob in blink and send it in subresource loader.

I need to do further investigation.
Project Member

Comment 4 by bugdroid1@chromium.org, May 24 2018

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

commit 8cc2e7e275ca6f9c24c764fe46974219122d1300
Author: Makoto Shimazu <shimazu@chromium.org>
Date: Thu May 24 03:12:55 2018

Send blob request body when NetS13nServiceWorker w/o NetworkService

Request bodies may be a blob if NetworkService is disabled. We need to plumb it
to a service worker world if we ship NetS13nSW without NetworkService.
After this CL, there are three cases of how to send the request body to the
service worker's fetch event.

(A) NetworkService is on
In this case, blobs should be passed as a data pipe. Data pipes will be included
by a network::ResourceRequestBody.

(B) NetworkService is off and ServiceWorkerServicification is on
Blobs should be passed as a blink::mojom::BlobPtrs, but
network::ResourceRequestBody cannot contain the blink::mojom::BlobPtrs. Instead,
the BlobPtrs are passed as a parameter of DispatchFetchEventParams separately.

(C) NetworkService and ServiceWorkerServicification are off
All request bodies are passed as a blob. The information of the blob is passed
as three parameters of DispatchFetchEventParams.

Bug:  830292 
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_mojo
Change-Id: I36eb0e08e80ae9feb5af926af4b97757607c1950
Reviewed-on: https://chromium-review.googlesource.com/1046426
Commit-Queue: Makoto Shimazu <shimazu@chromium.org>
Reviewed-by: Matt Falkenhagen <falken@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Daniel Murphy <dmurph@chromium.org>
Cr-Commit-Position: refs/heads/master@{#561373}
[modify] https://crrev.com/8cc2e7e275ca6f9c24c764fe46974219122d1300/content/browser/loader/upload_data_stream_builder.cc
[modify] https://crrev.com/8cc2e7e275ca6f9c24c764fe46974219122d1300/content/common/service_worker/dispatch_fetch_event_params.mojom
[modify] https://crrev.com/8cc2e7e275ca6f9c24c764fe46974219122d1300/content/common/service_worker/service_worker_loader_helpers.cc
[modify] https://crrev.com/8cc2e7e275ca6f9c24c764fe46974219122d1300/content/common/service_worker/service_worker_loader_helpers.h
[modify] https://crrev.com/8cc2e7e275ca6f9c24c764fe46974219122d1300/content/renderer/loader/web_url_request_util.cc
[modify] https://crrev.com/8cc2e7e275ca6f9c24c764fe46974219122d1300/content/renderer/loader/web_url_request_util.h
[modify] https://crrev.com/8cc2e7e275ca6f9c24c764fe46974219122d1300/content/renderer/service_worker/service_worker_context_client.cc
[modify] https://crrev.com/8cc2e7e275ca6f9c24c764fe46974219122d1300/content/renderer/service_worker/service_worker_subresource_loader.cc
[modify] https://crrev.com/8cc2e7e275ca6f9c24c764fe46974219122d1300/services/network/public/cpp/resource_request_body.cc
[modify] https://crrev.com/8cc2e7e275ca6f9c24c764fe46974219122d1300/services/network/public/cpp/resource_request_body.h
[modify] https://crrev.com/8cc2e7e275ca6f9c24c764fe46974219122d1300/third_party/blink/public/platform/web_http_body.h
[modify] https://crrev.com/8cc2e7e275ca6f9c24c764fe46974219122d1300/third_party/blink/renderer/platform/exported/web_http_body.cc

Comment 5 by falken@google.com, May 24 2018

Labels: Proj-Servicification-Canary

Comment 6 by shimazu@google.com, May 24 2018

Status: Fixed (was: Started)

Sign in to add a comment