smartdevicelink/sdl_ios

Crash when removing system capability observers

joeljfischer opened this issue · 0 comments

Bug Report

When removing capability observers in sdl_removeNilObserversAndUnsubscribeIfNecessary, we sometimes crash due to modifying the self.capabilityObservers while method is running and modifying the dictionary. We should ensure that only one access to the dictionary happens at a time by ensuring the code in the class only runs on the SDL serial queue. One of the accesses at least is happening on the sdl session queue.

Reproduction Steps

Difficult to reproduce, and only happens occasionally. Most often happens when disconnecting the iAP transport.

Expected Behavior

No double-access on different threads.

Observed Behavior

Double-access on different threads causes a crash.

OS & Version Information
  • iOS Version: Unknown
  • SDL iOS Version: Modified sdl_ios lib, version unknown
  • Testing Against: Ford Sync TDK
Test Case, Sample Code, and / or Example App

n/a