New issue
Advanced search Search tips

Issue 706580 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: iOS
Pri: 1
Type: Bug



Sign in to add a comment

[Cronet] Crash in CRNHTTPProtocolHandler after applicationWillTerminate

Project Member Reported by mef@chromium.org, Mar 29 2017

Issue description

Cronet's HTTPProtocolHandlerDelegate may get destroyed on main thread while CRNHTTPProtocolHandler is still using it on worker thread: 

0x000000010291bbf8	(Cronet -crn_http_protocol_handler.mm:871 )	+[CRNHTTPProtocolHandler canInitWithRequest:]
0x000000018e4ddad8	(CFNetwork + 0x00005ad8 )	-[__NSURLSessionLocal _protocolClassForTask:]
0x000000018e4ddad8	(CFNetwork + 0x00005ad8 )	-[__NSURLSessionLocal _protocolClassForTask:]
0x000000018e4ddd30	(CFNetwork + 0x00005d30 )	-[__NSURLSessionLocal _createCanonicalRequestForTask:]
0x000000018e6522b4	(CFNetwork + 0x0017a2b4 )	URLConnectionClient::_internalEvent_WillSendRequest()

and cause application to crash.
 

Comment 1 by mef@chromium.org, Mar 29 2017

Labels: -Pri-3 Pri-1
Internal issue is b/36699307.
Proposed fix https://codereview.chromium.org/2778743010
Project Member

Comment 2 by bugdroid1@chromium.org, Mar 30 2017

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

commit 65d11a7c591307ff2d10145a07655b53010e04d0
Author: mef <mef@chromium.org>
Date: Thu Mar 30 22:13:25 2017

[Cronet] Leak CronetHttpProtocolHandlerDelegate on shutdown.
Prevent crash if background threads are handling requests while main is exiting.

BUG= 706580 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.android:android_cronet_tester

Review-Url: https://codereview.chromium.org/2778743010
Cr-Commit-Position: refs/heads/master@{#460904}

[modify] https://crrev.com/65d11a7c591307ff2d10145a07655b53010e04d0/components/cronet/ios/Cronet.mm

Comment 3 by mef@chromium.org, Apr 3 2017

Status: Fixed (was: Assigned)

Sign in to add a comment