From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 439763850B37; Tue, 13 Dec 2022 18:39:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 439763850B37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1670956757; bh=xqsaqLCRu5vvsF0rMDBIP7dwaDoB1D7I3Y3iPAN7fZU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=NSCyyOqD6+3sif/qbNM9TC6OYc3fTVRueWEXLmfCChJjlpId6pRYst+/nyEEXm0Vf 60c+vd8AgI7mp0gS/SZmxoFRGilo1lN6Xs8XrzMU9u1rAlS9CV5u73AnOeLkqfVFHB 149d1Kx+mBdjei/XDBWpjemzJin+InUdKloNGh9M= From: "pinskia at gcc dot gnu.org" To: glibc-bugs@sourceware.org Subject: [Bug libc/29863] Segmentation fault in memcmp-sse2.S if memory contents can concurrently change Date: Tue, 13 Dec 2022 18:39:16 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: libc X-Bugzilla-Version: 2.36 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot 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://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D29863 --- Comment #4 from Andrew Pinski --- (In reply to Narayanan Iyer from comment #3)=20 > More importantly this code works fine prior to glibc 2.36. It fails only > with glibc 2.36. On x86_64. My bet it fails on most other targets and always had failed. The Seg fault is just saying you are violating atomicity. It is not only a race condition but the race condition is inside memcmp its= elf now since memcmp is not atomic for the whole length, it is a byte wise comparison which can be read more than once so you just happen to run into a bug in your code. Having memcmp being atomicity and reading from the memory only once is ABI thing really and x86_64 ABI does not talk about that. It just happened to w= ork on accident does not mean the behavior should go back to what it was. --=20 You are receiving this mail because: You are on the CC list for the bug.=