[jitsi-dev] Deadlock situation in Jitsi Hangup/New Call (Thread dump attached)


#1

Hi All,

I am having a deadlock situation in Jitsi where after a call was over, I am
unable to do a initiate a new call. Can you please help me out?
This happens when I initiate a new call when the call is already running.
Then I pressed on hangup the original call, but no avail.

I analyzed the thread dump, and I couldn't figure out which thread was
holding the lock on Object #1173:

Daemon Thread [Thread-420] (Suspended)
owns: LinkedList<E> (id=1096)
owns: Object (id=1171)
owns: SIPClientTransaction (id=1172)
* waiting for: Object (id=1173) *
Object.wait(long) line: not available [native method]
Object.wait() line: 485
Handler(BasicController).deallocate() line: 375
AudioMediaDeviceSession(MediaDeviceSession).disposePlayer(Player) line: 696
AudioMediaDeviceSession(MediaDeviceSession).disposePlayer() line: 677
AudioMediaDeviceSession(MediaDeviceSession).close() line: 336
AudioMediaStreamImpl(MediaStreamImpl).setDevice(MediaDevice) line: 1670
MediaHandler.configureStream(CallPeerMediaHandler<?>, MediaDevice,
MediaFormat, MediaStreamTarget, MediaDirection, List<RTPExtension>,
MediaStream, boolean) line: 644
MediaHandler.initStream(CallPeerMediaHandler<?>, StreamConnector,
MediaDevice, MediaFormat, MediaStreamTarget, MediaDirection,
List<RTPExtension>, boolean) line: 904
CallPeerSipImpl$1(CallPeerMediaHandler<T>).initStream(StreamConnector,
MediaDevice, MediaFormat, MediaStreamTarget, MediaDirection,
List<RTPExtension>, boolean) line: 1162
CallPeerSipImpl$1(CallPeerMediaHandlerSipImpl).doNonSynchronisedProcessAnswer(SessionDescription)
line: 1456
CallPeerSipImpl$1(CallPeerMediaHandlerSipImpl).processAnswer(SessionDescription)
line: 1264
CallPeerSipImpl$1(CallPeerMediaHandlerSipImpl).processAnswer(String) line:
1238
CallPeerSipImpl.processInviteOK(ClientTransaction, Response) line: 816
OperationSetBasicTelephonySipImpl.processInviteOK(ClientTransaction,
Response) line: 787
OperationSetBasicTelephonySipImpl.processResponse(ResponseEvent) line: 410
ProtocolProviderServiceSipImpl.processResponse(ResponseEvent) line: 672
SipStackSharing.processResponse(ResponseEvent) line: 715
EventScanner.deliverEvent(EventWrapper) line: 296
SipProviderImpl.handleEvent(EventObject, SIPTransaction) line: 196
DialogFilter.processResponse(SIPResponse, MessageChannel, SIPDialog) line:
1480
SIPClientTransaction.inviteClientTransaction(SIPResponse, MessageChannel,
SIPDialog) line: 885
SIPClientTransaction.processResponse(SIPResponse, MessageChannel,
SIPDialog) line: 548
SIPClientTransaction.processResponse(SIPResponse, MessageChannel) line: 1554
UDPMessageChannel.processMessage(SIPMessage) line: 583
UDPMessageChannel.processIncomingDataPacket(DatagramPacket) line: 492
UDPMessageChannel.run() line: 297
Thread.run() line: 662

The new call thread was waiting to acquire a lock on the playbacks Linked
list:

Thread [Thread-440] (Suspended)
owns: CallPeerSipImpl$1 (id=1095)
owns: OperationSetBasicTelephonySipImpl (id=152)
* waiting for: LinkedList<E> (id=1096) *
AudioMediaDeviceSession(MediaDeviceSession).getReceiveStreams() line: 1101
MediaStreamStatsImpl.getDownloadNbPDULost() line: 687
MediaStreamStatsImpl.updateStreamDirectionStats(MediaStreamStatsImpl$StreamDirection,
long) line: 192
MediaStreamStatsImpl.updateStats() line: 140
AudioMediaStreamImpl(MediaStreamImpl).printReceiveStreamStatistics() line:
2846
AudioMediaStreamImpl(MediaStreamImpl).close() line: 567
AudioMediaStreamImpl.close() line: 226
MediaHandler.setAudioStream(AudioMediaStream) line: 1204
MediaHandler.closeStream(CallPeerMediaHandler<?>, MediaType) line: 592
CallPeerSipImpl$1(CallPeerMediaHandler<T>).closeStream(MediaType) line: 469
CallPeerSipImpl$1(CallPeerMediaHandler<T>).close() line: 423
CallPeerSipImpl(MediaAwareCallPeer<T,U,V>).setState(CallPeerState, String,
int) line: 1058
CallPeerSipImpl(AbstractCallPeer<T,U>).setState(CallPeerState, String)
line: 916
CallPeerSipImpl.setDisconnectedState(boolean, String) line: 1684
CallPeerSipImpl.hangup(int, String) line: 1003
OperationSetBasicTelephonySipImpl.hangupCallPeer(CallPeer, int, String)
line: 1793
OperationSetBasicTelephonySipImpl.hangupCallPeer(CallPeer) line: 1771
CallManager$HangupCallThread.run() line: 3286

Please help me out with the right direction on how to avoid such a
situation.

Thanks,
Paramesh


#2

Hi All,

I am facing this issue repeatedly, and I have attached the deadlock image
for the same. Please point me to the right direction, and it will be of
great help. Thanks.

