Opened 9 years ago

Closed 9 years ago

#8902 closed defect (fixed)

Segfault on Input Connections page

Reported by: Nick Morrott <knowledgejunkie <at> gmail <dot> com> Owned by: robertm
Priority: minor Milestone: 0.24
Component: MythTV - Mythtv-setup Version: Master Head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

With no capture cards defined, opening and interacting with the Input Connections page in mythtv-setup can trigger a segfault.

Backtrace attached, generated against r26193.

Attachments (1)

8902-gdb-r26193-inputconnections.log (22.6 KB) - added by Nick Morrott <knowledgejunkie <at> gmail <dot> com> 9 years ago.

Download all attachments as: .zip

Change History (13)

Changed 9 years ago by Nick Morrott <knowledgejunkie <at> gmail <dot> com>

comment:1 Changed 9 years ago by Nicolas Riendeau

Status: newinfoneeded_new

Nick, are there any specific steps needed to reproduce this?

It sounds like you are doing something that should only be done if there are tuners defined and that screen doesn't test for it...

comment:2 Changed 9 years ago by Nicolas Riendeau

Status: infoneeded_newnew

Assuming that code did not change it might be related to ticket #5333 which was opened two years ago for 0.21 (and was not reproduceable) so it's probably pretty difficult to reproduce...

I am tempted to close this unless you can provide us with the steps needed to reproduce it since this code will most likely be rewritten for 0.25...

comment:3 Changed 9 years ago by Nicolas Riendeau

Status: newinfoneeded_new

(Why won't Trac keep the last status...)

comment:4 Changed 9 years ago by Nick Morrott <knowledgejunkie <at> gmail <dot> com>

Testing was carried out (on Fedora 11, unlike the Ubuntu ticket #5333) both immediately after

i) Delete all capture cards ii) Delete all video sources

and after restarting mythtv-setup with no capture cards/video sources defined. Open the Input Connections dialog and press enter.

It would appear that the test for defined cards (and/or videosources) either doesn't exist or is not thorough enough in either situation - I don't know the code to say.

I am aware of the upcoming mythtv-setup rewrite, but this won't make it into 0.24. From the POV of a long-time user considering a new end-user's experience[*], it shouldn't be possible to crash mythtv-setup so easily even if "It sounds like you are doing something that should only be done if there are tuners defined".

It's not for me to say whether this is worth fixing, or how long it's been there. My primary motivation is to improve this and future releases. At least the list of XMLTV grabbers is populated in a couple of seconds now when using XMLTV 0.5.58...

[*] one of the reasons for the flurry of tickets some weeks ago

comment:5 Changed 9 years ago by Nicolas Riendeau

Milestone: unknown0.24
Status: infoneeded_newnew

(switch to new to so I can later assign it)

comment:6 Changed 9 years ago by Nicolas Riendeau

Owner: changed from danielk to robertm
Status: newassigned

Assigning it to robertm which tells me (on #mythtv) he has a patch for the problem.

comment:7 Changed 9 years ago by robertm

(In [26194]) Check that cardinputs is not null before calling exec. Refs #8902. Nick, can you please SVN up and see if this does the trick? The segfault may be caused by the listbox->getValue() instead, but this is a safe first step.

comment:8 Changed 9 years ago by Nick Morrott <knowledgejunkie <at> gmail <dot> com>

Updated to r26195 and it's still segfaulting - I guess it's listbox->getValue() causing the problem.

comment:9 Changed 9 years ago by robertm

(In [26198]) Another shot at addressing #8902. Nick, if this doesn't fix the issue, please attach an updated BT so we can see what exactly it's dying on. Refs #8902.

comment:10 Changed 9 years ago by robertm

(In [26199]) Check that cardinputs.size() != 0 before trying to do anything with the cardinputs. I'm slow, but eventually I get there. Refs #8902.

comment:11 Changed 9 years ago by Nick Morrott <knowledgejunkie <at> gmail <dot> com>

This now seems to be fixed (tested with r26227). I've tested after deleting existing cards/sources in the same setup session, and also after restarting mythtv-setup with no cards/sources defined. Opening the Input Connections page with no capture cards defined now bounces the user back to the main setup menu in both instances.

In the mythtv-setup rewrite it might be helpful to display an informative dialog before returning to the menu (something like "You need to define at least one capture card and one video source to configure your input connections") and also to require at least one video source before allowing interaction with the page. Alternatively, disabling/hiding the Input Connections page until these conditions are met might also simplify things.

comment:12 Changed 9 years ago by robertm

Resolution: fixed
Status: assignedclosed

Since the rewrite won't work even remotely like it does now, any such message won't be relevant (ie, it's not just a port to another interface type, it's a total rethink). Thanks for reporting back.

Note: See TracTickets for help on using tickets.