"_nw_activity_is_equal" Crash When Initiating NSURLSession Task on App Startup

Dear Apple Developer Team,

We have encountered a recurring issue where our application crashes when initiating an NSURLSession task immediately after startup. The crash appears to be sporadic, but we have observed a few instances where it consistently happens right after launching the app and starting an NSURLSession task.

The crash stack trace is as follows:

  1. _objc_retain_x20
  2. _nw_activity_is_equal
  3. ___nw_activity_activate_block_invoke
  4. nw_synchronize<nw::unfair_mutex, void () block_pointer __strong>(nw::unfair_mutex*, void (&&)() block_pointer __strong)
  5. _nw_activity_activate
  6. sub_1893e49b0

From the stack trace, it appears that the crash is related to network activity synchronization (nw_synchronize) and activity activation (_nw_activity_activate). This issue could potentially be linked to some internal network state management or threading issues within the networking stack.

Steps to Reproduce:

1.	Launch the app.
2.	Immediately initiate an NSURLSession task.

Most important, it seems be happen after iOS17.

Hoping your kind answer!

Please post a full Apple crash report. See Posting a Crash Report for advice on how to do that.


Just speculating here, but if these were happening to a lot of folks then it’s likely I’d have heard about it. I suspect that something in your app is triggering this. My best guess is that it’s some sort of memory management issue. I encourage you to test with the standard memory debugging tools.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

"_nw_activity_is_equal" Crash When Initiating NSURLSession Task on App Startup
 
 
Q