Opened 19 years ago
Closed 19 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)
by , 19 years ago
Attachment: | streamdata-memory-leak.diff added |
---|
comment:1 by , 19 years ago
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.
by , 19 years ago
Attachment: | streamdata_leak_fix.2.diff added |
---|
comment:2 by , 19 years ago
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.
by , 19 years ago
Attachment: | streamdata_leak_fix.3.diff added |
---|
comment:4 by , 19 years ago
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 by , 19 years ago
Owner: | changed from | to
---|
by , 19 years ago
Attachment: | delete_all_streamdata.diff added |
---|
comment:6 by , 19 years ago
delete_all_streamdata.diff fixes the leak with a single delete in tv_rec.cpp
comment:7 by , 19 years ago
comment:10 by , 19 years ago
Component: | dvb → mythtv |
---|---|
Owner: | changed from | to
Status: | reopened → new |
comment:11 by , 19 years ago
Type: | patch → defect |
---|
comment:12 by , 19 years ago
Type: | defect → patch |
---|
comment:13 by , 19 years ago
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 by , 19 years ago
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