public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/97969] New: [ARM/Thumb] Certain combo of codegen options leads to compilation infinite loop with growing memory use
@ 2020-11-24 15:22 pmiscml at gmail dot com
  2020-11-24 15:24 ` [Bug c/97969] " pmiscml at gmail dot com
                   ` (29 more replies)
  0 siblings, 30 replies; 31+ messages in thread
From: pmiscml at gmail dot com @ 2020-11-24 15:22 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97969

            Bug ID: 97969
           Summary: [ARM/Thumb] Certain combo of codegen options leads to
                    compilation infinite loop with growing memory use
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pmiscml at gmail dot com
  Target Milestone: ---

Created attachment 49619
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49619&action=edit
Testcase minimized with CReduce

Attached in the creduce-minimized source code (and original preprocessed
source) which, when compiled with ARM (32-bit) targeting compiler with certain
options, and a code with setjmp(), leads to an apparent infinite loop with
ever-growing memory usage.

Specific command line to reproduce the issue is:

arm-zephyr-eabi-gcc -std=c99 \
-fno-omit-frame-pointer \
-mthumb \
-Os \
-x cpp-output -c js-parser_cpp.c

The combo of 3 of "-fno-omit-frame-pointer -mthumb -Os" is what causes the
issue. Removing any of them gets rid of it.

