[mythtv-commits] Ticket #3720: Backend can recursively send messages to itself with a socket to connected to itself

MythTV mythtv at cvs.mythtv.org
Wed Aug 15 04:02:16 UTC 2007


#3720: Backend can recursively send messages to itself with a socket to connected
to itself
-----------------------+----------------------------------------------------
 Reporter:  anonymous  |        Owner:  ijr    
     Type:  defect     |       Status:  new    
 Priority:  minor      |    Milestone:  unknown
Component:  mythtv     |      Version:  head   
 Severity:  medium     |   Resolution:         
  Mlocked:  0          |  
-----------------------+----------------------------------------------------

Comment(by gdragon at jetcom.org):

 I have developed 2 patches that seem to solve this problem. At least in my
 testing they cover the aforementioned reproducible scenario.

 One is in the camp of "don't do that it hurts" and the other is a "good"
 fix imho.

 The "good" fix prevents the MBE from opening an event socket to receive
 "Events" on. If a socket is opened to get these events, the MBE will try
 to send an event to himself, and it will go into an infinite recursion
 loop. This is bad. The fix entails adding a check to ConnectMasterServer
 and checking IsMasterBackend before blindly opening this socket.  We still
 will create the serverSock that is used to query the MBE, this socket is
 not strictly required, since we are the MBE, but it allows for all the
 socket calls on there to just work.
 [[BR]]
 This patch is good since it protects against this problem occurring in the
 future (or already lurking) calls to ConnectMasterServer or any number of
 functions that call it are called from the MBE, such as
 SendReceiveStringList.
 [[BR]]
 This patch is attached as no-master-connect2.patch

 The "don't do that it hurts" patch prevents the one case noted above from
 calling RemoteCheckFile. RemoteCheckFile is only used to obtain the
 recording directory of a potentially currently recording file. The preview
 generator does not require this info, and shouldn't affect the use of
 recDir which is apparently StorageGroups.
 Michael Bishop pointed out to me that the NVP is invoked with a user of
 "Preview" rather than "preview_generator". The attached patch simply
 renames the user and does not trigger the check of recdir. [[BR]]
 It is attached as preview_doesnt_do_remotecheckfile.patch

 Personally I think that both of these patches should be incorporated into
 the tree. The second solves the one case that I found to recreate this
 problem, but I have a feeling that there are/will be more. The 1st patch
 should prevent any further problems like these from creeping in.

 Any questions/comments feel free.

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


More information about the mythtv-commits mailing list