New issue
Advanced search Search tips

Issue 644234 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner: ----
Closed: Sep 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug



Sign in to add a comment

Crash when returning value != net::OK from NetworkDelegate::OnBeforeStartTransaction()

Project Member Reported by wdzierza...@opera.com, Sep 6 2016

Issue description

Version: 54.0.2832.2
OS: all

I'm trying to return an error from NetworkDelegate::OnBeforeStartTransaction().  Depending on the type of request, I'm ending up in some bad places.

For example, an SdchDictionaryFetcher notices we're trying to start a nested fetch loop:
[1068:5812:0902/095833:245125484:FATAL:sdch_dictionary_fetcher.cc(162)] Check failed: !in_loop_. 
Backtrace:
        base::debug::StackTrace::StackTrace
        logging::LogMessage::~LogMessage() Line 533
        net::SdchDictionaryFetcher::OnResponseStarted() Line 167
        net::URLRequest::NotifyResponseStarted() Line 825
        net::URLRequestJob::NotifyStartError() Line 626
        net::URLRequestHttpJob::MaybeStartTransactionInternal() Line 581
        net::URLRequestHttpJob::StartTransaction() Line 555
        net::URLRequestHttpJob::DoStartTransaction() Line 820
        net::URLRequestHttpJob::AddCookieHeaderAndStart() Line 804
        net::URLRequestHttpJob::Start() Line 400
        net::URLRequest::StartJob() Line 665
        net::URLRequest::BeforeRequestComplete() Line 610
        net::URLRequest::Start() Line 533
        net::SdchDictionaryFetcher::DoSendRequest() Line 293
        net::SdchDictionaryFetcher::DoLoop() Line 241
        net::SdchDictionaryFetcher::ScheduleInternal() Line 221
        net::SdchDictionaryFetcher::ScheduleReload() Line 136
        net::SdchOwner::SchedulePersistedDictionaryLoads() Line 732
        net::SdchOwner::OnPrefStorageInitializationComplete() Line 632
        chrome_browser_net::SdchOwnerPrefStorage::OnInitializationCompleted() Line 110
        JsonPrefStore::FinalizeFileRead() Line 440
        JsonPrefStore::OnFileRead() Line 391

In another example, a content::ResourceLoader effectively self-destructs while executing StartRequestInternal(). The call stack below illustrates what happens right before attempting the delegate_->DidStartRequest(this) call in StartRequestInternal().
        content::ResourceDispatcherHostImpl::RemovePendingLoader() Line 2027
        content::ResourceDispatcherHostImpl::RemovePendingRequest() Line 2022
        content::ResourceDispatcherHostImpl::DidFinishLoading() Line 1063
        content::ResourceLoader::CallDidFinishLoading() Line 698
        content::ResourceLoader::ResponseCompleted() Line 692
        content::ResourceLoader::OnResponseStarted() Line 353
        net::URLRequest::NotifyResponseStarted() Line 825
        net::URLRequestJob::NotifyStartError() Line 626
        net::URLRequestHttpJob::MaybeStartTransactionInternal() Line 603
        net::URLRequestHttpJob::StartTransaction() Line 577
        net::URLRequestHttpJob::DoStartTransaction() Line 845
        net::URLRequestHttpJob::AddCookieHeaderAndStart() Line 829
        net::URLRequestHttpJob::Start() Line 402
        net::URLRequest::StartJob() Line 665
        net::URLRequest::BeforeRequestComplete() Line 610
        net::URLRequest::Start() Line 533
        content::ResourceLoader::StartRequestInternal() Line 499
        content::ResourceLoader::StartRequest() Line 189
        content::ResourceDispatcherHostImpl::StartLoading() Line 2376
        content::ResourceDispatcherHostImpl::BeginRequestInternal() Line 2362
        content::ResourceDispatcherHostImpl::BeginRequest() Line 1568
        content::ResourceDispatcherHostImpl::OnRequestResource() Line 1171

From the discussion in https://groups.google.com/a/chromium.org/d/topic/net-dev/v-ckbav2hac/discussion, this is because URLRequestHttpJob calls URLRequestJob::NotifyStartError() synchronously, which the URLRequest doesn't allow.  The same applies to NotifyHeadersComplete().
 
Fixing this makes sense - more generally, I really want to clean up the URLRequest / URLRequestJob API, and make the classes less coupled to each other, and this makes sense as part of that work.
Status: Available (was: Untriaged)
Labels: Fixit-Net
Project Member

Comment 4 by sheriffbot@chromium.org, Sep 7 2017

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available. If you change it back, also remove the "Hotlist-Recharge-Cold" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Status: Fixed (was: Untriaged)
SDCH is going away.  I made the net::URLRequestHttpJob::MaybeStartTransactionInternal -> net::URLRequestJob::NotifyStartError call asynchronous a while back to fix the other case cited.  So I'm going to make this as Fixed.
Components: Internals>Network
Components: -Internals>Network>HTTP

Sign in to add a comment