From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7533 invoked by alias); 3 Sep 2010 20:03:17 -0000 Received: (qmail 7407 invoked by uid 22791); 3 Sep 2010 20:03:16 -0000 X-SWARE-Spam-Status: No, hits=-5.4 required=5.0 tests=AWL,BAYES_00,KAM_STOCKGEN,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 03 Sep 2010 20:03:11 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o83K388o004649 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 3 Sep 2010 16:03:08 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o83K37t8001418; Fri, 3 Sep 2010 16:03:08 -0400 Received: from [10.11.10.62] (vpn-10-62.rdu.redhat.com [10.11.10.62]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o83K37KB025624; Fri, 3 Sep 2010 16:03:07 -0400 Message-ID: <4C81547B.3010603@redhat.com> Date: Sat, 04 Sep 2010 14:29:00 -0000 From: sami wagiaalla User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.8) Gecko/20100806 Fedora/3.1.2-1.fc13 Lightning/1.0b2pre Thunderbird/3.1.2 MIME-Version: 1.0 To: Doug Evans CC: Tom Tromey , gdb-patches@sourceware.org Subject: Re: Regression for gdb.stabs/gdb11479.exp [Re: [patch 1/2] Use custom hash function with bcache] References: <4C6946E1.6000709@redhat.com> <4C6D5C83.3050602@redhat.com> <4C756132.5050301@redhat.com> <20100901082539.GA24609@host1.dyn.jankratochvil.net> <20100901161952.GX2986@adacore.com> <20100901164716.GY2986@adacore.com> <4C7E96FA.2080209@redhat.com> <4C7EA30B.7020007@redhat.com> <4C7EA94E.4010104@redhat.com> <4C7FC495.8090705@redhat.com> In-Reply-To: Content-Type: multipart/mixed; boundary="------------040805010303000209020309" X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-09/txt/msg00137.txt.bz2 This is a multi-part message in MIME format. --------------040805010303000209020309 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 339 > Blech. "never mind". We do need the memset. > The hash still includes sizeof (ginfo.value), which is reasonable (I > thought it didn't for some reason). > gcc turns it in to a move instruction anyway so no worries there. Alright, the attached patch memsets value and initializes obj_section as you suggested. Is this ok to commit ? --------------040805010303000209020309 Content-Type: text/x-patch; name="hash_regression.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="hash_regression.patch" Content-length: 1092 Fix custom hash regression. 2010-09-03 Sami Wagiaalla * psymtab.c (add_psymbol_to_bcache): Initialize obj_section. memset psymbol.ginfo.value to 0. diff --git a/gdb/psymtab.c b/gdb/psymtab.c index a5d2f98..2f1bfc6 100644 --- a/gdb/psymtab.c +++ b/gdb/psymtab.c @@ -1378,6 +1378,11 @@ add_psymbol_to_bcache (char *name, int namelength, int copy_name, { struct partial_symbol psymbol; + /* We must ensure that the entire 'value' field has been zeroed + before assigning to it, because an assignment may not write the + entire field. */ + memset (&psymbol.ginfo.value, 0, sizeof (psymbol.ginfo.value)); + /* val and coreaddr are mutually exclusive, one of them *will* be zero */ if (val != 0) { @@ -1388,6 +1393,7 @@ add_psymbol_to_bcache (char *name, int namelength, int copy_name, SYMBOL_VALUE_ADDRESS (&psymbol) = coreaddr; } SYMBOL_SECTION (&psymbol) = 0; + SYMBOL_OBJ_SECTION (&psymbol) = NULL; SYMBOL_SET_LANGUAGE (&psymbol, language); PSYMBOL_DOMAIN (&psymbol) = domain; PSYMBOL_CLASS (&psymbol) = class; --------------040805010303000209020309--