Concurrency/NSOperation behavior change on ios 10.3 ?

On our converted Advanced NSOperation sample code (WWDC'15), I am facing nasty crash (EXEC_BAD_ACCESS) on ios 10.3 simultor while working smoothly on other simulator.


What i mean nasty is, the break point is stopped on bellow :

var retval: [String : Any] = [ : ]



Since i can not find any release note/ change log for ios 10.3, I wonder is there significant changes on Concurrency on iOS 10.3 ?


The crash only happen if i run test suite, it passes on single test execution.


update, here is some logs when it crash/stop:

2017-04-10 14:47:41.275 xctest[4783:198593] +[Swift._RawNativeDictionaryStorage addCompletionBlock:]: unrecognized selector sent to class 0x11e6bfb28
2017-04-10 14:47:44.241243+0900 xctest[4783:198693] Invalid connection: com.apple.coresymbolicationd
Invalid connection: com.apple.coresymbolicationd


Thanks.

The most likely reason for the crash is a memory management bug that you were unlucky enough not to hit in other scenarios. There don't have to be any significant changes in any particular place within iOS to change the timing of what happens in your app, and a difference in timing may easily expose an existing but unknown bug.


You should probably start looking into the crash itself. Unfortunately, if there's a bug and your app has gone way past the point of error before it crashes, it can be difficult to work backwards. (You can try turning on zombies, guard malloc, and other similar debugging aids available from your scheme's options tab. If you're lucky, this may expose bugs earlier.)

Thanks for the answer,

Yes it is more likely a memory management issue. But the odds is on the same test code same xcode version, it produces different result.

10.3 simulator have crash issue where the rest (ios 10.2 and below is OK).

@Quincy,

If i turn on guard malloc on my test scheme, the test suit is passed without crashing.

Do you have any idea why ?

I don't know why, but at this point I think the correct thing to do is submit a bug report, preferably with a project that demonstrates the crash.

Accepted Answer

Guard Malloc is really slow, so it’s not uncommon for it to mask race (or reveal!) race conditions.

In terms of the standard tools for debugging memory management problems, I apply the tools in this order:

  1. Zombies

  2. Address Sanitizer

  3. Guard Malloc

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Thanks for the advice. I use address sanitizer and able to fix the crash.

Concurrency/NSOperation behavior change on ios 10.3 ?
 
 
Q