T4 - crash when skipping forward 'blank' minutes

Moderators: Gully, peteru

Post Reply
jacampbell
On probation
Posts: 2
Joined: Sun Sep 17, 2017 14:21

T4 - crash when skipping forward 'blank' minutes

Post by jacampbell » Sun Sep 17, 2017 14:34

T4 with beyonwiz-16.1-beyonwizt4-20170310.

Playing a recording,
press and hold 'fast forward', Skip forward (min) pop-up appears.
pressed the '< PREV' button (instead of 7) and the number of minutes field went blank,
then pressed OK -
then a crash.

Crash report attached.
Attachments
Enigma2_crash_2017-09-17_14-11-10.log
Crash log
(16.88 KiB) Downloaded 79 times

User avatar
MrQuade
Uber Wizard
Posts: 11844
Joined: Sun Jun 24, 2007 13:40
Location: Perth

Re: T4 - crash when skipping forward 'blank' minutes

Post by MrQuade » Sun Sep 17, 2017 16:14

I can reproduce this crash.

Looks like it should be a trivial fix.

FYI, have you explored all of the skip functions in the Wiz interface? You can save yourself a lot of keypresses by using the skip keys rather than typing in the number of minutes to skip.

The arrow buttons are all mapped to different skip durations by default, and you can optionally change the keypad keys such that they also perform skips of different values.....all with one keystroke.
Logitech Harmony Ultimate+Elite RCs
Beyonwiz T2/3/U4/V2, DP-S1 PVRs
Denon AVR-X3400h, LG OLED65C7T TV
QNAP TS-410 NAS, Centos File Server (Hosted under KVM)
Ubiquiti UniFi Managed LAN/WLAN, Draytek Vigor130/Asus RT-AC86U Internet
Pixel 4,5&6, iPad 3 Mobile Devices

prl
Wizard God
Posts: 32709
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Re: T4 - crash when skipping forward 'blank' minutes

Post by prl » Sun Sep 17, 2017 16:32

MrQuade wrote:
Sun Sep 17, 2017 16:14
I can reproduce this crash.

Looks like it should be a trivial fix.

I can reproduce it, too.

The problem is that the number field is empty when OK is pressed, and that empty string is passed to a function to convert a string to an integer.

There are a few possible trivial fixes. Some that come to mind are that if OK is pressed when the number field is blank, then: OK is ignored, OK does the same action as EXIT or OK does the same action as the default skip time. I'm sure that inventive minds can think of others. What fix do you want?
Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

User avatar
MrQuade
Uber Wizard
Posts: 11844
Joined: Sun Jun 24, 2007 13:40
Location: Perth

Re: T4 - crash when skipping forward 'blank' minutes

Post by MrQuade » Sun Sep 17, 2017 16:38

Not that I was asked (but when has that ever stopped me ;)). But I would vote on OK executing the EXIT function. Reason being, the field is blank, and zero minutes are implied by a blank value, so it should execute a zero minute skip.
Logitech Harmony Ultimate+Elite RCs
Beyonwiz T2/3/U4/V2, DP-S1 PVRs
Denon AVR-X3400h, LG OLED65C7T TV
QNAP TS-410 NAS, Centos File Server (Hosted under KVM)
Ubiquiti UniFi Managed LAN/WLAN, Draytek Vigor130/Asus RT-AC86U Internet
Pixel 4,5&6, iPad 3 Mobile Devices

Grumpy_Geoff
Uber Wizard
Posts: 6490
Joined: Thu Mar 05, 2009 22:54
Location: Perth

Re: T4 - crash when skipping forward 'blank' minutes

Post by Grumpy_Geoff » Sun Sep 17, 2017 16:47

MrQuade wrote:
Sun Sep 17, 2017 16:38
Not that I was asked (but when has that ever stopped me ;)). But I would vote on OK executing the EXIT function. Reason being, the field is blank, and zero minutes are implied by a blank value, so it should execute a zero minute skip.

Gets my vote too.

