From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18813 invoked by alias); 6 Jan 2014 08:25:56 -0000 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 Received: (qmail 18790 invoked by uid 89); 6 Jan 2014 08:25:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 06 Jan 2014 08:25:54 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s068PpwJ030297 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 6 Jan 2014 03:25:51 -0500 Received: from barimba (ovpn-113-85.phx2.redhat.com [10.3.113.85]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s068PnBi027340 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 6 Jan 2014 03:25:50 -0500 From: Tom Tromey To: Hui Zhu Cc: Sergio Durigan Junior , gdb-patches ml , Edjunior Barbosa Machado , Nick Clifton Subject: Re: [PATCH] Remove gdb_bfd_stash_filename to fix crash with fix of binutils/11983 References: <52C8358B.7080101@mentor.com> <52C97EC0.3080807@mentor.com> Date: Mon, 06 Jan 2014 08:25:00 -0000 In-Reply-To: <52C97EC0.3080807@mentor.com> (Hui Zhu's message of "Sun, 5 Jan 2014 23:48:16 +0800") Message-ID: <87k3edseia.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2014-01/txt/msg00052.txt.bz2 >>>>> "Hui" == Hui Zhu writes: Hui> Thanks. Post a new version. Thanks Hui. This is definitely the direction I think the code should go. Hui> --- a/gdb/symfile-mem.c Hui> +++ b/gdb/symfile-mem.c Hui> @@ -104,11 +104,7 @@ symbol_file_add_from_memory (struct bfd Hui> if (name == NULL) Hui> nbfd-> filename = "shared object read from target memory"; Hui> else Hui> - { Hui> - nbfd->filename = name; Hui> - gdb_bfd_stash_filename (nbfd); Hui> - xfree (name); Hui> - } Hui> + nbfd->filename = name; Hui> cleanup = make_cleanup_bfd_unref (nbfd); In this hunk there are two things to note. First, there is an earlier assignment to filename (in the context above) that should use xstrdup. Second, the new assignment really ought to free the old nbfd->filename first. There are also some assignments that must be fixed that do not use gdb_bfd_stash_filename: solib-aix.c:solib_aix_bfd_open solib-darwin.c:darwin_bfd_open solib-spu.c:spu_bfd_open spu-linux-nat.c:spu_bfd_open If you don't get to this soon, no worries, I will add these to your patch tomorrow morning and check it in. Tom