kfrlib / kfr

Fast, modern C++ DSP framework, FFT, Sample Rate Conversion, FIR/IIR/Biquad Filters (SSE, AVX, AVX-512, ARM NEON)
https://www.kfrlib.com
GNU General Public License v2.0
1.65k stars 253 forks source link

convolve_filter destructor get stuck for ever on GCC #92

Closed Arzaghi closed 3 years ago

Arzaghi commented 4 years ago

I use KFR on Linux and using g++. I link my application using kfr_capi however on the below program the Convolve_filter destructor get stuck forever. I trace the destructor and I think it tries to call the destructor of a Univector where it's internal pointer is null. The problem exists either when I compile the program using Clang++

#include <iostream>
#include "kfr/all.hpp"
int main(){                
    {
        kfr::univector<double> filter{1,2,3,4,5,6,7,8};
        kfr::univector<double> data{10,20,30,40,50,60,70,80,90,100};
        kfr::convolve_filter<double> convolve_filter(filter);
        convolve_filter.apply(data);

        std::cout << "filter created and applied on data!" << std::endl;        
        std::cout << "convolve_filter destructor will get stuck for ever!!?" << std::endl;        
    }   
    std::cout << "This line will never execute!!??" << std::endl;
    return 0;
}
samuelriddle commented 4 years ago

Are you using C or C++ API?

If you include "kfr/all.hpp", you are using C++, then you should link to kfr_dft. If you use C API and link to kfr_capi, then you should use C header "kfr/capi.h" and avoid using any other KFR headers.

samuelriddle commented 3 years ago

Closed as inactive. Please reopen if the issue persists.