From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1690310591; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cKrtyiaKUi04DaYpaf9e62UA6K5+x3XKymG41aCTiHs=; b=b/oBxo6W8J/9/2AMT+H0f5FNdSprurM6OII49Ga6SuncwndHzziA8Ml5RbPbpl+dH/z/c9 hRESXC1DvR5Z5+zJubRZ4yodMwMSdLPIV/quYmGalQj68DyjSTr5pIH4CLixYA2lGoTv4A D9g8pTLO4svxMvgU16y+G0/mBVY+n48= 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> From: Keith Seitz 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 List-Id: 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