Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: Paul Pluzhnikov <ppluzhnikov@google.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [patch] Fix for internal-error: linux_nat_post_attach_wait:  Assertion `pid == new_pid && WIFSTOPPED (status)' failed.
Date: Wed, 14 Oct 2009 21:16:00 -0000	[thread overview]
Message-ID: <200910142216.46073.pedro@codesourcery.com> (raw)
In-Reply-To: <8ac60eac0910141401l57a6285es75634cf40ea5142d@mail.gmail.com>

On Wednesday 14 October 2009 22:01:05, Paul Pluzhnikov wrote:
> On Wed, Oct 14, 2009 at 12:07 PM, Pedro Alves <pedro@codesourcery.com> wrote:
> 
> > Ugh.  Happened much more often for me, like 1 in 5...
> 
> It's racy. I've seen different frequency of problems depending on
> whether I run kernel 2.6.24 or 2.6.30.
> 

Yeah.

> > I don't think you needed the interface change.
> 
> Indeed.
> 
> > Back to the "simple" variant: The inferior just added is
> > always inferior_ptid/current_inferior().  If you look
> > at fork-child.c:startup_inferior, you'll see bits of
> > code doing exactly what you'd need to do.  E.g.:
> >
> >            target_terminal_ours ();
> >            target_mourn_inferior ();
> >            if (WIFEXITED (status))
> >              error (_("During startup program exited with code %d."),
> >                     WIFEXITCODE (status));
> >            else if (WIFSIGNALED (status))
> >              error (_("During startup program exited with signal ..."),
> >                     ...);
> 
> I don't see above code in fork-child.c (or anywhere else for that
> matter). Are you looking at a local patch?

Well, you won't find that that _exactly_, as it was a
copy-paste-tweak.  But I pointed you in the right direction
anyway, it seems.  :-)

> Anyway, here is try #3.

Awesome.  Almost perfect.

> +      delete_lwp (ptid);

FYI, this isn't necessary.  linux_nat_mourn_inferior takes
care of deleting all lwps of the inferior being
mourned already.

> +           error (_("During startup program exited normally."));
> +         else
> +           error (_("During startup program exited with code %d."),
> +                  exit_code);
> +       }
> +      else if (WIFSIGNALED (status))
> +       {
> +         int signo = WTERMSIG (status);
> +
> +         target_terminal_ours ();
> +         target_mourn_inferior ();
> +         error (_("During startup program terminated with signal %s, %s."),

I didn't mean to use those strings exactly.  Please remove or replace
"During startup" with something else.  We're attaching, not starting up.
Sorry, I'll remember that my telepatic module is broken and to be
more specific next time. ;-)

Okay with that fixed.

-- 
Pedro Alves


  reply	other threads:[~2009-10-14 21:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-13 18:41 Paul Pluzhnikov
2009-10-13 20:53 ` Pedro Alves
2009-10-14 18:21   ` Paul Pluzhnikov
2009-10-14 19:08     ` Pedro Alves
2009-10-14 21:01       ` Paul Pluzhnikov
2009-10-14 21:16         ` Pedro Alves [this message]
2009-10-14 21:28           ` Paul Pluzhnikov
2009-10-14 22:29             ` Pedro Alves
2009-10-15  2:17               ` Doug Evans
2009-10-15 18:10               ` Paul Pluzhnikov

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=200910142216.46073.pedro@codesourcery.com \
    --to=pedro@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=ppluzhnikov@google.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