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

Fixes a crash when recording & multitasking #109

Merged
merged 1 commit into from
Apr 26, 2021

Conversation

bjtitus
Copy link
Collaborator

@bjtitus bjtitus commented Apr 23, 2021

While recording a video and dismissing the app through multitasking, the app will crash with a SIGKILL error. The crash line indicates a stall with a semaphore.wait() call when stopping the recording:

stopRecordingSemaphore.wait()

The reason seems to indicate a timeout issue with watchdog causing the crash:

Termination Description: SPRINGBOARD, <RBSTerminateContext| domain:10 code:0x8BADF00D explanation:scene-update watchdog transgression: application<org.wordpress>:10245 exhausted real (wall clock) time allowance of 10.00 seconds | ProcessVisibility: Foreground | ProcessState: Running | WatchdogEvent: scene-update | WatchdogVisibility: Background | WatchdogCPUStatistics: ( | "Elapsed total CPU time (seconds): 13.150 (user 13.150, system 0.000), 22% CPU", | "Elapsed application CPU time (seconds): 0.013, 0% CPU" | ) reportType:CrashLog maxTerminationResistance:Interactive>

It's not safe to wait for a semaphore while on the main thread and I believe that's what we're seeing here.

The minor change switches back to the original local property to avoid calling the stop method multiple times. All of the call sites using the stopRecordingVideo and startRecordingVideo methods appear to occur on the main thread so I don't believe it's necessary to dispatch to a synchronous queue to avoid race conditions.

Testing

  1. Begin recording by holding the record button
  2. Swipe up from the bottom to enter multitasking
  3. Continue swiping up to go back to the home screen
  4. Tap the App's icon on the home screen
  5. Verify that the recording screen is shown and interaction is possible

@bjtitus bjtitus added the bug Something isn't working label Apr 23, 2021
@bjtitus bjtitus requested a review from afterxleep April 23, 2021 19:24
@bjtitus bjtitus self-assigned this Apr 23, 2021
Copy link
Contributor

@afterxleep afterxleep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bjtitus bjtitus merged commit 67f3158 into main Apr 26, 2021
@bjtitus bjtitus deleted the fix/recording-multitasking branch April 26, 2021 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants