Opened 15 years ago
Closed 15 years ago
#1783 closed patch (fixed)
Memory Leak - StreamDataListener Handling
Reported by: | Stuart Auchterlonie | Owned by: | danielk |
---|---|---|---|
Priority: | minor | Milestone: | 0.20 |
Component: | mythtv | Version: | head |
Severity: | medium | Keywords: | memory leak |
Cc: | Ticket locked: | no |
Description (last modified by )
Found a memory leak in the stream data Listener handling in siparser.
Patch attached.
Attachments (5)
Change History (19)
Changed 15 years ago by
Attachment: | streamdata-memory-leak.diff added |
---|
comment:1 Changed 15 years ago by
Description: | modified (diff) |
---|---|
Type: | patch → defect |
This patch won't do since the SIParser is going away and this would segfault when both SIParser and DVBRecorder delete the same object.
But the bug is valid and I'll write a proper fix within the next few weeks if no one beats me to it.
The fix will either transfer ownership of the stream data to TVRec, or just delete the stream data when we teardown a DTVSignalMonitor with a stream data that a recorder does not reference.
Changed 15 years ago by
Attachment: | streamdata_leak_fix.2.diff added |
---|
comment:2 Changed 15 years ago by
Type: | defect → patch |
---|
streamdata_leak_fix.2.diff deletes the streamdata in DTVSignalmonitor if it has no further MPEGListeners.
This resolves most of the outstanding memory leaks.
Changed 15 years ago by
Attachment: | streamdata_leak_fix.3.diff added |
---|
comment:4 Changed 15 years ago by
moved streamdata control to TVRec.
All recorders except DVBRecorder are untested. FirewireRecorderBase? and HDTVRecorder need a thorough review. I commented the creation of StreamData? in their constructors.
comment:5 Changed 15 years ago by
Owner: | changed from danielk to Stuart Auchterlonie |
---|
Changed 15 years ago by
Attachment: | delete_all_streamdata.diff added |
---|
comment:6 Changed 15 years ago by
delete_all_streamdata.diff fixes the leak with a single delete in tv_rec.cpp
comment:7 Changed 15 years ago by
comment:10 Changed 15 years ago by
Component: | dvb → mythtv |
---|---|
Owner: | changed from Stuart Auchterlonie to danielk |
Status: | reopened → new |
comment:11 Changed 15 years ago by
Type: | patch → defect |
---|
comment:12 Changed 15 years ago by
Type: | defect → patch |
---|
comment:13 Changed 15 years ago by
I've had the backend running under valgrind for the last 4hrs, and it is quite happy with it when this patch is applied.
comment:14 Changed 15 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
(In [10613]) Fixes #1783. Fixes the last stream data leak.
This is in the same piece of code from [10188] that caused segfaults and needed to be reverted in [10238]. I've added a check to make sure the MPEGStreamData is not still in use before deleting it. I've been running this for a while without any segfaults here, and Stuart A has confirmed that it fixes the leak with Valgrind.
Patch to fix memory leak in streamdata listener handling