From: Kevin Buettner <kevinb@redhat.com>
To: gdb-patches@sourceware.org
Subject: Re: [RFC] Detect loops in the solib chain
Date: Fri, 18 Jul 2008 23:02:00 -0000 [thread overview]
Message-ID: <20080718160210.66b480e9@mesquite.lan> (raw)
In-Reply-To: <20080717220959.GA10652@caradoc.them.org>
On Thu, 17 Jul 2008 18:09:59 -0400
Daniel Jacobowitz <drow@false.org> wrote:
> On Thu, Jul 17, 2008 at 02:57:03PM -0700, Paul Pluzhnikov wrote:
> > On Thu, Jul 17, 2008 at 2:40 PM, Daniel Jacobowitz <drow@false.org> 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).
As written, I agree that the ldsomap check is necessary. Of course,
having this check means that as soon as ldsomap gets set, this
integrity check is effectively disabled. I think that this will only
matter if the ldsomap entry ends up having a non-zero LM_NEXT.
It seems to me that the ldsomap check could be avoided if you were to
set prev_lm to 0 just after ldsomap gets set. (It's been a while
since I've checked, but I'm guessing that in the case of a unattached
dynamic linker entry, you'd expect both LM_NEXT and LM_PREV for that
entry to be zero.)
Kevin
next prev parent reply other threads:[~2008-07-18 23:02 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-17 20:57 Daniel Jacobowitz
2008-07-17 21:07 ` Stan Shebs
2008-07-17 21:15 ` Thiago Jung Bauermann
2008-07-17 21:42 ` Daniel Jacobowitz
2008-07-17 21:18 ` Paul Pluzhnikov
2008-07-17 21:41 ` Daniel Jacobowitz
2008-07-17 21:57 ` Paul Pluzhnikov
2008-07-17 22:10 ` Daniel Jacobowitz
2008-07-18 23:02 ` Kevin Buettner [this message]
2010-04-09 15:41 ` Jan Kratochvil
2010-04-09 21:03 ` Jan Kratochvil
2010-04-12 22:54 ` Kevin Buettner
2010-04-12 23:08 ` Pedro Alves
2010-04-18 20:24 ` OpenSolaris dejagnu workaround [Re: [RFC] Detect loops in the solib chain] Jan Kratochvil
2010-04-23 20:09 ` [RFC] Detect loops in the solib chain Tom Tromey
2010-04-23 21:47 ` Jan Kratochvil
2010-06-11 17:39 ` Ulrich Weigand
2010-06-11 18:34 ` Jan Kratochvil
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080718160210.66b480e9@mesquite.lan \
--to=kevinb@redhat.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox