iOS Cronet Crash

538 views
Skip to first unread message

吴凯凯

unread,
Feb 23, 2021, 8:39:54 AM2/23/21
to net-dev
I see that there are a few crashes

93821614086985_.pic_hd.jpg

I get some information(API MISUSE: Over-release of an object) from crash_info , and I found that the release com.apple.CFFileDescriptor queue by analyzing the App coredump. 

In my app,  only  Cronet uses CFFileDescriptor. So I suspect it's Cronet problem.

shuai yan

unread,
Apr 2, 2021, 4:04:38 AM4/2/21
to net-dev, wukai...@gmail.com
I got the same crash in my app, and i can confirm, this crash is triggered by CFFileDescriptor.
Looking forward to the answer.

shuai yan

unread,
Apr 13, 2021, 4:30:34 AM4/13/21
to net-dev, shuai yan, wukai...@gmail.com

Now, by modifying the cronet_test, you can reproduce the crash stably on my Mac, as follows:
1. Add the test case to cronet_http_test.mm as follow :
TEST_F(HttpTest, LibdispatchCrash) { 
   NSURL* url = net::NSURLWithGURL(GURL("http://localhost:9988")); 
   [Cronet setRequestFilterBlock:^(NSURLRequest* request) { 
     if ([request.URL isEqual:url]) { 
       return YES; 
      };
      return NO; 
     }]; 
   while (1) { 
      NSURLSessionDataTask* task = [session_ dataTaskWithURL:url]; 
      StartDataTaskAndWaitForCompletion(task); 
     };
 }

2. iOS-simulator:iPhone12+iOS14.4;
3. macOS-version: 11.2.3 (20D91), i tried to reproduce on Mac OS10.15, but failed.

Chidera Olibie

unread,
Jun 2, 2021, 5:18:32 AM6/2/21
to net-dev, yanshua...@gmail.com, wukai...@gmail.com
Hi, 

I was unable to reproduce the issue using Chrome version: 93.0.4531.0 and the iOS simulator for iPhone12+iOS14.4, can you confirm if you see experience the crashes?

吴凯凯

unread,
Sep 8, 2021, 6:00:39 AM9/8/21
to net-dev, Chidera Olibie, yanshua...@gmail.com, 吴凯凯
I fix this crash, but very trick~   

Hao Chen

unread,
Nov 18, 2021, 1:41:22 AM11/18/21
to net-dev, wukai...@gmail.com, Chidera Olibie, yanshua...@gmail.com
Hi,
   How did you fix the crash? These crashes are still annoying us.

Chidera Olibie

unread,
Nov 18, 2021, 5:37:38 AM11/18/21
to Hao Chen, net-dev, wukai...@gmail.com, yanshua...@gmail.com
Hi, could you please file a bug via https://bugs.chromium.org/p/chromium/issues/list with the word "Cronet" in the summary line. Add the stack trace and other relevant information to enable us to debug this properly.

Thanks.

shuai yan

unread,
Dec 10, 2021, 9:13:12 AM12/10/21
to net-dev, Chidera Olibie, net-dev, wukai...@gmail.com, shuai yan, Hao Chen
I fix this crash ,but very trick too. Get the dispatch_queue which over released and forced change its ref count to INT_MAX.
No need to worry about memory leak,because it could be destroyed when app exists.

Динар Хайруллин

unread,
Feb 11, 2022, 3:47:46 AM2/11/22
to net-dev, yanshua...@gmail.com
Hi, thx for your fix. Could you tell please how you get over released dispatch_queue and how exactly you change its ref count, is it dispatch_retain(queue) or somehow else? And maybe when you changing its ref count?
i always get 18 446 744 073 709 551 615 retainCount for my dispatch_queue_global_t queue, or should i create dispatch_queue_t queue? 

пятница, 10 декабря 2021 г. в 17:13:12 UTC+3, yanshua...@gmail.com:

shuai yan

unread,
Jun 22, 2022, 4:45:05 AM6/22/22
to net-dev, Динар Хайруллин, shuai yan
maybe fishhook can help you.
if you wanna better performance, try to calculate offsets to fetch the queue。

And there is a good message, Bytedance has announced its solution,ref: https://xie.infoq.cn/article/fc1ebf4518facd24f0df61f83 
Reply all
Reply to author
Forward
0 new messages