Simultaneous accesses to 0x1c0a7f0f8, but modification requires exclusive access error on Xcode 9 beta 4

I think this ‘bug’ may be a Swift 4 “feature”, specifically something they call “Exclusive access to Memory”.

Check out this WWDC video. Around the 50-minute mark, the long-haired speaker explains it.

https://developer.apple.com/videos/play/wwdc2017/402/?time=233

You could try turning the thread sanitizer off in your scheme settings if you’re happy to ignore it. However, the debugger is trying to tell you about a subtle threading issue, so it’s probably a better use of your time to figure out why you’ve got something writing to your array at the same time as it’s being read from.


UPDATE 2022:

The link is broken, you can watch the video directly here: (Around the 53-minute mark)

https://devstreaming-cdn.apple.com/videos/wwdc/2017/402ynph39nk5sn4222/402/402_hd_whats_new_in_swift.mp4

Leave a Comment