From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6A0F6385AE79; Thu, 14 Jul 2022 14:05:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6A0F6385AE79 From: "chipitsine at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/106297] New: stringop-overflow misbehaviour on atomic Date: Thu, 14 Jul 2022 14:05:53 +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.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: chipitsine at gmail dot com 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 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, 14 Jul 2022 14:05:53 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106297 Bug ID: 106297 Summary: stringop-overflow misbehaviour on atomic Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: chipitsine at gmail dot com Target Milestone: --- repro steps git clone https://github.com/haproxy/haproxy cd haproxy export CC=3D/path/to/gcc make CC=3D$CC ERR=3D1 TARGET=3Dlinux-glibc=20 error reported: src/haproxy.c: In function =E2=80=98run_poll_loop=E2=80=99: include/haproxy/atomic.h:428:39: error: =E2=80=98__atomic_load_8=E2=80=99 w= riting 8 bytes into a region of size 0 overflows the destination [-Werror=3Dstringop-overflow= =3D] 428 | #define _HA_ATOMIC_LOAD(val) __atomic_load_n(val, __ATOMIC_RELAXED) |=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/haproxy.c:2843:46: note: in expansion of macro =E2=80=98_HA_ATOMIC_LOAD= =E2=80=99 2843 | if ((_HA_ATOMIC_LOAD(&ha_tgroup_ctx[i].stopping_threads) & ha_tgroup_info[i].threads_enabled) !=3D | ^~~~~~~~~~~~~~~ compilation terminated due to -Wfatal-errors. error was reviewed by Willy Tarreau in https://github.com/haproxy/haproxy/issues/1767 and it is considered as false positive. I bisected gcc, breaking change is: https://gcc.gnu.org/git/?p=3Dgcc.git;a=3Dcommit;h=3D88b504b7a8c5affb0ffa979= 90d22af2b199e36ed=