Hi, thanks VRonin for the reply. Turns out the problem was to do with the library of FFTW that I used.
I used separate threads to run functions from that library, which apparently are not thread safe. However, even with mutex locks they still wouldn't work. Back to the drawing board.