From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id SGjxNdoXwGSd1C4AWB0awg (envelope-from ) for ; Tue, 25 Jul 2023 14:43:38 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=WgrEuti6; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id D42701E0C0; Tue, 25 Jul 2023 14:43:38 -0400 (EDT) Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 06B2A1E00F for ; Tue, 25 Jul 2023 14:43:36 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CDC3E3856951 for ; Tue, 25 Jul 2023 18:43:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CDC3E3856951 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1690310613; bh=cKrtyiaKUi04DaYpaf9e62UA6K5+x3XKymG41aCTiHs=; h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=WgrEuti64nVjWRtu1rWRckV6ssad1nZhrRSpxkCd3ROd+K15SSHxBgzr6WGI3V111 ExtMJJuoA5LyxzBJYZQDIlBkvcWpIj4kVyOgX80WUGBSiAXYfiTNLrifac+jM0dGp/ oVKB3PL3g9S0YBDcdU1k3ltgqMA6iyaZiNa5CF+o= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id B3D75385840F for ; Tue, 25 Jul 2023 18:43:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B3D75385840F Received: from mimecast-mx02.redhat.com (66.187.233.73 [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-467-OaDGrFhpN326IL5uip688Q-1; Tue, 25 Jul 2023 14:43:08 -0400 X-MC-Unique: OaDGrFhpN326IL5uip688Q-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D5EAC1C3408A; Tue, 25 Jul 2023 18:43:07 +0000 (UTC) Received: from [10.22.16.32] (unknown [10.22.16.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 88127C2C856; Tue, 25 Jul 2023 18:43:07 +0000 (UTC) Message-ID: Date: Tue, 25 Jul 2023 11:43:06 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v6 00/15] Handle variable XSAVE layouts To: John Baldwin , gdb-patches@sourceware.org References: <20230714155151.21723-1-jhb@FreeBSD.org> In-Reply-To: X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00, BODY_8BITS, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, 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: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Keith Seitz via Gdb-patches Reply-To: Keith Seitz Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 7/25/23 11:15, John Baldwin wrote: > On 7/25/23 10:17 AM, Keith Seitz wrote: >> On 7/14/23 08:51, John Baldwin wrote: >> 0x55ef54d4e9bf memcpy >>           /usr/include/bits/string_fortified.h:29 >> 0x55ef54d4e9bf _Z18i387_collect_xsavePK8regcacheiPvi >>           ../../gdb/i387-tdep.c:1543 > > Can you confirm where this is in your patched copy?  For me this line is here: > >   if (gcore) >     { >       /* Clear XSAVE extended state.  */ >       memset (regs, 0, tdep->xsave_layout.sizeof_xsave); > >       /* Update XCR0 and `xstate_bv' with XCR0 for gcore.  */ >       if (tdep->xsave_xcr0_offset != -1) >>>>     memcpy (regs + tdep->xsave_xcr0_offset, &tdep->xcr0, 8); >       memcpy (XSAVE_XSTATE_BV_ADDR (regs), &tdep->xcr0, 8); >     } Yes, that's the problem spot. > If you have a core handy, could you provide the output of 'p tdep->xsave_layout' > and 'p tdep->xsave_xcr0_offset'? > I do have a corefile: (gdb) up #6 i387_collect_xsave (regcache=0x5568a96b1ab0, regnum=-1, xsave=0x0, gcore=1) at ../../gdb/i387-tdep.c:1543 1543 memcpy (regs + tdep->xsave_xcr0_offset, &tdep->xcr0, 8); (gdb) p tdep->xsave_layout $1 = {sizeof_xsave = 0, avx_offset = 0, bndregs_offset = 0, bndcfg_offset = 0, k_offset = 0, zmm_h_offset = 0, zmm_offset = 0, pkru_offset = 0} (gdb) p tdep->xsave_xcr0_offset $2 = 464 If there's anything I can do to help, please do not hesitate to ask! Keith