[Bug c/42452] New: The application stack can be corrupted when an interrupt occurs somewhere
cwang at rossvideo dot com
gcc-bugzilla@gcc.gnu.org
Mon Dec 21 21:19:00 GMT 2009
The options given when GCC was configured/built:
Using built-in specs.
Target: arm-none-eabi
Configured with: /scratch/julian/2009q3-respin-eabi-lite/src/gcc-4.4/configure
--build=i686-pc-linux-gnu --host=i686-min
gw32 --target=arm-none-eabi --enable-threads --disable-libmudflap
--disable-libssp --disable-libstdcxx-pch --enable-extr
a-sgxxlite-multilibs --with-gnu-as --with-gnu-ld
--with-specs='%{O2:%{!fno-remove-local-statics: -fremove-local-statics}
} %{O*:%{O|O0|O1|O2|Os:;:%{!fno-remove-local-statics:
-fremove-local-statics}}}' --enable-languages=c,c++ --disable-shar
ed --disable-lto --with-newlib --with-pkgversion='Sourcery G++ Lite 2009q3-68'
--with-bugurl=https://support.codesourcer
y.com/GNUToolchain/ --disable-nls --prefix=/opt/codesourcery --with-headers=yes
--with-sysroot=/opt/codesourcery/arm-non
e-eabi
--with-build-sysroot=/scratch/julian/2009q3-respin-eabi-lite/install/host-i686-mingw32/arm-none-eabi
--with-libic
onv-prefix=/scratch/julian/2009q3-respin-eabi-lite/obj/host-libs-2009q3-68-arm-none-eabi-i686-mingw32/usr
--with-gmp=/sc
ratch/julian/2009q3-respin-eabi-lite/obj/host-libs-2009q3-68-arm-none-eabi-i686-mingw32/usr
--with-mpfr=/scratch/julian/
2009q3-respin-eabi-lite/obj/host-libs-2009q3-68-arm-none-eabi-i686-mingw32/usr
--with-ppl=/scratch/julian/2009q3-respin-
eabi-lite/obj/host-libs-2009q3-68-arm-none-eabi-i686-mingw32/usr
--with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lst
dc++,-Bdynamic -lm'
--with-cloog=/scratch/julian/2009q3-respin-eabi-lite/obj/host-libs-2009q3-68-arm-none-eabi-i686-ming
w32/usr --disable-libgomp --enable-poison-system-directories
--with-build-time-tools=/scratch/julian/2009q3-respin-eabi-
lite/obj/tools-i686-pc-linux-gnu-2009q3-68-arm-none-eabi-i686-mingw32/arm-none-eabi/bin
--with-build-time-tools=/scratch
/julian/2009q3-respin-eabi-lite/obj/tools-i686-pc-linux-gnu-2009q3-68-arm-none-eabi-i686-mingw32/arm-none-eabi/bin
Thread model: single
gcc version 4.4.1 (Sourcery G++ Lite 2009q3-68)
0011c6d0 <getFPGARefRate>:
11c6d0: b510 push {r4, lr}
11c6d2: b082 sub sp, #8
11c6d4: 466c mov r4, sp
11c6d6: 3406 adds r4, #6
11c6d8: 201d movs r0, #29
11c6da: 1c21 adds r1, r4, #0
11c6dc: 2201 movs r2, #1
11c6de: f7ff ff6f bl 11c5c0 <readFPGA>
11c6e2: b002 add sp, #8
11c6e4: 8820 ldrh r0, [r4, #0]
11c6e6: bc10 pop {r4}
11c6e8: bc02 pop {r1}
11c6ea: 4708 bx r
The returned value (r0) of the above function will be overwritten when an
interrupt occurs between address 11c6e2 and address 11c6e4 and the interrupt
service routine shares same stack with the above function. I think the quick
fix is to swap the instructions between address 11c6e2 and address 11c6e4.
--
Summary: The application stack can be corrupted when an interrupt
occurs somewhere
Product: gcc
Version: 4.4.1
Status: UNCONFIRMED
Severity: major
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: cwang at rossvideo dot com
GCC host triplet: Windows or CygWin
GCC target triplet: ARM Thumb
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42452
More information about the Gcc-bugs
mailing list