From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from omta37.uswest2.a.cloudfilter.net (omta37.uswest2.a.cloudfilter.net [35.89.44.36]) by sourceware.org (Postfix) with ESMTPS id 08B513858D28 for ; Wed, 30 Aug 2023 20:15:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 08B513858D28 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com Received: from eig-obgw-5002a.ext.cloudfilter.net ([10.0.29.215]) by cmsmtp with ESMTP id bFOcqTfEoQFHRbRb9qnqPx; Wed, 30 Aug 2023 20:15:31 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id bRb7qQ3e5dh4DbRb8qdlLL; Wed, 30 Aug 2023 20:15:30 +0000 X-Authority-Analysis: v=2.4 cv=Zu7+lv3G c=1 sm=1 tr=0 ts=64efa362 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=OWjo9vPv0XrRhIrVQ50Ab3nP57M=:19 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=UttIx32zK-AA:10 a=Qbun_eYptAEA:10 a=CCpqsmhAAAAA:8 a=zstS-IiYAAAA:8 a=75FAf6A6GYzAqeeAwkAA:9 a=ul9cdbp4aOFLsgKbc677:22 a=4G6NA9xxw8l3yy4pmD5M:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:References :Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=YwKENYm0U0VPnP4id55BWuz2eFseDP3cXRozQQ1kN+I=; b=w0IOEjceCNcBOtP8KAfhRS0ght uRA9MOCFGlp3xT66TAj+PtmtIjjbvi7f3AJ6K5ghRgJKUXSA7UnpB1MIWdt+fYoqMdTM9yEIF4iaZ IXNzW4GsY8n8Ti7OnH9Y9kKeq; Received: from 75-166-150-212.hlrn.qwest.net ([75.166.150.212]:34670 helo=murgatroyd) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1qbRb7-0041Bm-1F; Wed, 30 Aug 2023 14:15:29 -0600 From: Tom Tromey To: Tom de Vries via Gdb-patches Cc: Tom de Vries Subject: Re: [PATCH 1/6] [gdb/symtab] Fix uninitialized memory in buildsym_compunit::finish_block_internal References: <20230830191336.15885-1-tdevries@suse.de> X-Attribution: Tom Date: Wed, 30 Aug 2023 14:15:28 -0600 In-Reply-To: <20230830191336.15885-1-tdevries@suse.de> (Tom de Vries via Gdb-patches's message of "Wed, 30 Aug 2023 21:13:31 +0200") Message-ID: <87v8cwqobj.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 75.166.150.212 X-Source-L: No X-Exim-ID: 1qbRb7-0041Bm-1F X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 75-166-150-212.hlrn.qwest.net (murgatroyd) [75.166.150.212]:34670 X-Source-Auth: tom+tromey.com X-Email-Count: 1 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfL6y5DdWBGdbyU75Er6lBf900Ll7VqxgkllsylGUk43lSwk6GoFDZ+keFmLIe1tu8XgRGEJrbYsljGoTLYDHhrR+Yd7yJbCze7DIx7iFQrGbD35eRBji 2vItC2XV3Nlb1lzUCYsL0jaIFwOHcwtcZ2ZI7u5PdjToDAx7+54CjMvaeP0rgLd0ineskycq702TpSlc/8pa51sDS+Bvw8kBqK0= X-Spam-Status: No, score=-3019.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,JMQ_SPF_NEUTRAL,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: >>>>> "Tom" == Tom de Vries via Gdb-patches writes: Tom> When running test-case gdb.dwarf2/per-bfd-sharing.exp with target board stabs, Tom> gdb either segfaults or asserts due to reading uninitialized memory, allocated Tom> here in buildsym_compunit::finish_block_internal: Tom> ... Tom> ftype-> set_fields Tom> ((struct field *) Tom> TYPE_ALLOC (ftype, nparams * sizeof (struct field))); Tom> ... Tom> Fix this by using TYPE_ZALLOC instead. At first I was curious about the history of what changed here, but now I see that dwarf2_attach_fields_to_type is doing the zalloc thing, so I think it's just the usual thing where nobody uses or tests non-DWARF stuff (and why would they) so it wasn't caught in some earlier change. Approved-By: Tom Tromey Tom