NordicSemiconductor / IOS-DFU-Library

OTA DFU Library for Mac and iOS, compatible with nRF5x SoCs
http://www.nordicsemi.com
BSD 3-Clause "New" or "Revised" License
525 stars 214 forks source link

Having SIGABRT while accessing object properties of DFUServiceInitiator #468

Closed dominique-cosmo closed 2 years ago

dominique-cosmo commented 2 years ago

Device information (please complete the following information):

Describe the bug The main topic concerns usage of IOS-DFU-Library (version 4.11.0 or 4.11.1) in our SDK development for BLE device control (based on nRF51, nRF SDK version does not really matters for now). The library is used for DFU upgrade within our SDK. We moved from old version 4.6.1 to 4.11.0 or 4.11.1 due to Xcode update.

We have tow applications using our SDK, both using IOS-DFU-Library :

  1. A fully native test application for our own SDK development and tests.
  2. Our final application (which is quite complexe React Native) including our own SDK for production.

In the first app, we have no issue regarding IOS-DFU-Library, everything goes well and upgrade works quite well.

In the second App and given the execution conditions, we are facing SIGABRT error with almost no info in the backtrace. The error is really similar to the issue reported by a florentin in #461 here. Indeed the DFUServiceInitiator can be instantiated (with proper men address) but as soon as we try to access property we got the SIGABRT (.forceDfu, .with)

I did tried a lot of tests :

It sounds that we face memory issues as soon as we call DFUServiceInitiator within our SDK in the production application but it is only an assumption.

Here is the code (quite simple indeed...):

let dfuInitiator = DFUServiceInitiator().with(firmware: self.dfuFirmware!) // SIGABRT

or

let dfuInitiator = DFUServiceInitiator()
dfuInitiator.forceDfu = true // SIGABRT

Thank you in advance if you can help us founding the problem... ! Dom

dominique-cosmo commented 2 years ago

Hi here,

We found our error... no easy but we got it! We did align the following option in all projects (App, Démo App & SDK): BUILD_LIBRARY_FOR_DISTRIBUTION = NO Now everything goes smoothly with the library and modules.

Thank you to our team for the good job and also to anyone how helped us :)

Best regards, Dom