Opened 15 years ago
Closed 15 years ago
Last modified 15 years ago
#7132 closed defect (fixed)
Deadlock in MpegRecorder::StopRecording() with HD-PVR
Reported by: | Owned by: | danielk | |
---|---|---|---|
Priority: | major | Milestone: | 0.22 |
Component: | MythTV - Recording | Version: | head |
Severity: | high | Keywords: | |
Cc: | Ticket locked: | no |
Description
I've been seeing an occasional deadlock (anywhere from several times per day to every few days) in MpegRecorder::StopRecording?() that leaves the backend unable to record any more shows, or unable to serve content, answer to mythweb, etc. I've tracked it down to a deadlock that happens when StartEncoding?() fails, when called from MpegRecorder::StartRecording?(). In my particular case I'm using an HD-PVR and it seems to occasionally fail to start recording (why is still unclear, beyond that an ioctl() call failing), and when that happens, MpegRecorder::StopRecording?() gets stuck waiting on a conditional variable that's never notified on. The problem seems to be that the recording has already ended, but the "encoding" member was never unset, so MpegRecorder::StopRecording?() waits for a notification that's supposed to be sent when we're done recording etc. While I was looking through this code I also found a memory leak (and another instance of this same deadlock AFAICT) in MpegRecorder::StartRecording?(), which I also fixed.
Please see attached patch.
Attachments (1)
Change History (4)
Changed 15 years ago by
Attachment: | hdpvr-deadlock-fix added |
---|
comment:1 Changed 15 years ago by
Milestone: | unknown → 0.22 |
---|---|
Status: | new → accepted |
Version: | unknown → head |
comment:2 Changed 15 years ago by
Resolution: | → fixed |
---|---|
Status: | accepted → closed |
(In [22044]) Fixes #7132. Fixes deadlock following improper handling of two error conditions in StartRecording?(). Also fixes a race condition on same variables.
Deadlock fix.