From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1632 invoked by alias); 4 Mar 2009 00:51:20 -0000 Received: (qmail 1624 invoked by uid 22791); 4 Mar 2009 00:51:18 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx2.redhat.com (HELO mx2.redhat.com) (66.187.237.31) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 04 Mar 2009 00:51:10 +0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n240mgS3007363; Tue, 3 Mar 2009 19:48:42 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n240mgrY027758; Tue, 3 Mar 2009 19:48:42 -0500 Received: from opsy.redhat.com (vpn-13-15.rdu.redhat.com [10.11.13.15]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n240mfHA026925; Tue, 3 Mar 2009 19:48:41 -0500 Received: by opsy.redhat.com (Postfix, from userid 500) id 8B5253784C2; Tue, 3 Mar 2009 17:48:39 -0700 (MST) To: Paul Pluzhnikov Cc: Joel Brobecker , Pedro Alves , gdb-patches@sourceware.org Subject: Re: [patch] Fix a crash when displaying variables from shared library. References: <20090205030257.8A6073A6B7A@localhost> <8ac60eac0902061837p5885b812j8a26669e799702e1@mail.gmail.com> <8ac60eac0902181458g39dfbce9k63c3329528b0aad5@mail.gmail.com> <20090223010759.GA30997@adacore.com> <8ac60eac0902231012lb42bcb1q8b8cf19ad2ac192@mail.gmail.com> <8ac60eac0903021830w363783ear7d4c8fc1177d6448@mail.gmail.com> From: Tom Tromey Reply-To: tromey@redhat.com Date: Wed, 04 Mar 2009 00:51:00 -0000 In-Reply-To: <8ac60eac0903021830w363783ear7d4c8fc1177d6448@mail.gmail.com> (Paul Pluzhnikov's message of "Mon\, 2 Mar 2009 18\:30\:59 -0800") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: 2009-03/txt/msg00048.txt.bz2 >>>>> "Paul" == Paul Pluzhnikov writes: Paul> Unfortunately, this code still crashes, because no_shared_libraries Paul> first calls objfile_purge_solibs (which indirectly does Paul> obstack_free), and only then clear_solib, which notifies me that Paul> the library has already disappeared. When I proceed to use symbol, Paul> I am already using dangling obstack :-( Paul> Is it ok to move observer notification to before Paul> objfile_purge_solibs, or should I add a new notification? IMO it is ok to move this notification if you audit the existing users to make sure they don't break. However, it seems to me that you could also do this another way, by noting at parse time which objfiles are referenced by a given display, and then arranging to require a re-parse when an objfile is destroyed. I think the existing objfile_data machinery could be used for this. Tom