dji-sdk / Mobile-SDK-iOS

DJI Mobile SDK for iOS: http://developer.dji.com/mobile-sdk/
Other
577 stars 256 forks source link

dji::flysafe::WorkerManager::~WorkerManager() Crash in 4.14-trial2 #430

Closed bradreid closed 3 years ago

bradreid commented 3 years ago

I'm getting lots of crashes with the update 4.14-trial2 SDK and flysafe code. The release notes said this might be fixed in 4.14-trial2, is there anyway to prevent this? I'm including the Flysafe DB as a module (cocoapod dependency) in my project. Should I try letting the app download it?

Here are two of the traces:

Thread 21 Crashed: 0 libsystem_kernel.dylib 0x00000001bc494414 pthread_kill + 8 1 libsystem_pthread.dylib 0x00000001d9eeeb40 pthread_kill + 272 (pthread.c:1388) 2 libsystem_c.dylib 0x0000000197abab74 abort + 104 (abort.c:110) 3 libc++abi.dylib 0x00000001a3792cf8 abort_message + 132 (abort_message.cpp:76) 4 libc++abi.dylib 0x00000001a3783e34 demangling_terminate_handler() + 284 (cxa_default_handlers.cpp:62) 5 libobjc.A.dylib 0x00000001a368cf74 _objc_terminate() + 160 (objc-exception.mm:704) 6 libc++abi.dylib 0x00000001a37920e0 std::terminate(void (*)()) + 20 (cxa_handlers.cpp:59) 7 libc++abi.dylib 0x00000001a379206c std::terminate() + 44 (cxa_handlers.cpp:88) 8 DJISDK 0x0000000106016828 dji::flysafe::WorkerManager::~WorkerManager() + 188 9 DJISDK 0x0000000106015e10 dji::flysafe::ModuleManager::Cleanup() + 76 10 DJISDK 0x0000000105c62660 0x105a80000 + 1975904 11 DJISDK 0x0000000106016d90 0x105a80000 + 5860752 12 DJISDK 0x0000000106016b20 0x105a80000 + 5860128 13 libsystem_pthread.dylib 0x00000001d9eedb40 _pthread_start + 320 (pthread.c:881) 14 libsystem_pthread.dylib 0x00000001d9ef6768 thread_start + 8

and:

Thread 17 Crashed: 0 libsystem_kernel.dylib 0x0000000186fb4df0 pthread_kill + 8 1 libsystem_pthread.dylib 0x0000000186ed4948 pthread_kill + 228 (pthread.c:1458) 2 libsystem_c.dylib 0x0000000186e63ba4 abort + 104 (abort.c:110) 3 libc++abi.dylib 0x0000000186f87f60 abort_message + 132 (abort_message.cpp:76) 4 libc++abi.dylib 0x0000000186f79914 demangling_terminate_handler() + 284 (cxa_default_handlers.cpp:60) 5 libobjc.A.dylib 0x0000000186ee2fb8 _objc_terminate() + 148 (objc-exception.mm:704) 6 libc++abi.dylib 0x0000000186f8740c std::terminate(void (*)()) + 20 (cxa_handlers.cpp:59) 7 libc++abi.dylib 0x0000000186f87398 std::terminate() + 44 (cxa_handlers.cpp:88) 8 DJISDK 0x0000000101eae828 dji::flysafe::WorkerManager::~WorkerManager() + 188 9 DJISDK 0x0000000101eade10 dji::flysafe::ModuleManager::Cleanup() + 76 10 DJISDK 0x0000000101afa660 0x101918000 + 1975904 11 DJISDK 0x0000000101eaed90 0x101918000 + 5860752 12 DJISDK 0x0000000101eaeb20 0x101918000 + 5860128 13 libsystem_pthread.dylib 0x0000000186ed3914 _pthread_start + 168 (pthread.c:896) 14 libsystem_pthread.dylib 0x0000000186edb9d4 thread_start + 8

dji-dev commented 3 years ago

Agent comment from Luce Luo in Zendesk ticket #42971:

Dear Customer,

Thank you for contacting DJI. Yes, as you said that the 4.14-trial2 has fixed this crash theoretically whether configured in the pod or download later. So weird that it occurs again with the 4.14-trial2? Please give us the below detail: -Your pod file -What drone you are using -Firmware version of the drone and RC -Probability of this crash

Thanks,

Luce Luo DJI Developer Support

bradreid commented 3 years ago

Podfile: https://gist.github.com/bradreid/82fd8f896c5d287903859ab3bebf84f8

The app is just starting, the crash details from the device are here: https://gist.github.com/bradreid/d174f6f34a56289c50cdbf998c41354c

The firmware is the latest for the DJI Mavic Air 2.

dji-dev commented 3 years ago

Agent comment from Luce Luo in Zendesk ticket #42971:

Dear Customer,

