From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) by sourceware.org (Postfix) with ESMTPS id 28AB338344C1 for ; Wed, 8 Jun 2022 18:57:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 28AB338344C1 Received: by mail-pg1-x52f.google.com with SMTP id 123so9383446pgb.5 for ; Wed, 08 Jun 2022 11:57:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=h/biZzGYEpm+k9bOmMUZz+MF14ZutB3XJq01vYrya/k=; b=R/vx5LK5lXHWWmbImVLJ78KKcCEjeiDJjvFfNykuB3RSD2Fr+tzJ234u/hps+aYy7d DSxQ4BA9lUHiJ6OS7GWzTKCQ+Ybx8HfGyiPoRUORwWbZqO0xDXM5eAYnqaeOlbhJM9dj 0LCkoO6++SxrtIY3G30/LAWZ+M2lsdvF7bqVB1YR0tI9snew4vF43Mr/JzL6bdg2WBI9 65b29Nq7GhYixu1Hsy0gITujB1GeZoXJv5b1xBznxT9qqtylaGYwcbJN+a6IxSGgOWbK owbwhPEUg2hy1vGaleLuhd0xuH1lE6eq/qqmKFTO/eSoWRi326vNNBQLu8XCmO+uiqS+ nvXg== X-Gm-Message-State: AOAM5307jXLkU9qk1iyYy97OV9H8xehkYT8Vu0FWyJEr+m2ki5gI83Q6 J2Z+YEz1LM/gSt0+BBdVOn66/w6JKvk961/3zgopqNJOjA8= X-Google-Smtp-Source: ABdhPJwPfLaZcV4ZPYtIh35Io/OS3ti/b2NdtDVZopAt6Pcj6IwrTeUw2UJUCt+htwLRS4gHqe01cSePi8UkgaL9Nfc= X-Received: by 2002:aa7:80ce:0:b0:51c:70fc:8f5d with SMTP id a14-20020aa780ce000000b0051c70fc8f5dmr2896945pfn.1.1654714668206; Wed, 08 Jun 2022 11:57:48 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: "H.J. Lu" Date: Wed, 8 Jun 2022 11:57:11 -0700 Message-ID: Subject: Re: glibc: the x86 mem[r]chr changes cause random segfaults To: Manuel Lauss Cc: Noah Goldstein , GNU C Library Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3019.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2022 18:57:50 -0000 On Wed, Jun 8, 2022 at 11:22 AM Manuel Lauss via Libc-alpha wrote: > > Hi Noah, > > One of your recent x86 mem[r]chr patches to glibc causes random segfaults in > gcc; I haven't nailed it down to a single patch yet, but a glibc built > up to commit 0218463dd8265ed937622f88ac68c7d984fe0cfc (all your > commits from 07th June reverted) works just fine. > For me it's very easy to reproduce, just rebuild glibc. > > The backtraces all look like this (sorry, no debug symbols for gcc): > #0 0x00007fdd9df1d36a in __GI___libc_free (mem=0x672f7ffcc7137ff0) at > malloc.c:3368 > warning: Source file is more recent than executable. > 3368 if (chunk_is_mmapped (p)) /* release > mmapped memory. */ > (gdb) bt > #0 0x00007fdd9df1d36a in __GI___libc_free (mem=0x672f7ffcc7137ff0) at > malloc.c:3368 > #1 0x00007fdd9debe3e0 in scratch_buffer_free (buffer=0x7ffcc7137fe0) > at ../include/scratch_buffer.h:86 > #2 realpath_stk (name=, resolved=, > rname_buf=rname_buf@entry=0x7ffcc7137fe0) at canonicalize.c:423 > #3 0x00007fdd9debeaff in __GI___realpath (name=, > resolved=) at canonicalize.c:449 I suspect that rawmemchr isn't properly handled. > #4 0x000000000048b818 in ?? () > #5 0x000000000048a62c in ?? () > #6 0x000000000040d9b4 in ?? () > #7 0x0000000000416b62 in ?? () > #8 0x00000000004054e9 in ?? () > #9 0x0000000000405a89 in ?? () > #10 0x00007fdd9dea82b7 in __libc_start_call_main > (main=main@entry=0x405a60, argc=argc@entry=103, > argv=argv@entry=0x7ffcc7139708) > at ../sysdeps/nptl/libc_start_call_main.h:58 > #11 0x00007fdd9dea8375 in __libc_start_main_impl (main=0x405a60, > argc=103, argv=0x7ffcc7139708, init=, fini= out>, rtld_fini=, > stack_end=0x7ffcc71396f8) at ../csu/libc-start.c:381 > #12 0x0000000000405bb1 in ?? () > > Thanks, > Manuel -- H.J.