FFTW / fftw3

DO NOT CHECK OUT THESE FILES FROM GITHUB UNLESS YOU KNOW WHAT YOU ARE DOING. (See below.)
GNU General Public License v2.0
2.66k stars 651 forks source link

Seg faults doing single 1D complex FFTs on 32-bit ARM NEON hard-float with GCC >= 9 #213

Open njpillitteri opened 3 years ago

njpillitteri commented 3 years ago

I am getting seg faults when I compile FFTW for a Zynq 1 processor part (ADRV9361-Z7035 SoM) using GCC 9.2 (https://developer.arm.com/-/media/Files/downloads/gnu-a/9.2-2019.12/binrel/gcc-arm-9.2-2019.12-x86_64-arm-none-linux-gnueabihf.tar.xz) and GCC 9.3 (cross-compiler built from Yocto Dunfell distribution) and NEON enabled. I do not have any issues when using GCC 8.3 (https://developer.arm.com/-/media/Files/downloads/gnu-a/8.3-2019.03/binrel/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf.tar.xz). and other older versions of GCC that I tried (some pre-built Linaro toolchains).

The seg faults don't occur if I compile with GCC 9 and NEON disabled, but as expected performance is significantly diminished.

bmagistro commented 3 years ago

I can confirm this also affects Yocto Zeus (segfaults when using fftw). I did not investigate to the same extent as the submitter. I pulled gcc-8.3 back in as a work around for me.

Edit: I've been told this issue is likely related to/duplicate of https://github.com/FFTW/fftw3/issues/182

workzb commented 3 years ago

Having recently run into this exact issue an alternative temporary solution, until this gets fixed in fftw, is to disable the neon architecture when building FFTW. This seems to resolve whatever the issue is and allows the use of the most recent GCC compilers in Zeus.

njpillitteri commented 3 years ago

With the help of a colleague, this can also be worked around by not compiling with optimization (e.g. -O0 flag). Yocto Zynq tools by default do -O2.

This could be a GCC bug, but to update I'm still seeing it with GCC 10.2 in Yocto Gatesgarth.

balister commented 1 year ago

I built fftw with gcc-9.5.0 and the QA runs successfully!