Thank you for contacting DJI. I checked it but missing the DJIWidget and DJIFlySafeDatabaseResource version info. Can you please supplement to us? The latest version is DJIWidget 1.6.4, DJIFlySafeDatabaseResource 01.00.01.17, please ensure you have upgraded to the latest. https://github.com/dji-sdk/Mobile-SDK-iOS/blob/v4.14-trial2/Sample%20Code/SwiftSampleCode/Podfile ​ Thanks,

Luce Luo DJI Developer Support
inline826279072.png

bradreid commented 3 years ago

I am now testing with:

  pod 'DJI-SDK-iOS', '~> 4.14-trial2'
  pod 'DJI-UXSDK-iOS', '~> 4.14-trial1'
  pod 'DJIFlySafeDatabaseResource', '~> 01.00.01.17'
  pod 'DJIWidget', '~> 1.6.4'

I'm getting the same result.

dji-dev commented 3 years ago

Agent comment from Luce Luo in Zendesk ticket #42971:

Dear Customer,

Thank you for contacting DJI. Sorry about it. This issue has been escalated to the engineer to investigate further.

Thanks,

Luce Luo DJI Developer Support

bradreid commented 3 years ago

It seems to happen during exiting of the app. With the app connected to xcode in debug mode and a wifi connection to a drone I can reproduce an error when closing the app.

The error in xcode console: 1 libc++abi.dylib: terminating with uncaught exception of type std::__1::system_error: thread::join failed: Resource deadlock avoided 2 terminating with uncaught exception of type std::__1::system_error: thread::join failed: Resource deadlock avoided

josechagas commented 3 years ago

I am having the same problem

mitchrsm commented 3 years ago

same problem here too

roboflot commented 3 years ago

I also have this issue, and have already reported it by email (ticket 43231). The crash always happens on app kill (force quit) and only visible with Xcode debugger, in test flight and in crash logs. It can be reproduced with DJI SDK Demo app with no drone connected.

roboflot commented 3 years ago

Forgot to mention: it is visible in Xcode debugger with cable connection.

YaroTs commented 3 years ago

This issue is still reproduces with the following pods:

pod 'DJI-SDK-iOS', '~> 4.14' pod 'DJI-UXSDK-iOS', '~> 4.14' pod 'DJI-UXSDK-iOS-Beta', '0.4.1' pod 'DJIFlySafeDatabaseResource', '~> 01.00.01.18' pod 'DJIWidget', '~> 1.6.4'

Steps to reproduce for my application:

  1. Install from TestFlight
  2. Open app (even without connected drone), then close
  3. System dialog "App crashed. Do you want to share additional information with the developer?" always appears, then after sharing, an appropriate crash logs appears in Xcode Organizer:

    Thread 19 Crashed: 0   libsystem_kernel.dylib        0x00000001d01ea98c pthread_kill + 8 1   libsystem_pthread.dylib       0x00000001eb203c74 pthread_kill + 272 (pthread.c:1375) 2   libsystem_c.dylib             0x00000001adaa6bb4 abort + 104 (abort.c:110) 3   libc++abi.dylib               0x00000001b8b1de24 abort_message + 132 (abort_message.cpp:76) 4   libc++abi.dylib               0x00000001b8b0f41c demangling_terminate_handler() + 284 (cxa_default_handlers.cpp:62) 5   libobjc.A.dylib               0x00000001b8a1e720 _objc_terminate() + 148 (objc-exception.mm:704) 6   libc++abi.dylib               0x00000001b8b1d2a8 std::terminate(void (*)()) + 20 (cxa_handlers.cpp:59) 7   libc++abi.dylib               0x00000001b8b1d234 std::terminate() + 44 (cxa_handlers.cpp:88) 8   DJISDK                        0x0000000103932828 dji::flysafe::WorkerManager::~WorkerManager() + 188 9   DJISDK                        0x0000000103931e10 dji::flysafe::ModuleManager::Cleanup() + 76 10  DJISDK                        0x000000010357e660 0x10339c000 + 1975904 11  DJISDK                        0x0000000103932d90 0x10339c000 + 5860752 12  DJISDK                        0x0000000103932b20 0x10339c000 + 5860128 13  libsystem_pthread.dylib       0x00000001eb202ca8 _pthread_start + 320 (pthread.c:880) 14  libsystem_pthread.dylib       0x00000001eb20b788 thread_start + 8

tmatta88 commented 3 years ago

I'm experiencing the same issue on the DJI iOS SDK 4.14 as well. What is the update on this?

tmatta88 commented 3 years ago

DJI Dev response via email: "The engineer reply that this fly-safe crash problem will be fixed in the 4.15 version, Estimated Release Time: 2021-06-21."

mitchrsm commented 3 years ago

so there will be an iOS SDK 4.15 "soon"? (they said that SDK for iOS development was on hold)

Michael-DJI commented 3 years ago

4.15 iOS has been released, please check it out.