Crash caused by pipzap popup

Issue #492 resolved
prl created an issue

In some cases, the use of long-CH+/- to change the PiP channel can set the conditions for a crash.

Replication steps

The timeout for PiPZap (when the green "PIP-" text is displayed on the screen) is set by MENU>Setup>System>GUI settings>1st infobar time. Increasing this from the default 5 seconds can make replication easier.

From live TV:

  • PIP
  • long-CH+/- to change channel, this displays the "PIP-" text; PiPZap is enabled while "PIP-" is still displayed
  • PIP
  • PIP in quick succession
  • Wait for the timeout set in 1st infobar time.
  • Crash.

Notes on replication case

The problem is caused because there are two instances of the timer that controls PiPZap. One is in InfoBarChannelSelection.servicelist (the main channel selector, an instance of ChannelSelection) and the other is in InfoBarChannelSelection.servicelist2 (an instance of PiPZapSelection, a subclass of ChannelSelection).

So what happens in the sequence above is:

  • PIP starts the PiP window
  • long-CH+/- starts the timer in InfoBarChannelSelection.servicelist2 (instance of PiPZapSelection).
  • PIP starts the timer in InfoBarChannelSelection.servicelist (instance of ChannelSelection) by calling showPipzapMessage().
  • PIP cancels the timer in InfoBarChannelSelection.servicelist (instance of ChannelSelection) by calling hidePipzapMessage() and deletes self.session.pip (which has only a single instance).
  • The timer in InfoBarChannelSelection.servicelist2 (instance of PiPZapSelection) fires and calls hidePipzapMessage(). This tries to access self.session.pip, but it has been deleted above.
  • Crash.

If you wait for the "PiP-" that's raised by the long-CH+/- to disappear before pressing PIP twice, the timer problem doesn't arise.

A further small bug: showPipzapMessage() adds a reference to hidePipzapMessage() to self.pipzaptimer.callback on each call of showPipzapMessage(), but hidePipzapMessage() only removes the reference to itself from self.pipzaptimer.callback if self.pipzaptimer is active when hidePipzapMessage() is called. This means that each time self.pipzaptimer is started and completes normally, self.pipzaptimer.callback gets an additional reference to hidePipzapMessage().

This seems to be relatively innocuous, but should be fixed. There doesn't appear to be any good reason why self.pipzaptimer.callbackneeds to be updated in this way.

Comments (2)

  1. Peter Urbanec

    Fix Bug #492: Crash caused by pipzap popup

    [ChannelSelection]

    In showPipzapMessage() and hidePipzapMessage(), ensure that self.session.pip is valid before calling self.session.pip.active() and self.session.pip.inactive().

    → <<cset 20a563693970>>

  2. Log in to comment