shaka-project / shaka-player-embedded

Shaka Player in a C++ Framework
Apache License 2.0
239 stars 62 forks source link

ShakaPlayer.getUiInfo possibly causing a crash #134

Closed okycelt closed 4 years ago

okycelt commented 4 years ago

Issue description

Calling ShakaPlayer.getUiInfo(block: (ShakaPlayerUiInfo) -> Void) some time during ViewController's life cycle leads to a crash after dismissing that ViewController. Originally, we thought it's related to calling that method within a Timer's block, but it's enough to call it e.g. in viewDidAppear(). This is what we're seeing in the logs:

...
[Info]: "Preparing to destroy walker..."
[INFO:/var/lib/jenkins/workspace/CDM_Arxan_Create_Release/oemcrypto-arxan/third_party/cdm/core/src/cdm_engine.cpp(198):CloseSession] CdmEngine::CloseSession: ksid24CA12AA
libc++abi.dylib: terminating with uncaught exception of type std::__1::system_error: thread::join failed: Resource deadlock avoided
Screenshot 2020-04-27 at 13 31 55

Reproduction steps

  1. Present a ViewController with player
  2. Start playback
  3. Call ShakaPlayer.getUiInfo(block: (ShakaPlayerUiInfo) -> Void)
  4. Dismiss the ViewController
  5. It should crash in about 10-20 seconds

Version of Shaka Player Embedded

6b8337553f045005d5d6908725c680de84d62f9e (at this moment latest master) a8acedfa8152e341d97a2d3829c182b3e80c407a

Device(s) and version(s) of iOS being used

iPhone XR with iOS 13.4.1 Simulator with iOS 13.4

TheModMaker commented 4 years ago

Could you get a stack trace with debug symbols? It also says it is due to a deadlock, could you get stack traces for other threads too? The important ones would be the "Thread 1" and the "JS Main Thread", but other threads may be involved too.

okycelt commented 4 years ago

Here's the backtrace of all threads: 134_bt_all.txt