From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2A7FB3870551; Tue, 13 Dec 2022 23:39:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2A7FB3870551 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1670974774; bh=BBQBuq7YnP+wSD6Q6pWoM9DgkiUo8WRTnkW9HDBkV5A=; h=From:To:Subject:Date:In-Reply-To:References:From; b=IQnvCpb1xTEAVwKrlHdLLHWaNhWMe8xmkPAYpF/UmiSSve2nMsdG8TCRBRtL0nfGT Pk2zLeZd9vDLD49jPp00VKB/p8NVmLxMwQfvPEW6unopkubOMzLk7mIdvw56HMObiX /bTM9n4eZGaGC9JeHB0BUmFqs4PmprtnHvnToyTw= From: "goldstein.w.n at gmail dot com" 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 23:39:33 +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: goldstein.w.n at gmail dot com 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 #15 from Noah Goldstein --- (In reply to Narayanan Iyer from comment #14) > (In reply to Noah Goldstein from comment #13) > >=20 > > Can you test the following dif: > > ``` > > @@ -308,7 +308,7 @@ L(ret_nonzero_vec_end_0): > > setg %dl > > leal -1(%rdx, %rdx), %eax > > # else > > - addl %edx, %eax > > + addq %rdx, %rax > > movzbl (VEC_SIZE * -1 + SIZE_OFFSET)(%rsi, %rax), %ecx > > movzbl (VEC_SIZE * -1 + SIZE_OFFSET)(%rdi, %rax), %eax > > subl %ecx, %eax > >=20 > > ``` > >=20 > > If that fixes things I'm okay making the change. > >=20 > > I'm opposed to explicitly supporting it, but am happy > > to try and make this failure from the unsupported > > usage less dramatic. >=20 > This change sounds much better. >=20 > Is there a url that describes how to build glibc from source and use it in > my application? I just built the current/fixed memcmp into a single library and used LD_PRELOAD. This fix seems to keep it from segfaulting although I wouldn't be surprised if there are some edge cases in other impls / paths around page boundaries where it can still segfault.=20 I'll submit a patch with these changes although I'm not sure its going to get backported. --=20 You are receiving this mail because: You are on the CC list for the bug.=