From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12859 invoked by alias); 14 Dec 2007 00:04:36 -0000 Received: (qmail 12849 invoked by uid 22791); 14 Dec 2007 00:04:35 -0000 X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.45.13) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 14 Dec 2007 00:04:28 +0000 Received: from zps77.corp.google.com (zps77.corp.google.com [172.25.146.77]) by smtp-out.google.com with ESMTP id lBE04Lq3003491 for ; Thu, 13 Dec 2007 16:04:21 -0800 Received: from wa-out-1112.google.com (wahv27.prod.google.com [10.114.248.27]) by zps77.corp.google.com with ESMTP id lBE01xjO012808 for ; Thu, 13 Dec 2007 16:04:21 -0800 Received: by wa-out-1112.google.com with SMTP id v27so1388340wah.4 for ; Thu, 13 Dec 2007 16:04:21 -0800 (PST) Received: by 10.114.95.1 with SMTP id s1mr2946158wab.99.1197590661155; Thu, 13 Dec 2007 16:04:21 -0800 (PST) Received: by 10.115.107.7 with HTTP; Thu, 13 Dec 2007 16:04:21 -0800 (PST) Message-ID: Date: Fri, 14 Dec 2007 00:04:00 -0000 From: "Doug Evans" To: "Jim Blandy" Subject: Re: protection from dangling pointers in dwarf info when .so's go away Cc: gdb@sourceware.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20071213032724.GA25868@caradoc.them.org> <20071213131841.GA24646@caradoc.them.org> X-IsSubscribed: yes 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: 2007-12/txt/msg00090.txt.bz2 On Dec 13, 2007 8:56 AM, Jim Blandy wrote: > > > Daniel Jacobowitz writes: > > On Thu, Dec 13, 2007 at 12:16:36AM -0800, Doug Evans wrote: > >> What happens if TYPE_OBJFILE (type) != TYPE_OBJFILE > >> (TYPE_VPTR_BASETYPE (baseclass)) ? > > > > Precisely what you saw, but how does this happen? The baseclass links > > should normally point through to other types in the same objfile. > > > > I'm guessing that there was inadequate debug info for a base class, > > leading GDB to do name resolution into a shared library with better > > debug info (probably because it defined the class's key method)? > > If I remember right, the way we usually handle this is by leaving the > types from the main executable 'incomplete', as if it had just seen > 'struct foo' but no definition for it. When we need the full > definition of 'struct foo', we look it up by name, find it whereever > it happens to be available, and use it there. So we do an extra name > lookup, because that allows the reference to break naturally when > objfiles are freed. > > But there shouldn't be pointers between objfiles, for the reasons > stated. It turns out all that's needed is for the baseclass in question live in a .so. I filed 2384, and will submit a proposed patch shortly.