Closed debrowne closed 7 years ago
Hi,
Function shown in the error message isn't the function caused heap corruption, it's the function detected it. Corruption itself happened somewhere before call to this function.
The free
function called inside convolve_filter
destructor has detected heap corruption that happened before, anywhere in the code or in any used library.
The most frequent cause of heap corruption is writing an array out of its bounds.
Try to find minimal code that reproduces this issue.
And check that index
variable never exceeds size
parameter, because in that case IR
array will be written out of bounds.
I am having sporadic issues with convolve_filter, which has been causing heap corruption errors when its destructor is called. I have implemented it in a simple wrapper class that constructs FIR filters and filters signals:
The usage is typically along the lines of:
The error is not 100% consistent and I cannot figure out what could cause it. It happens when I call convolve_filter methods on other objects as well - not just instances of this class. I can sometimes get the error to temporarily go away by changing the block_size of the convolve_filter, but other times it works fine with the block_size equal to the size of the filter. In any case, the filtering is usually performed appropriately, and the heap corruption error appears when the convolve filter destructor is called.
stack trace: KFR ConvolveFilter heap corruption call stack.txt
Environment: Windows 10 Visual Studio 2015 LLVM-vs2014 / Clang 5.0