Modify

Ticket #10264 (closed Bug Report - Hang/Deadlock: fixed)

Opened 16 months ago

Last modified 16 months ago

deadlock in backend

Reported by: brian@… Owned by: danielk
Priority: major Milestone: 0.25
Component: MythTV - General Version: Master Head
Severity: high Keywords:
Cc: Ticket locked: no

Description

I seem to have discovered a new deadlock in master (v0.25pre-3930-g074d3e2). I will attach two stack traces of the backend while deadlocked. The symptoms are that clients cannot seem to get information from the backend. A mythtv client spins for a while and then shows no recordings at all. A mythweb client reports:

Warning at /usr/share/mythtv/mythweb/modules/tv/upcoming.php, line 91:
!!NoTrans: Invalid argument supplied for foreach()!!

Attachments

ThreadStacktrace.txt.old (120.0 KB) - added by brian@… 16 months ago.
stack trace of deadlocked threads
ThreadStacktrace.txt (114.4 KB) - added by brian@… 16 months ago.
stack trace of deadlocked threads
10264-v1.patch (1.0 KB) - added by danielk 16 months ago.
Possible fix.

Change History

Changed 16 months ago by brian@…

stack trace of deadlocked threads

Changed 16 months ago by brian@…

stack trace of deadlocked threads

comment:1 Changed 16 months ago by danielk

  • Owner set to danielk
  • Priority changed from minor to major
  • Status changed from new to assigned
  • Severity changed from medium to high
  • Milestone changed from unknown to 0.25

Looking at ThreadStacktrace?.txt I see:

Threads 13,12,11,10,9,8,7,6 are all waiting for the schedLock in Scheduler::GetAllPending?() Threads 5,3 are both waiting for the schedLock in Scheduler::GetRecording?() Thread 26 is holding the schedLock and blocking on TVRec::StartRecording?()

I suspect what is holding up the TVRec::StartRecording?() is the RecorderBase::GetRecordingQuality?() call in Thread 39.

Changed 16 months ago by danielk

Possible fix.

comment:2 Changed 16 months ago by danielk

I've attached a patch. It looks like I made a copy-n-paste error, but if someone could do a quick code review I'd appreciate it.

comment:3 Changed 16 months ago by Github

  • Status changed from assigned to closed
  • Resolution set to fixed

Fixes #10264. Removes infinite loop.

There were two copy-n-paste errors, one on the bounds check and we were also deleting elements from the wrong end of the deque. The bounds check caused the infinite loop under certain starting conditions.

Branch: master Changeset: 6b227f42bbd03e351a757d2077bcc3f40116b5c6

View

Add a comment

Modify Ticket

Action
as closed
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.