[mythtv-commits] Ticket #4381: Using a Miscellaneous Status Information (see ticket #4049) makes mythbackend segfault occasionnally...

MythTV mythtv at cvs.mythtv.org
Wed Jan 9 03:06:48 UTC 2008


#4381: Using a Miscellaneous Status Information (see ticket #4049) makes
mythbackend segfault occasionnally...
-----------------------+----------------------------------------------------
 Reporter:  anonymous  |        Owner:  ijr 
     Type:  defect     |       Status:  new 
 Priority:  minor      |    Milestone:  0.21
Component:  mythtv     |      Version:  head
 Severity:  medium     |   Resolution:      
  Mlocked:  0          |  
-----------------------+----------------------------------------------------

Comment(by sphery <mtdean at thirdcontact.com>):

 The attached patch, mythtv-misc_status_info_popen.patch, changes the
 miscellaneous status info section to use popen() rather than the non-
 thread-safe QProcess class.  When testing before the patch, I was
 generally able to cause a segfault within an hour by running:

 while [ 1 ]; do wget http://localhost:6544/ -O /dev/null; done

 in 2 terminals (> 2 responses per second) with a miscellaneous status
 script.  After the patch, I was able to run under the same conditions for
 > 5 hours without a segfault.  It even works with the miscellaneous status
 script set to the program I wrote to always segfault.

 In making the change, I removed the 10-second timeout to keep the patch
 simple.  Without the timeout, rather than waiting 10-seconds then
 returning the status page without any of the miscellaneous status
 information, the status page request will actually wait for output.  Since
 the 10-second limit was rather arbitrary, and since a slow response may
 encourage users to fix their status scripts, I didn't think the timeout
 was worth the extra code required (especially since we could easily switch
 back to using QProcess after the QT4 transition).  If a timeout is still
 required/desired, please let me know and I'll fix the patch.  I also
 modified the README, removing mention of the timeout and recommending
 users create fast-running scripts or pre-compute values if necessary.

 This patch may break the Win32 compile, but as I don't have a system for
 testing, I didn't attempt to fix it.  If nothing else, disabling the
 miscellaneous status info section from HttpStatus and the setting in
 backendsettings.cpp for the mingw build would allow it to compile.

 Thanks to Anduin, both Stuarts, and others on IRC for helping.

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


More information about the mythtv-commits mailing list