From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1152F3889820; Thu, 24 Mar 2022 13:34:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1152F3889820 From: "marxin at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/104964] Wrong *** buffer overflow detected ***: terminated - acl Date: Thu, 24 Mar 2022 13:34:02 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: marxin at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: siddhesh at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2022 13:34:03 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104964 --- Comment #9 from Martin Li=C5=A1ka --- You should see the difference in between -D_FORTIFY_SOURCE=3D2 and -D_FORTIFY_SOURCE=3D3 in the attached pre-processed source files. $ gcc fs2.i -c -O2 -Werror $ gcc fs3.i -c -O2 -Werror In file included from /usr/include/string.h:535, from libacl/__acl_to_any_text.c:25: In function =E2=80=98strcpy=E2=80=99, inlined from =E2=80=98__acl_to_any_text=E2=80=99 at libacl/__acl_to_any= _text.c:90:3: /usr/include/bits/string_fortified.h:79:10: error: =E2=80=98__builtin___str= cpy_chk=E2=80=99 writing 1 or more bytes into a region of size 0 overflows the destination [-Werror=3Dstringop-overflow=3D] 79 | return __builtin___strcpy_chk (__dest, __src, __glibc_objsize (__dest)); |=20=20=20=20=20=20=20=20=20 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20 cc1: all warnings being treated as errors Note the warning exactly corresponds to the call that aborts during run-tim= e.=