<img src=’/uploads/jitsi/original/2X/7/7d9cfa16b980c2b210b913fdb5c8669c8c6839a5.png’ width=‘690’ height=‘106’>

Thanks,
Paramesh

···

On Wed, May 21, 2014 at 4:06 PM, Parameswaran M <cegparamesh@gmail.com>wrote:

Hi All,

I am having a deadlock situation in Jitsi where after a call was over, I
am unable to do a initiate a new call. Can you please help me out?
This happens when I initiate a new call when the call is already running.
Then I pressed on hangup the original call, but no avail.

I analyzed the thread dump, and I couldn't figure out which thread was
holding the lock on Object #1173:

Daemon Thread [Thread-420] (Suspended)
owns: LinkedList<E> (id=1096)
owns: Object (id=1171)
owns: SIPClientTransaction (id=1172)
* waiting for: Object (id=1173) *
Object.wait(long) line: not available [native method]
Object.wait() line: 485
Handler(BasicController).deallocate() line: 375
AudioMediaDeviceSession(MediaDeviceSession).disposePlayer(Player) line: 696
AudioMediaDeviceSession(MediaDeviceSession).disposePlayer() line: 677
AudioMediaDeviceSession(MediaDeviceSession).close() line: 336
AudioMediaStreamImpl(MediaStreamImpl).setDevice(MediaDevice) line: 1670
MediaHandler.configureStream(CallPeerMediaHandler<?>, MediaDevice,
MediaFormat, MediaStreamTarget, MediaDirection, List<RTPExtension>,
MediaStream, boolean) line: 644
MediaHandler.initStream(CallPeerMediaHandler<?>, StreamConnector,
MediaDevice, MediaFormat, MediaStreamTarget, MediaDirection,
List<RTPExtension>, boolean) line: 904
CallPeerSipImpl$1(CallPeerMediaHandler<T>).initStream(StreamConnector,
MediaDevice, MediaFormat, MediaStreamTarget, MediaDirection,
List<RTPExtension>, boolean) line: 1162
CallPeerSipImpl$1(CallPeerMediaHandlerSipImpl).doNonSynchronisedProcessAnswer(SessionDescription)
line: 1456
CallPeerSipImpl$1(CallPeerMediaHandlerSipImpl).processAnswer(SessionDescription)
line: 1264
CallPeerSipImpl$1(CallPeerMediaHandlerSipImpl).processAnswer(String)
line: 1238
CallPeerSipImpl.processInviteOK(ClientTransaction, Response) line: 816
OperationSetBasicTelephonySipImpl.processInviteOK(ClientTransaction,
Response) line: 787
OperationSetBasicTelephonySipImpl.processResponse(ResponseEvent) line: 410
ProtocolProviderServiceSipImpl.processResponse(ResponseEvent) line: 672
SipStackSharing.processResponse(ResponseEvent) line: 715
EventScanner.deliverEvent(EventWrapper) line: 296
SipProviderImpl.handleEvent(EventObject, SIPTransaction) line: 196
DialogFilter.processResponse(SIPResponse, MessageChannel, SIPDialog)
line: 1480
SIPClientTransaction.inviteClientTransaction(SIPResponse, MessageChannel,
SIPDialog) line: 885
SIPClientTransaction.processResponse(SIPResponse, MessageChannel,
SIPDialog) line: 548
SIPClientTransaction.processResponse(SIPResponse, MessageChannel) line:
1554
UDPMessageChannel.processMessage(SIPMessage) line: 583
UDPMessageChannel.processIncomingDataPacket(DatagramPacket) line: 492
UDPMessageChannel.run() line: 297
Thread.run() line: 662

The new call thread was waiting to acquire a lock on the playbacks Linked
list:

Thread [Thread-440] (Suspended)
owns: CallPeerSipImpl$1 (id=1095)
owns: OperationSetBasicTelephonySipImpl (id=152)
* waiting for: LinkedList<E> (id=1096) *
AudioMediaDeviceSession(MediaDeviceSession).getReceiveStreams() line: 1101
MediaStreamStatsImpl.getDownloadNbPDULost() line: 687
MediaStreamStatsImpl.updateStreamDirectionStats(MediaStreamStatsImpl$StreamDirection,
long) line: 192
MediaStreamStatsImpl.updateStats() line: 140
AudioMediaStreamImpl(MediaStreamImpl).printReceiveStreamStatistics() line:
2846
AudioMediaStreamImpl(MediaStreamImpl).close() line: 567
AudioMediaStreamImpl.close() line: 226
MediaHandler.setAudioStream(AudioMediaStream) line: 1204
MediaHandler.closeStream(CallPeerMediaHandler<?>, MediaType) line: 592
CallPeerSipImpl$1(CallPeerMediaHandler<T>).closeStream(MediaType) line:
469
CallPeerSipImpl$1(CallPeerMediaHandler<T>).close() line: 423
CallPeerSipImpl(MediaAwareCallPeer<T,U,V>).setState(CallPeerState,
String, int) line: 1058
CallPeerSipImpl(AbstractCallPeer<T,U>).setState(CallPeerState, String)
line: 916
CallPeerSipImpl.setDisconnectedState(boolean, String) line: 1684
CallPeerSipImpl.hangup(int, String) line: 1003
OperationSetBasicTelephonySipImpl.hangupCallPeer(CallPeer, int, String)
line: 1793
OperationSetBasicTelephonySipImpl.hangupCallPeer(CallPeer) line: 1771
CallManager$HangupCallThread.run() line: 3286

Please help me out with the right direction on how to avoid such a
situation.

Thanks,
Paramesh