From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21937 invoked by alias); 17 Jul 2008 22:10:22 -0000 Received: (qmail 21929 invoked by uid 22791); 17 Jul 2008 22:10:21 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 17 Jul 2008 22:10:02 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 613979841C; Thu, 17 Jul 2008 22:10:00 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id 395A5982C3; Thu, 17 Jul 2008 22:10:00 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1KJbfj-0002mI-A2; Thu, 17 Jul 2008 18:09:59 -0400 Date: Thu, 17 Jul 2008 22:10:00 -0000 From: Daniel Jacobowitz To: Paul Pluzhnikov Cc: gdb-patches@sourceware.org Subject: Re: [RFC] Detect loops in the solib chain Message-ID: <20080717220959.GA10652@caradoc.them.org> Mail-Followup-To: Paul Pluzhnikov , gdb-patches@sourceware.org References: <20080717205721.GA19882@caradoc.them.org> <8ac60eac0807171417h37cbe7d4x860d528d80358c8e@mail.gmail.com> <20080717214039.GA21465@caradoc.them.org> <8ac60eac0807171457g4f2c972es883f7210c7843a87@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8ac60eac0807171457g4f2c972es883f7210c7843a87@mail.gmail.com> User-Agent: Mutt/1.5.17 (2008-05-11) X-IsSubscribed: yes 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: 2008-07/txt/msg00355.txt.bz2 On Thu, Jul 17, 2008 at 02:57:03PM -0700, Paul Pluzhnikov wrote: > On Thu, Jul 17, 2008 at 2:40 PM, Daniel Jacobowitz wrote: > > > @@ -784,14 +792,21 @@ svr4_current_sos (void) > > > > read_memory (lm, new->lm_info->lm, lmo->link_map_size); > > > > - lm = LM_NEXT (new); > > + next_lm = LM_NEXT (new); > > + > > + if (prev_lm != 0 && LM_PREV (new) != prev_lm && ldsomap == 0) > > I think you want just: > > + if (LM_PREV (new) != prev_lm) > > First entry on the list should also be properly terminated, and > ldsomap has nothing to do with whether the list is corrupt or not. You're right about prev_lm, thanks. The ldsomap check is necessary, because that entry may not be on the list (see down below). -- Daniel Jacobowitz CodeSourcery