prl
Wizard God
Posts: 32709
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Re: T4 - crash when skipping forward 'blank' minutes

Post by prl » Sun Sep 17, 2017 17:15

Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

prl
Wizard God
Posts: 32709
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Re: T4 - crash when skipping forward 'blank' minutes

Post by prl » Sun Sep 17, 2017 17:17

MrQuade wrote:
Sun Sep 17, 2017 16:38
Not that I was asked (but when has that ever stopped me ;)). ...

The "you" was the inclusive one, not just the OP :D
Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

prl
Wizard God
Posts: 32709
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Re: T4 - crash when skipping forward 'blank' minutes

Post by prl » Sun Sep 17, 2017 17:31

MrQuade wrote:
Sun Sep 17, 2017 16:38
... But I would vote on OK executing the EXIT function. ...

I'll go with that, then, unless there are loud objections. I'll also submit the fix (a one-liner) upstream to OpenViX.
Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

IanSav
Uber Wizard
Posts: 16846
Joined: Tue May 29, 2007 15:00
Location: Melbourne, Australia

Re: T4 - crash when skipping forward 'blank' minutes

Post by IanSav » Sun Sep 17, 2017 17:34

Hi,

I assume that the code will not be changed to execute the EXIT function but will simply set the jump value to be 0, if it is an empty string, and then effectively make this a no-op.

Regards,
Ian.

prl
Wizard God
Posts: 32709
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Re: T4 - crash when skipping forward 'blank' minutes

Post by prl » Sun Sep 17, 2017 18:11

IanSav wrote:
Sun Sep 17, 2017 17:34
...
I assume that the code will not be changed to execute the EXIT function but will simply set the jump value to be 0, if it is an empty string, and then effectively make this a no-op.
...

It will have exactly the same effect as the EXIT function, but not by calling MinuteInput.cancel(). Doing it that way would require at least three more lines of code.

My fix is:

Code: Select all

diff --git a/lib/python/Screens/MinuteInput.py b/lib/python/Screens/MinuteInput.py
index 163c257..23f8ae2 100644
--- a/lib/python/Screens/MinuteInput.py
+++ b/lib/python/Screens/MinuteInput.py
@@ -63,7 +63,7 @@ class MinuteInput(Screen):
                self["minutes"].down()
 
        def ok(self):
-               self.close(int(self["minutes"].getText()))
+               self.close(int(self["minutes"].getText() or 0))
 
        def cancel(self):
                self.close(0)
Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

User avatar
peteru
Uber Wizard
Posts: 9741
Joined: Tue Jun 12, 2007 23:06
Location: Sydney, Australia
Contact:

Re: T4 - crash when skipping forward 'blank' minutes

Post by peteru » Sun Sep 17, 2017 21:45

Treating the result as 0 is less than ideal, since it causes a seek. On some media a seek of 0 can cause a fairly large skip to the nearest "access point". An invalid value or a value of zero should really be a no-op.

The one liner fix might catch a blank entry, which is a fix for this particular bug, however, that's just one symptom of insufficient input validation and lack of strong typing. For example, if a user enters another invalid value, such as 99999999, the code will still blow up.

"Beauty lies in the hands of the beer holder."
Blog.

prl
Wizard God
Posts: 32709
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Re: T4 - crash when skipping forward 'blank' minutes

Post by prl » Mon Sep 18, 2017 00:48

peteru wrote:
Sun Sep 17, 2017 21:45
Treating the result as 0 is less than ideal, since it causes a seek. On some media a seek of 0 can cause a fairly large skip to the nearest "access point". An invalid value or a value of zero should really be a no-op.

Agreed, but that error lies in InfoBarGenerics.InfoBarSeek.fwdSeekTo()/rwdSeekTo().
peteru wrote:
Sun Sep 17, 2017 21:45
The one liner fix might catch a blank entry, which is a fix for this particular bug, however, that's just one symptom of insufficient input validation and lack of strong typing. For example, if a user enters another invalid value, such as 99999999, the code will still blow up.

Agreed. MinuteInput should at least limit the width of its Component.Input component.
Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

prl
Wizard God
Posts: 32709
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Re: T4 - crash when skipping forward 'blank' minutes

Post by prl » Mon Sep 18, 2017 15:43

peteru wrote:
Sun Sep 17, 2017 21:45
.., if a user enters another invalid value, such as 99999999, the code will still blow up.

The actual limit where it blows up is ~17000 times larger, 1708031858677.

However, it would make sense to limit the skip to no more than 4-5 digits, since the maximum recording length is 24 hours or 1440 min.
Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

Grumpy_Geoff
Uber Wizard
Posts: 6490
Joined: Thu Mar 05, 2009 22:54
Location: Perth

Re: T4 - crash when skipping forward 'blank' minutes

Post by Grumpy_Geoff » Mon Sep 18, 2017 17:51

prl wrote:
Mon Sep 18, 2017 15:43
... 12 hours or 1440 min.

12 hours is 1,440 minutes :?:

prl
Wizard God
Posts: 32709
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Re: T4 - crash when skipping forward 'blank' minutes

Post by prl » Mon Sep 18, 2017 18:00

Grumpy_Geoff wrote:
Mon Sep 18, 2017 17:51
prl wrote:
Mon Sep 18, 2017 15:43
... 12 hours or 1440 min.

12 hours is 1,440 minutes :?:

No, 24 hours is. Fixed. Thanks.
Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

User avatar
peteru
Uber Wizard
Posts: 9741
Joined: Tue Jun 12, 2007 23:06
Location: Sydney, Australia
Contact:

Re: T4 - crash when skipping forward 'blank' minutes

Post by peteru » Mon Sep 18, 2017 21:35

Don't forget that the skip function is available for media from various sources, not just recordings. It would be uncommon to have a file that spans more than 24 hours, but it's not impossible.

"Beauty lies in the hands of the beer holder."
Blog.

Grumpy_Geoff
Uber Wizard
Posts: 6490
Joined: Thu Mar 05, 2009 22:54
Location: Perth

Re: T4 - crash when skipping forward 'blank' minutes

Post by Grumpy_Geoff » Mon Sep 18, 2017 22:00

peteru wrote:
Mon Sep 18, 2017 21:35
Don't forget that the skip function is available for media from various sources, not just recordings. It would be uncommon to have a file that spans more than 24 hours, but it's not impossible.

Let 'em eat cake!
They can skip again if they need to jump more than 1440 minutes :)

prl
Wizard God
Posts: 32709
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Re: T4 - crash when skipping forward 'blank' minutes

Post by prl » Mon Sep 18, 2017 22:15

peteru wrote:
Mon Sep 18, 2017 21:35
Don't forget that the skip function is available for media from various sources, not just recordings. It would be uncommon to have a file that spans more than 24 hours, but it's not impossible.

Thats why I said 4-5 digits. 4 digits is nearly 7 days, and 5 digits is nearly 70 days.
Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

jacampbell
On probation
Posts: 2
Joined: Sun Sep 17, 2017 14:21

Re: T4 - crash when skipping forward 'blank' minutes

Post by jacampbell » Tue Sep 19, 2017 07:24

Instead of making some guess about what to do, surely the correct response would be to display an error message "Non numeric minute value" or "Excessive minute value - maximum is 9999 minutes" or <whatever>.

prl
Wizard God
Posts: 32709
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Re: T4 - crash when skipping forward 'blank' minutes

Post by prl » Tue Sep 19, 2017 09:42

I'd rather fix the bugs in fixed-width numeric input in Components.Input (and it seems to be quite flaky). Fixing the width would make the width restriction feedback direct without error popups.
Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

prl
Wizard God
Posts: 32709
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Re: T4 - crash when skipping forward 'blank' minutes

Post by prl » Tue Sep 19, 2017 15:50

Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

Post Reply

Return to “Bug Reporting and Feature Requests”