From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29995 invoked by alias); 1 Nov 2005 06:59:10 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 29985 invoked by uid 22791); 1 Nov 2005 06:59:07 -0000 Received: from sibelius.xs4all.nl (HELO sibelius.xs4all.nl) (82.92.89.47) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Tue, 01 Nov 2005 06:59:06 +0000 Received: from elgar.sibelius.xs4all.nl (root@elgar.sibelius.xs4all.nl [192.168.0.2]) by sibelius.xs4all.nl (8.13.4/8.13.4) with ESMTP id jA16wZHf031042; Tue, 1 Nov 2005 07:58:35 +0100 (CET) Received: from elgar.sibelius.xs4all.nl (kettenis@localhost.sibelius.xs4all.nl [127.0.0.1]) by elgar.sibelius.xs4all.nl (8.13.4/8.13.3) with ESMTP id jA16wZPm003717; Tue, 1 Nov 2005 07:58:35 +0100 (CET) Received: (from kettenis@localhost) by elgar.sibelius.xs4all.nl (8.13.4/8.13.4/Submit) id jA16wZSo023764; Tue, 1 Nov 2005 07:58:35 +0100 (CET) Date: Tue, 01 Nov 2005 06:59:00 -0000 Message-Id: <200511010658.jA16wZSo023764@elgar.sibelius.xs4all.nl> From: Mark Kettenis To: me@cgf.cx CC: gdb@sourceware.org In-reply-to: <20051101053934.GA15899@trixie.casa.cgf.cx> (message from Christopher Faylor on Tue, 1 Nov 2005 00:39:34 -0500) Subject: Re: How does solib handline shared library unloads? References: <20051101053934.GA15899@trixie.casa.cgf.cx> X-SW-Source: 2005-11/txt/msg00003.txt.bz2 > Date: Tue, 1 Nov 2005 00:39:34 -0500 > From: Christopher Faylor > > Can anyone enlighten me as to how information about a library is > relinquished when a library loaded via dlopen is unloaded via dlclose? > Theoretically, the information about the library should be removed and > the library should not be listed by "info sharedlibrary". > > I don't see any way for this to be handled in solib.c and inf*.c but I'm > sure I'm just missing something obvious. I haven't written a test case > yet to see how it is being handled but I was hoping someone could > clarify this for me. It happens as part of solib_add(), which should be called for every shared library events, not just dlopen()s. See the code in update_solib_list() for the code that actually removes libraries from GDB's internal list. That said, I think I have convinced myself in the past that there is a big gaping memory leak. Mark