[mythtv-commits] Ticket #4115: Network Control causes segfaults

MythTV mythtv at cvs.mythtv.org
Tue Nov 13 01:35:26 UTC 2007


#4115: Network Control causes segfaults
---------------------+------------------------------------------------------
 Reporter:  danielk  |        Owner:  danielk
     Type:  patch    |       Status:  new    
 Priority:  minor    |    Milestone:  0.21   
Component:  mythtv   |      Version:  head   
 Severity:  medium   |   Resolution:         
  Mlocked:  0        |  
---------------------+------------------------------------------------------

Comment(by danielk):

 (In [14858]) Refs #4115. Another set of related fixes for segfaults when
 using network control.

 The first fix is for MythPopupBox::defaultButtonPressedHandler(). When the
 focus is not on the popup box, like when you're testing mythtv dialogs
 with using network control from another window, then this handler will
 return a value > than the number of buttons. Many users of the
 MythPopupBox dialogs unfortunately do no range checking so this causes a
 segfault. But even if it didn't it returns the wrong value. This adds
 another loop which checks the button's isDown() return instead. This
 should always work, even when the dialog loses focus. But I also check if
 we found any pressed button from either and print an error message and
 return Reject if we don't.

 The first fix get's us past one set of segfaults, but show2ButtonPopup()
 and showButtonPopup() are also called outside the Qt event thread at times
 and since they improperly delete a QObject (the MythPopupBox) this causes
 segfaults when the Qt processes the defaultButtonPressedHandler() after
 the dialog is deleted. The fix is simply to use the proper QObject call to
 delete the dialog. This problem exists in the other static functions in
 MythPopupBox, but I was able to reliable test the segfaults this caused in
 the two functions I fixed using network control (it causes segfaults,
 albeit randomly, in the same dialogs that I used to test the
 defaultButtonPressedHandler().) I'll fix the others after I locate test
 cases for them.

-- 
Ticket URL: <http://svn.mythtv.org/trac/ticket/4115#comment:4>
MythTV <http://svn.mythtv.org/trac>
MythTV


More information about the mythtv-commits mailing list