View Issue Details

IDCategoryLast Update
0007061bugs2020-04-19 20:18
ReporternstewartAssigned Topaul 
Reproducibilityhave not tried 
Status closedResolutionfixed 
PlatformallOSallOS Versionall
Product Version5.X git (version in description) 
Fixed in Version 
Summary0007061: memory leak in TempoTrack::findMeter
Descriptionint TempoTrack::findMeter() leaks dbf array
git: 44b41e3058437928a83530c5e6120b87a4865387
Additional InformationFound this with cppcheck. Appears to be a simple leak, but I'm not sure if this code is still used. I couldn't immediately figure out how to exercise it. There is also a TempoTrackV2 class, and now that vamp support is here - I was unsure if we should have three versions of this QM plugin laying around.
TagsNo tags attached.



2016-10-05 09:50

administrator   ~0018771

Do you have more information from cppcheck where the leak is?

The qm-dsp library in Ardour's source is out-dated. Ideally it should be updated to new upstream which hopefully does not have this issue anymore.

The good news is that the code in question is indeed not currently used. The only code still using qm-dsp in Ardour itself is qm-onsetdetector (also an ancient copy of which does not track tempo.

Then again, since it's now possible to run VAMP plugins from a Lua-script, bundling updated vamp-plugins cross-platform has higher priority..


2016-10-05 11:19

reporter   ~0018772

I left it out because cppcheck simply says where it goes out of scope, (like 548). In this case the fix is trivial:
diff --git a/libs/qm-dsp/dsp/tempotracking/TempoTrack.cpp b/libs/qm-dsp/dsp/tempotracking/TempoTrack.cpp
index c36385f..766522f 100644
--- a/libs/qm-dsp/dsp/tempotracking/TempoTrack.cpp
+++ b/libs/qm-dsp/dsp/tempotracking/TempoTrack.cpp
@@ -545,6 +545,7 @@ int TempoTrack::findMeter(double *ACF, unsigned int len, double period)
+ delete dbf[];
     return tsig;

However I suspect the code could probably be removed entirely.


2016-10-05 12:39

developer   ~0018773

It looks like the code is unchanged upstream:

Better to fix it there if necessary first IMO.


2016-10-12 21:45

administrator   ~0018794

applied patch sent out-of-band via email.


2020-04-19 20:18

developer   ~0023659

Issue has been closed automatically, by Trigger Close Plugin.
Feel free to re-open with additional information if you think the issue is not resolved.

Issue History

Date Modified Username Field Change
2016-10-05 04:57 nstewart New Issue
2016-10-05 09:50 x42 Note Added: 0018771
2016-10-05 11:19 nstewart Note Added: 0018772
2016-10-05 12:39 timbyr Note Added: 0018773
2016-10-12 21:45 paul Note Added: 0018794
2016-10-12 21:45 paul Status new => resolved
2016-10-12 21:45 paul Resolution open => fixed
2016-10-12 21:45 paul Assigned To => paul
2020-04-19 20:18 system Note Added: 0023659
2020-04-19 20:18 system Status resolved => closed