[mythtv-commits] Ticket #8526: Deadlock in backend code when slave backend disconnects

MythTV mythtv at cvs.mythtv.org
Sun Jun 6 16:38:07 UTC 2010


#8526: Deadlock in backend code when slave backend disconnects
-----------------------------------+----------------------------------------
 Reporter:  doug@…                 |       Owner:  cpinkham  
     Type:  defect                 |      Status:  assigned  
 Priority:  minor                  |   Milestone:  unknown   
Component:  MythTV - General       |     Version:  Trunk Head
 Severity:  medium                 |     Mlocked:  0         
-----------------------------------+----------------------------------------

Comment(by doug@…):

 Found one more deadlock that occurs when a slave backend disappears in an
 unclean manner.

 This can happen when the MainServer::BackendQueryDiskSpace function is
 called. The the PlaybackSock::GetDiskSpace function is called in here, the
 readStringList call can timeout, which results in the socket closed
 callback being called, which creates the deadlock. Here is a backtrace
 showing the deadlocked condition in the thread:

 Thread 2 (Thread 0xaa4fdb70 (LWP 23664)):
 #0  0xb77c8424 in __kernel_vsyscall ()
 #1  0xb44390e5 in pthread_cond_wait@@GLIBC_2.3.2 () from
 /lib/libpthread.so.0
 #2  0xb459961b in QWaitCondition::wait(QMutex*, unsigned long) ()
    from /usr/lib/qt4/libQtCore.so.4
 #3  0xb459362b in QReadWriteLock::lockForWrite() ()
    from /usr/lib/qt4/libQtCore.so.4
 #4  0x080aa868 in MainServer::connectionClosed (this=0x91f66d0,
     socket=0x9202598) at mainserver.cpp:5140
 #5  0xb6090fc0 in MythSocket::close (this=0x9202598) at mythsocket.cpp:199
 #6  0xb608b72d in MythSocket::readStringList (this=0x9202598, list=...,
     timeoutMS=30000) at mythsocket.cpp:485
 #7  0x0810122d in PlaybackSock::SendReceiveStringList (this=0x91b9200,
     strlist=..., min_reply_length=0) at playbacksock.cpp:105
 #8  0x081059bf in PlaybackSock::GetDiskSpace (this=0x91b9200,
 o_strlist=...)
     at playbacksock.cpp:161
 #9  0x080b980d in MainServer::BackendQueryDiskSpace (this=0x91f66d0,
     strlist=..., consolidated=false, allHosts=true) at mainserver.cpp:4021
 #10 0x080bb525 in MainServer::GetFilesystemInfos (this=0x91f66d0,
 fsInfos=...)
     at mainserver.cpp:4123
 #11 0x08077c63 in AutoExpire::CalcParams (this=0x91f4b30) at
 autoexpire.cpp:135
 #12 0x0807aa58 in SpawnUpdateThread (autoExpireInstance=0x91f4b30)
     at autoexpire.cpp:1010
 #13 0xb443542f in start_thread () from /lib/libpthread.so.0
 #14 0xb429670e in clone () from /lib/libc.so.6

 I have attached another patch which should work around this.

-- 
Ticket URL: <http://svn.mythtv.org/trac/ticket/8526#comment:2>
MythTV <http://www.mythtv.org/>
MythTV


More information about the mythtv-commits mailing list