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
Change History
Changed 16 months ago by brian@…
- Attachment ThreadStacktrace.txt.old added
Changed 16 months ago by brian@…
- Attachment ThreadStacktrace.txt added
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.
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

stack trace of deadlocked threads