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

            Bug ID: 109806
           Summary: 13.1.0 cc1plus stack smashing crash with C array of
                    complex structs
           Product: gcc
           Version: 13.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: amy at amyspark dot me
  Target Milestone: ---

Hi,

Coming from
https://github.com/msys2/MINGW-packages/pull/16968#issuecomment-1541465457.
I've found a crash in cc1plus 13.1.0 when building an array of ~68 structs in
C++. The crash yields no report or crash handling, it just causes g++  to
return exit code 1.

However, I was able to trap the cc1plus execution line, and then run it
manually under GDB. This yielded a symbolicated stacktrace that I've uploaded
along with the preprocessed file (it's 1.6MB, so it was impossible to attach
them here uncompressed):

https://gist.github.com/amyspark/be93638fc5b5779594dd138aa8995860

GCC version data:

Using built-in specs.
COLLECT_GCC=D:\msys64\ucrt64\bin\gcc.exe
COLLECT_LTO_WRAPPER=D:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.1.0/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../gcc-13.1.0/configure --prefix=/ucrt64
--with-local-prefix=/ucrt64/local --build=x86_64-w64-mingw32
--host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32
--with-native-system-header-dir=/ucrt64/include --libexecdir=/ucrt64/lib
--enable-bootstrap --enable-checking=release --with-arch=nocona
--with-tune=generic --enable-languages=c,lto,c++,fortran,ada,objc,obj-c++,jit
--enable-shared --enable-static --enable-libatomic --enable-threads=posix
--enable-graphite --enable-fully-dynamic-string
--enable-libstdcxx-filesystem-ts --enable-libstdcxx-time
--disable-libstdcxx-pch --enable-lto --enable-libgomp --disable-libssp
--disable-multilib --disable-rpath --disable-win32-registry --disable-nls
--disable-werror --disable-symvers --with-libiconv --with-system-zlib
--with-gmp=/ucrt64 --with-mpfr=/ucrt64 --with-mpc=/ucrt64 --with-isl=/ucrt64
--with-pkgversion=Rev4, Built by MSYS2 project
--with-bugurl=https://github.com/msys2/MINGW-packages/issues --with-gnu-as
--with-gnu-ld --enable-libstdcxx-debug --with-boot-ldflags="-static-libstdc++"
--with-stage1-ldflags="-static-libstdc++"
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 13.1.0 (Rev4, Built by MSYS2 project) 

Prior to https://github.com/msys2/MINGW-packages/pull/17094, the CFLAGS value
was (I added debug !strip to the PKGBUILD options to get debugging symbols):

-g -march=nocona -msahf -mtune=generic -O2 -pipe -Wp,-D_FORTIFY_SOURCE=2
-fstack-protector-strong -ggdb -Og
-ffile-prefix-map=/c/Users/Amalia/Desktop/MINGW-packages/mingw-w64-gcc/src=/usr/src/debug/mingw-w64-gcc

Reply via email to