From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4602 invoked by alias); 19 Aug 2009 22:11:41 -0000 Received: (qmail 4593 invoked by uid 22791); 19 Aug 2009 22:11:40 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00,SPF_HELO_PASS,SPF_PASS 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; Wed, 19 Aug 2009 22:11:33 +0000 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n7JMBT01013829; Wed, 19 Aug 2009 18:11:29 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n7JMBSnG000992; Wed, 19 Aug 2009 18:11:28 -0400 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n7JMBR50028014; Wed, 19 Aug 2009 18:11:27 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id 129003782EF; Wed, 19 Aug 2009 16:11:27 -0600 (MDT) From: Tom Tromey To: Paul Pluzhnikov Cc: gdb@sourceware.org Subject: Re: Solibs and objfile BFD ownership References: <20090728154001.GA19451@caradoc.them.org> <8ac60eac0907291656v13f568ebw4f3a2b9bb7c7223d@mail.gmail.com> <8ac60eac0908031749y59867374wa451d2f504483390@mail.gmail.com> <20090804145318.GA31664@caradoc.them.org> <8ac60eac0908041037q46b447d9n7b539ab53d7ce1ea@mail.gmail.com> <20090804184000.GA14873@caradoc.them.org> <8ac60eac0908041147m17f3f337g3ea15696dc0a3170@mail.gmail.com> <8ac60eac0908171544r6d1eac67lcaedb388b525c5@mail.gmail.com> Reply-To: Tom Tromey Date: Wed, 19 Aug 2009 22:29:00 -0000 In-Reply-To: <8ac60eac0908171544r6d1eac67lcaedb388b525c5@mail.gmail.com> (Paul Pluzhnikov's message of "Mon, 17 Aug 2009 15:44:11 -0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2009-08/txt/msg00185.txt.bz2 >>>>> "Paul" == Paul Pluzhnikov writes: Paul> I seem to have hit a rough patch with my patches :-( Yeah, that happens to me too. Paul> This is happening because in symbol_add_stub refcount may not be set: so-> objfile = symbol_file_add_from_bfd (so->abfd, flags, sap, OBJF_SHARED); ---> QUIT could be executed deep inside symbol_file_add_from_bfd, and ---> bfd_userdata below is never set. Paul> p_refcount = xmalloc (sizeof (*p_refcount)); Paul> *p_refcount = 2; /* Both solib and objfile refer to this abfd. */ Paul> bfd_usrdata (so->abfd) = p_refcount; I haven't had time to read this patch fully and try to understand it. It just struck me from a first reading that it would be simpler, and more conventional, to have a "gdb_bfd_ref" function, to go along with gdb_bfd_unref, which we call whenever we assign a 'bfd*' to a field somewhere. What do you think? Tom