The issue is not speculative - it happens with JerryScript project
(https://github.com/jerryscript-project/jerryscript/) build against Zephyr RTOS
(https://github.com/zephyrproject-rtos/zephyr/) for a Cortex-M0 target
(original gcc options included -mcpu=cortex-m0plus, but as the issue is
reproducible with just -mthumb, I didn't include it above). The nature of the
issue is pretty DoS'ish/CVE'ish, indeed, it caused our AWS-based CI to run
builds for 12+ hrs (which normally take 10 mins).

The issue happens with GCC 10.2, which is the latest at the time of reporting,
but also with 9.2.0. Specific GCC build comes from the SDK of the mentioned
Zephyr RTOS, which is built using Crosstool-NG, definitely with some patches,
but shouldn't be anything serious which might cause such behavior. It's however
my intention to try other toolchains, I just decided first to record currently
available information in this ticket.




$ /home/pfalcon/opt/zephyr-sdk-0.12.0b1/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
-v
Using built-in specs.
COLLECT_GCC=/home/pfalcon/opt/zephyr-sdk-0.12.0b1/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
COLLECT_LTO_WRAPPER=/mnt/hdd/opt/zephyr-sdk-0.12.0b1/arm-zephyr-eabi/bin/../libexec/gcc/arm-zephyr-eabi/10.2.0/lto-wrapper
Target: arm-zephyr-eabi
Configured with:
/workdir/build/build_arm/.build/arm-zephyr-eabi/src/gcc/configure
--build=x86_64-build_pc-linux-gnu --host=x86_64-build_pc-linux-gnu
--target=arm-zephyr-eabi --prefix=/workdir/build/output/arm-zephyr-eabi
--with-local-prefix=/workdir/build/output/arm-zephyr-eabi/arm-zephyr-eabi
--with-headers=/workdir/build/output/arm-zephyr-eabi/arm-zephyr-eabi/include
--with-newlib --enable-threads=no --disable-shared
--with-pkgversion='crosstool-NG 1.24.0.192_9551914' --enable-__cxa_atexit
--disable-libgomp --disable-libmudflap --disable-libmpx --disable-libssp
--disable-libquadmath --disable-libquadmath-support
--with-gmp=/workdir/build/build_arm/.build/arm-zephyr-eabi/buildtools
--with-mpfr=/workdir/build/build_arm/.build/arm-zephyr-eabi/buildtools
--with-mpc=/workdir/build/build_arm/.build/arm-zephyr-eabi/buildtools
--with-isl=/workdir/build/build_arm/.build/arm-zephyr-eabi/buildtools
--enable-lto --with-host-libstdcxx='-static-libgcc
-Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --disable-nls --enable-multiarch
--with-multilib-list=rmprofile --enable-languages=c,c++ --with-gnu-ld
--with-gnu-as --enable-initfini-array
Thread model: single
Supported LTO compression algorithms: zlib
gcc version 10.2.0 (crosstool-NG 1.24.0.192_9551914) 



$ /home/pfalcon/opt/zephyr-sdk-0.11.4/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
-v
Using built-in specs.
COLLECT_GCC=/home/pfalcon/opt/zephyr-sdk-0.11.4/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
COLLECT_LTO_WRAPPER=/mnt/hdd/opt/zephyr-sdk-0.11.4/arm-zephyr-eabi/bin/../libexec/gcc/arm-zephyr-eabi/9.2.0/lto-wrapper
Target: arm-zephyr-eabi
Configured with:
/home/buildslave/src/github.com/zephyrproject-rtos/sdk-ng/build/build_arm/.build/arm-zephyr-eabi/src/gcc/configure
--build=x86_64-build_pc-linux-gnu --host=x86_64-build_pc-linux-gnu
--target=arm-zephyr-eabi
--prefix=/home/buildslave/src/github.com/zephyrproject-rtos/sdk-ng/build/output/arm-zephyr-eabi
--with-local-prefix=/home/buildslave/src/github.com/zephyrproject-rtos/sdk-ng/build/output/arm-zephyr-eabi/arm-zephyr-eabi
--with-headers=/home/buildslave/src/github.com/zephyrproject-rtos/sdk-ng/build/output/arm-zephyr-eabi/arm-zephyr-eabi/include
--with-newlib --enable-threads=no --disable-shared
--with-pkgversion='crosstool-NG 1.24.0.37-3f461da-dirty' --enable-__cxa_atexit
--disable-libgomp --disable-libmudflap --disable-libmpx --disable-libssp
--disable-libquadmath --disable-libquadmath-support
--with-gmp=/home/buildslave/src/github.com/zephyrproject-rtos/sdk-ng/build/build_arm/.build/arm-zephyr-eabi/buildtools
--with-mpfr=/home/buildslave/src/github.com/zephyrproject-rtos/sdk-ng/build/build_arm/.build/arm-zephyr-eabi/buildtools
--with-mpc=/home/buildslave/src/github.com/zephyrproject-rtos/sdk-ng/build/build_arm/.build/arm-zephyr-eabi/buildtools
--with-isl=/home/buildslave/src/github.com/zephyrproject-rtos/sdk-ng/build/build_arm/.build/arm-zephyr-eabi/buildtools
--enable-lto --with-host-libstdcxx='-static-libgcc
-Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --disable-nls --enable-multiarch
--with-multilib-list=rmprofile --enable-languages=c,c++ --with-gnu-ld
--with-gnu-as --enable-initfini-array
Thread model: single
gcc version 9.2.0 (crosstool-NG 1.24.0.37-3f461da-dirty)

^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2022-05-27  8:57 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-24 15:22 [Bug c/97969] New: [ARM/Thumb] Certain combo of codegen options leads to compilation infinite loop with growing memory use pmiscml at gmail dot com
2020-11-24 15:24 ` [Bug c/97969] " pmiscml at gmail dot com
2020-11-24 15:33 ` pmiscml at gmail dot com
2020-11-24 15:43 ` [Bug c/97969] [9/10/11 Regression][ARM/Thumb] " ktkachov at gcc dot gnu.org
2020-11-25  8:17 ` [Bug target/97969] " rguenth at gcc dot gnu.org
2020-11-25 17:15 ` ktkachov at gcc dot gnu.org
2020-11-27 12:25 ` pmiscml at gmail dot com
2020-11-27 17:32 ` ktkachov at gcc dot gnu.org
2020-12-06  4:34 ` haoxintu at gmail dot com
2020-12-07  9:56 ` ktkachov at gcc dot gnu.org
2020-12-07 10:04 ` haoxintu at gmail dot com
2020-12-07 10:34 ` pmiscml at gmail dot com
2020-12-07 10:38 ` pmiscml at gmail dot com
2020-12-07 10:56 ` haoxintu at gmail dot com
2021-01-11 20:32 ` vmakarov at gcc dot gnu.org
2021-01-12  8:31 ` wirkus at gcc dot gnu.org
2021-01-12 15:11 ` vmakarov at gcc dot gnu.org
2021-01-12 15:12 ` vmakarov at gcc dot gnu.org
2021-01-12 15:38 ` wirkus at gcc dot gnu.org
2021-01-12 16:28 ` cvs-commit at gcc dot gnu.org
2021-01-13 17:24 ` pmiscml at gmail dot com
2021-01-15 10:02 ` wirkus at gcc dot gnu.org
2021-01-20 17:37 ` vmakarov at gcc dot gnu.org
2021-01-21 23:10 ` vmakarov at gcc dot gnu.org
2021-05-04 12:31 ` [Bug target/97969] [9/10/11/12 " rguenth at gcc dot gnu.org
2021-05-25  9:18 ` przemyslaw.wirkus at arm dot com
2021-05-25  9:39 ` rguenth at gcc dot gnu.org
2021-05-25 10:06 ` wirkus at gcc dot gnu.org
2021-06-01  8:19 ` [Bug target/97969] [9/10 " rguenth at gcc dot gnu.org
2021-06-02 22:26 ` cvs-commit at gcc dot gnu.org
2022-05-27  8:57 ` [Bug target/97969] [9 " rguenth at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).