FFT perform throws Debug Assertion front() called on empty vector

Hi folks, can anyone help me with the following issue?
My program throws (VS19) a debug assertion when executing the line:
forwardFFT.perform(x.data(), xFFT.data(), false);

x and xFFT so defined earlier:

std::vector<juce::dsp::Complex<float>> xFFT(2*fftSize, juce::dsp::Complex<float>(0));
std::vector<juce::dsp::Complex<float>> x(2*fftSize, juce::dsp::Complex<float>(0));
for (size_t i{ 0 }; i < fftSize; i++)
            x.at(i) = juce::dsp::Complex<float>(randObj.nextFloat()*2 - 1 );

fftSize and forwardFFT defined as:

const int fftOrder = static_cast<int>(roundf(log2f((float)m)));
juce::dsp::FFT forwardFFT{ fftOrder };
auto fftSize = static_cast<int>(forwardFFT.getSize());
Debug Assertion Failed!

Program: ...\Builds\VisualStudio2019\x64\Debug\Standalone Plugin\AAIR.exe
File: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\include\vector
Line: 1539

Expression: front() called on empty vector

For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts.

I had sized the vectors to fftSize instead of 2*fftSize before but then I enlarged them to try to fix the issue as I read somewhere in the docs that perform might need extra space for the negative freqs. Anyway it is not solving the issue. I resize the vector xFFT later on in the program so that the frequency bins in forwardFFT are the same as xFFT and my freq axis.

I can’t see any calls to vector::front() in juce_FFT.cpp, so it’s not obvious exactly where the problem is coming from.

Please can you share the stack trace of the thread which emits the assertion?

Hi thanks for looking into this. I checked the stack trace more carefully and I’ve been mislead by the multithreading. The exception was actually thrown by another thread but it was appearing in my output when executing that fft perform line of code step by step.
I guess we can close/delete this discussion.