[mythtv-commits] Ticket #9275: Backend deadlock when frontend playing video disappears from network

MythTV mythtv at cvs.mythtv.org
Mon Nov 22 19:56:29 UTC 2010


#9275: Backend deadlock when frontend playing video disappears from network
-----------------------------------+----------------------------------------
 Reporter:  doug@…                 |            Type:  Patch - Bug Fix 
   Status:  new                    |        Priority:  trivial         
Milestone:  unknown                |       Component:  MythTV - General
  Version:  Trunk Head             |        Severity:  medium          
 Keywords:                         |   Ticket locked:  0               
-----------------------------------+----------------------------------------
 I have encountered the following deadlock when a frontend is streaming
 video from the backend over a wifi link that suddenly goes down:

 {{{
 Thread 5 (Thread 0xabfd7b70 (LWP 9047)):
 #0  0xb786d424 in __kernel_vsyscall ()
 #1  0xb418ef95 in pthread_cond_wait@@GLIBC_2.3.2 () from
 /lib/libpthread.so.0
 #2  0xb42fc61b in QWaitCondition::wait(QMutex*, unsigned long) ()
    from /usr/lib/qt4/libQtCore.so.4
 #3  0xb42f662b in QReadWriteLock::lockForWrite() ()
    from /usr/lib/qt4/libQtCore.so.4
 #4  0x080d510a in MainServer::connectionClosed (this=0x8d0af28,
     socket=0xa8e04ef0) at mainserver.cpp:5436
 #5  0xb613f6a7 in MythSocket::close (this=0xa8e04ef0) at
 mythsocket.cpp:200
 #6  0xb61f8906 in MSocketDevice::writeData (this=0xa8e04ef0,
     data=0x909d4c0 "39      ERROR: Unknown file transfer socket: 50",
 len=47)
     at msocketdevice_unix.cpp:906
 #7  0xb4391f11 in QIODevice::write(char const*, long long) ()
    from /usr/lib/qt4/libQtCore.so.4
 #8  0xb62a5974 in MSocketDevice::writeBlock (this=0xa8e04ef0,
     data=0x909d4c0 "39      ERROR: Unknown file transfer socket: 50",
 len=47)
     at ../libmythdb/msocketdevice.h:111
 #9  0xb614088c in MythSocket::writeBlock (this=0xa8e04ef0,
     data=0x909d4c0 "39      ERROR: Unknown file transfer socket: 50",
 len=47)
     at mythsocket.cpp:259
 #10 0xb614224d in MythSocket::writeStringList (this=0xa8e04ef0, list=...)
     at mythsocket.cpp:332
 #11 0x080ab5cb in MainServer::SendResponse (this=0x8d0af28,
 socket=0xa8e04ef0,
     commands=...) at mainserver.cpp:1509
 #12 0x080ce358 in MainServer::HandleFileTransferQuery (this=0x8d0af28,
     slist=..., commands=..., pbs=0x915be40) at mainserver.cpp:4830
 #13 0x0809e3db in MainServer::ProcessRequestWork (this=0x8d0af28,
     sock=0xa8e04ef0) at mainserver.cpp:554
 #14 0x0809be54 in MainServer::ProcessRequest (this=0x8d0af28,
 sock=0xa8e04ef0)
     at mainserver.cpp:309
 #15 0x080dbf6d in ProcessRequestThread::run (this=0x8cfc1c8)
     at mainserver.cpp:159
 #16 0xb42fb66f in ?? () from /usr/lib/qt4/libQtCore.so.4
 #17 0xb418a8fe in start_thread () from /lib/libpthread.so.0
 #18 0xb3fd695e in clone () from /lib/libc.so.6
 }}}

 The problem occurs due to a double locking of sockListLock (within
 MainServer::HandleFileTransferQuery and also within the error handling
 callback MainServer::connectionClosed. The attached patch moves the unlock
 to before the call to SendResponse, which avoids the issue.

-- 
Ticket URL: <http://svn.mythtv.org/trac/ticket/9275>
MythTV <http://www.mythtv.org/>
MythTV Media Center


More information about the mythtv-commits mailing list