This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: RFA: EINTR in procfs_wait
- To: Kevin Buettner <kevinb at cygnus dot com>
- Subject: Re: RFA: EINTR in procfs_wait
- From: Fernando Nasser <fnasser at cygnus dot com>
- Date: Tue, 10 Apr 2001 20:40:56 -0400
- CC: Fernando Nasser <fnasser at redhat dot com>, gdb-patches at sources dot redhat dot com
- Organization: Red Hat , Inc. - Toronto
- References: <3AD32106.12A0443E@redhat.com> <1010410215732.ZM12867@ocotillo.lan>
Kevin Buettner wrote:
>
> Fernando,
>
> I think something like this is needed. I have two concerns though...
>
> 1) The patch below is causing the retry counter to be incremented.
> It's not clear to me if this is the right thing to do or not.
> (I honestly don't know what it should be. I'd have the same
> concern if I saw that it wasn't being incremented.)
>
> 2) I think EAGAIN should be tested for in addition to EINTR. See
> http://sources.redhat.com/ml/gdb/2001-04/msg00078.html. Hmm...
> now that I look at this some more, it seems that we might
> need another retry test somewhere else as well.
>
> But, regardless, I think this fix ought to go in. We can add any
> necessary adjustments later on.
>
> Kevin
>
Thank you Kevin.
Michael Snyder is going to take a look at some old procfs.c code to see how it was done back them. I will wait until Thursday before checking it in so he has a chance to do this.
Best regards,
Fernando
> On Apr 10, 11:04am, Fernando Nasser wrote:
> > Subject: RFA: EINTR in procfs_wait
> > Folks,
> >
> > I got this patch and it seems that we did forget to test for EINTR in
> > procfs_wait(). It looks like an "obvious fix" but I would like someone
> > else to double check it.
> >
> > Thanks in advance.
> >
> > Fernando
> >
> >
> >
> > 2001-04-05 Adam Mirowski <Adam.Mirowski@Sun.COM>
> >
> > Fixed Insight on Solaris. It was not possible to debug a process
> > because of EINTR "errors".
> > * procfs.c: (procfs_wait): if proc_wait_for_stop() fails
> > with EINTR, retry the call.
> >
> >
> > Index: gdb/procfs.c
> > ------- procfs.c -------
> > *** /tmp/dMKayx_ Tue Apr 10 16:20:54 2001
> > --- procfs.c Thu Apr 5 22:21:40 2001
> > ***************
> > *** 3518,3531 ****
> > --- 3518,3533 ----
> >
> > if (retval != PIDGET (inferior_pid)) /* wrong child? */
> > error ("procfs: couldn't stop process %d: wait returned %d\n",
> > inferior_pid, retval);
> > /* FIXME: might I not just use waitpid?
> > Or try find_procinfo to see if I know about this child? */
> > }
> > + else if (errno == EINTR)
> > + goto wait_again;
> > else
> > {
> > /* Unknown error from wait_for_stop. */
> > proc_error (pi, "target_wait (wait_for_stop)", __LINE__);
> > }
> > }
> > else
> >-- End of excerpt from Fernando Nasser
--
Fernando Nasser
Red Hat - Toronto E-Mail: fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario M4P 2C9