[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1055750: gfortran: [armhf] Yield SIGBUS when compiling with -fstack-clash-protection



Package: gfortran
Version: 13.2.0-1
Severity: normal

Dear Maintainer,

The motivation for the present bug report comes from Bug#1055228. Since 
version 1.22.1 of dpkg-dev was released (on October 30), the plplot 
package FTBFS due to a failing compilation of one of Fortran examples, 
which is exercised as a unit test during package building.

The package built fine previously. The problem is triggered by the change 
in dpkg-buildflags, which now includes -fstack-clash-protection in 
FFLAGS.

I am attaching to this bug message a shell script that can reliably 
trigger the bug on an armhf system. Here is the output:

    $ ./gfortran-stack-clash-protection-armhf-bug.sh
    […]
    Program received signal SIGBUS: Access to an undefined portion of a memory object.

    Backtrace for this error:
    Bus error

Note that the bug does not happen on amd64. Also, it does not happen on 
armhf when the option -fstack-clash-protection is not used in the 
invocation of gfortran.

As far as I can tell, the problem is due to a global variable (tr) that 
is not correctly accessed in a private function (mypltr) of the x09f 
program. Here is what gdb tells me:

    $ gdb x09f
    […]
    (gdb) run -dev ps -o /dev/null
    Starting program: /home/rafael/fortran/x09f -dev ps -o /dev/null
    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".

    Program received signal SIGBUS, Bus error.
    0x00400dfe in x09f::mypltr (x=0, y=1, xt=1, yt=34) at x09f.f90:193
    193             xt = tr(1) * x + tr(2) * y + tr(3)

My knowledge of Fortran and gfortran is way too scarce and, therefore, I 
cannot debug the problem deeper.  There may be a programming error in 
x09f.f90 or this may be a problem with gfortran on armhf when option 
-fstack-clash-protection is given.

Any help will be appreciated.

Best,

Rafael Laboissière

Attachment: gfortran-stack-clash-protection-armhf-bug.sh
Description: Bourne shell script


Reply to: