Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

switching src quickly will crash on iOS #2908

Closed
wood1986 opened this issue Nov 2, 2022 · 4 comments · Fixed by #2917
Closed

switching src quickly will crash on iOS #2908

wood1986 opened this issue Nov 2, 2022 · 4 comments · Fixed by #2917
Labels
critical for release help wanted The issue has been reviewed and is valid, and is waiting for someone to work on it. Platform: iOS

Comments

@wood1986
Copy link
Contributor

wood1986 commented Nov 2, 2022

Bug

switching src quickly will crash on iOS especially when you app is huge

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Cannot remove an observer <NSKeyValueObservance 0x600000a150b0> for the key path "currentItem.liveUpdateInterval" from <AVPlayer 0x600001ba8880>, most likely because the value for the key "currentItem" has changed without an appropriate KVO notification being sent. Check the KVO-compliance of the AVPlayer class.'

Platform

Which player are you experiencing the problem on:

  • iOS

Environment info

React native info output:

System:
    OS: macOS 12.6
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 1.14 GB / 32.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 18.9.0 - /private/var/folders/xn/9sz2plkj3wbf2lj_ths6_ykr0000gn/T/xfs-2f68018f/node
    Yarn: 3.2.4 - /private/var/folders/xn/9sz2plkj3wbf2lj_ths6_ykr0000gn/T/xfs-2f68018f/yarn
    npm: 8.19.1 - ~/.nvm/versions/node/v18.9.0/bin/npm
    Watchman: 2022.10.10.00 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.11.3 - /Users/wood/.rbenv/shims/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 21.4, iOS 16.0, macOS 12.3, tvOS 16.0, watchOS 9.0
    Android SDK: Not Found
  IDEs:
    Android Studio: 2021.3 AI-213.7172.25.2113.9014738
    Xcode: 14.0.1/14A400 - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.16.1 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 18.0.0 => 18.0.0
    react-native: 0.69.3 => 0.69.3
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Library version: 6.0.0-alpha.3

Steps To Reproduce

  1. git clone https://github.com/wood1986/react-native-fullscreen-example.git
  2. git checkout bug/crash-kvo-compliance
  3. yarn && cd ios && pod install && yarn ios
  4. Click 'Next' button quickly
    ...

Expected behaviour

  1. It should not crash

Reproducible sample code

https://github.com/wood1986/react-native-fullscreen-example/tree/bug/crash-kvo-compliance

Video sample

If possible, include a link to the video that has the problem that can be streamed or downloaded from.

@wood1986
Copy link
Contributor Author

wood1986 commented Nov 2, 2022

This PR #2848 causes the issue. If I undo this PR, it works fine

@freeboub
Copy link
Collaborator

freeboub commented Nov 7, 2022

@wood1986 It was fixing a latency (all UI blocks) while starting a stream, I was afraid of such issue due to thread safety (and it is the case)...
2 solutions: either we revert the change or you can try to put the whole start function inside DispatchQueue.
Please let me know !

@freeboub freeboub added help wanted The issue has been reviewed and is valid, and is waiting for someone to work on it. Platform: iOS critical for release labels Nov 7, 2022
@wood1986
Copy link
Contributor Author

wood1986 commented Nov 8, 2022

put the whole start function inside DispatchQueue.

like my PR?

@wood1986
Copy link
Contributor Author

wood1986 commented Nov 9, 2022

@matinzd could you verify this fix on iOS?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
critical for release help wanted The issue has been reviewed and is valid, and is waiting for someone to work on it. Platform: iOS
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants