From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A72F23858D33; Thu, 11 May 2023 02:26:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A72F23858D33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683771964; bh=e8PEiF1A6C2KdH+lnu1+jm1j6Wjk4co177YeZ26QqTs=; h=From:To:Subject:Date:From; b=CaiCH92n//tjc0XsiitFHkrvu4M+jW+KwIO4bUek4dAQOq6n79y0NNU4jObGbkewq 8MQhByXGpTLKgN8Z1qOtIdfeYUueL7RoUNQmaeM8KTBcqAFd8wJ3zzPmxu/3Lo6EvA GL1WMo9nmWnZCgRTYFjlubeAXlaxGe7R/lIj1IQA= From: "amy at amyspark dot me" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/109806] New: 13.1.0 cc1plus stack smashing crash with C array of complex structs Date: Thu, 11 May 2023 02:26:03 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 13.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: amy at amyspark dot me X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109806 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 upload= ed 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=3DD:\msys64\ucrt64\bin\gcc.exe COLLECT_LTO_WRAPPER=3DD:/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=3D/ucrt64 --with-local-prefix=3D/ucrt64/local --build=3Dx86_64-w64-mingw32 --host=3Dx86_64-w64-mingw32 --target=3Dx86_64-w64-mingw32 --with-native-system-header-dir=3D/ucrt64/include --libexecdir=3D/ucrt64/lib --enable-bootstrap --enable-checking=3Drelease --with-arch=3Dnocona --with-tune=3Dgeneric --enable-languages=3Dc,lto,c++,fortran,ada,objc,obj-c= ++,jit --enable-shared --enable-static --enable-libatomic --enable-threads=3Dposix --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=3D/ucrt64 --with-mpfr=3D/ucrt64 --with-mpc=3D/ucrt64 --with-isl= =3D/ucrt64 --with-pkgversion=3DRev4, Built by MSYS2 project --with-bugurl=3Dhttps://github.com/msys2/MINGW-packages/issues --with-gnu-as --with-gnu-ld --enable-libstdcxx-debug --with-boot-ldflags=3D"-static-libst= dc++" --with-stage1-ldflags=3D"-static-libstdc++" Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 13.1.0 (Rev4, Built by MSYS2 project)=20 Prior to https://github.com/msys2/MINGW-packages/pull/17094, the CFLAGS val= ue was (I added debug !strip to the PKGBUILD options to get debugging symbols): -g -march=3Dnocona -msahf -mtune=3Dgeneric -O2 -pipe -Wp,-D_FORTIFY_SOURCE= =3D2 -fstack-protector-strong -ggdb -Og -ffile-prefix-map=3D/c/Users/Amalia/Desktop/MINGW-packages/mingw-w64-gcc/sr= c=3D/usr/src/debug/mingw-w64-gcc=