Closed AurusHuang closed 6 months ago
Not clear to me that this is a corruption in FFTW itself rather than a bug in xtensor
.
@stevengj Wait! I changed my code as the following and the error still exists.
fstream fs_debug;
fs_debug.open("/home/winfred/l1b-pro/data/output/debug-8-7298.csv", ios::in);
vector<float> v_result;
string cell;
while (std::getline(fs_debug, cell, ','))
{
v_result.push_back(stof(cell));
}
// This checks for a trailing comma with no data after it.
if (!fs_debug && cell.empty())
{
}
cout << v_result.size() << endl; // 4096
vector<fftw_complex> result(v_result.size());
fftw_complex *in = reinterpret_cast<fftw_complex *>(fftw_malloc(sizeof(fftw_complex) * v_result.size()));
for (int i = 0; i < v_result.size(); ++i)
{
in[i][0] = v_result[i];
in[i][1] = 0.0;
}
fftw_complex *out = reinterpret_cast<fftw_complex *>(fftw_malloc(sizeof(fftw_complex) * v_result.size()));
fftw_plan plan = fftw_plan_dft_1d(v_result.size(), in, out, FFTW_FORWARD, FFTW_ESTIMATE);
fftw_execute(plan);
fftw_destroy_plan(plan);
debug-8-7298.csv
On my machine (Rocky Linux 8.9; FFTW 3.3.5), when loading this data and execute FFTW, it reports a smallbin double linked list corruption. I'm also using xtensor-fftw, so I also opened an issue there (link)
The example is as following (C++ code):