Race condition causes crash on STOP/RED Delete in Movie Player

Issue #452 resolved
prl created an issue

When [MoviePlayer] stops playing a recording and MENU>Setup>TV>Behaviour when movie is stopped is set to Return to movie list, [MovieSelection] is restarted afresh.

On startup, [MovieSelection] creates self["list"] as a MovieList, then sets its ActionMap items, and then fills self["list"] after a 10ms delay. The contents of self["list"]become valid at the end of the fill (when MovieSelection.reloadWithDelay() returns).

If RED Delete is pressed immediately after STOP is pressed on a playing movie, MovieSelection.delete() can be called between when the ActionMaps are set up and when the lists are filled. In that case, when MovieSelection.delete() calls MovieSelection.getCurrentSelection(), it returns None, but the return value is not checked, and when the returned item is used, the UI crashes.

There may be other related race conditions.

Replication steps

Enter [MovieSelection] using MEDIA from live TV. Select a recording and start it playing.

Once it is playing press STOP and RED Delete in quick succession. I have found it easiest to use two thumbs to do the presses quickly enough. The UI may crash.

Because this is a race condition, the steps may need to be repeated to cause the crash.

Comments (2)

  1. Peter Urbanec

    Fix bug #452: Race condition causes crash on STOP/RED Delete in Movie Player

    [MovieSelection]

    Check return result of MovieSelection.getCurrentSelection() before use where it wasn't previously, including in MovieSelection.delete().

    Also checked for possible similar problems with the return value of MovieSelection.getCurrent().

    → <<cset 23fc963f04b8>>

  2. Log in to comment