There seems to an issue when using gcc version 9.2.0 and higher optimization levels. I had to go down to -O0, otherwise the program segfaults. I tried debugging using gdb and simple "printf", and when using gdb it would trace the segfault to the line:
Complex v = {(float)(buf[ei * 2 + 0] - 128), (float)(buf[ei * 2 + 1] - 128)};
even though the index would not point outside the allocated space of buf. When using printf to debug, it appears to segfault in the return from the function run_for_frequencies. Neither makes much sense to me. Anyway, using -O0 solved the problem so that is a workaround.
There seems to an issue when using gcc version 9.2.0 and higher optimization levels. I had to go down to -O0, otherwise the program segfaults. I tried debugging using gdb and simple "printf", and when using gdb it would trace the segfault to the line:
even though the index would not point outside the allocated space of buf. When using printf to debug, it appears to segfault in the return from the function
run_for_frequencies. Neither makes much sense to me. Anyway, using -O0 solved the problem so that is a workaround.