Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Kevin Buettner <kevinb@cygnus.com>
To: Michael Snyder <msnyder@cygnus.com>
Cc: Kick Damien-DKICK1 <DKICK1@motorola.com>, gdb-patches@sources.redhat.com
Subject: Re: [PATCH RFA] Retry open of /proc/PID/ctl in procfs.c
Date: Fri, 13 Apr 2001 16:12:00 -0000	[thread overview]
Message-ID: <1010413231228.ZM20295@ocotillo.lan> (raw)
In-Reply-To: <3AD77C7C.C9D4037C@cygnus.com>

On Apr 13,  3:23pm, Michael Snyder wrote:

> Kevin Buettner wrote:
> > 
> > I request approval for committing the patch below.  The comments in the
> > patch explain why this patch is needed.  (It definitely cures some
> > intermittent problems that I'm seeing on AIX5.)
> 
> Is this just an issue of avoiding a race condition between gdb opening
> the "file" and the kernel creating it?

Yes.  I believe the problem that I'm seeing on AIX5 is due to a race
condition.  The race is between GDB and the kernel to see who can
open/create /proc/PID/ctl first.  The kernel usually wins this race,
but roughly one time out of fifty, GDB wins it instead.

> I can certainly imagine this being an issue on any platform, so I'm
> glad you didn't ifdef it, but I wonder if this is the only place
> where it might show up?

I think similar problems show up elsewhere too.  E.g, see

    http://sources.redhat.com/ml/gdb/2001-04/msg00078.html

In this bug report, Damien Kick reports that...

    'truss'ing the running 'gdb' shows that the failure in '/proc'
    comes from an attempt to 'open' '/proc/pid/status' that fails with
    EAGAIN.

This is on sparc-sun-solaris2.7.

The problem that Damien reported is not precisely the same as the
problem that I'm seeing on AIX5, but retrying the open() seems like
the right thing to do for Damien's problem too.

> Would it be worth it to add a "nohang" argument to open_procinfo_files?

It did occur to me that it might be better to move the retry logic
into open_procinfo_files().  I suppose the "nohang" argument you refer
to would only cause the open to be attempted only once?

> If not, then I say this change is fine.

I'll rework my patch so that the retry logic is located in
open_procinfo_files() instead and resubmit it.

Thanks for your feedback.

Kevin


      parent reply	other threads:[~2001-04-13 16:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-13  1:14 Kevin Buettner
     [not found] ` <3AD77C7C.C9D4037C@cygnus.com>
2001-04-13 16:12   ` Kevin Buettner [this message]

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=1010413231228.ZM20295@ocotillo.lan \
    --to=kevinb@cygnus.com \
    --cc=DKICK1@motorola.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=msnyder@cygnus.com \
    /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