From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30506 invoked by alias); 9 Jan 2002 20:51:19 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 30479 invoked from network); 9 Jan 2002 20:51:18 -0000 Received: from unknown (HELO localhost.cygnus.com) (24.114.42.213) by sources.redhat.com with SMTP; 9 Jan 2002 20:51:18 -0000 Received: from cygnus.com (localhost [127.0.0.1]) by localhost.cygnus.com (Postfix) with ESMTP id 42A123CC8; Wed, 9 Jan 2002 15:51:19 -0500 (EST) Message-ID: <3C3CAD47.6090803@cygnus.com> Date: Wed, 09 Jan 2002 12:51:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:0.9.7) Gecko/20020103 X-Accept-Language: en-us MIME-Version: 1.0 To: Daniel Jacobowitz Cc: gdb-patches@sources.redhat.com, msnyder@redhat.com Subject: Re: linux-proc readlink patch References: <20020109151622.A842@nevyn.them.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-01/txt/msg00196.txt.bz2 > This patch: > > 2002-01-08 Michael Snyder > > * linux-proc.c (child_pid_to_exec_file): Use readlink to get the > real name of the executable, rather than the /proc name. > > (which I never saw posted on gdb-patches; was that an artifact of the email > breakage yesterday?) > > seems to have at least one problem. > > (1) It introduces a memory leak, if I understand the semantics of cleanups > correctly. make_cleanup's cleanups will only be called (according to the > comment in utils.c) after a failed command. Since not looking at the code is current vogue .... :-) People use cleanups to mimic two exception behavours: TRY ... EXCEPT ... END you'll see a discard_cleanups() TRY ... ALWAYS ... END you'll see a do_cleanups () it was probably a forget me. > (2) It is not, IIRC, always correct in the case of chroots. Handling for > this has changed across Linux versions several times. On 2.2 it seems to be > correct (to my surprise, actually), but I believe it is not on 2.0. Do we > care? Probably not, as 2.0 is now -very- old. I don't know if we're really that worried about mimicing old broken kernel behavour (at least until we get a real user complaint). enjoy, Andrew