Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Simon Marchi <simon.marchi@ericsson.com>,
	       Joel Brobecker <brobecker@adacore.com>
Cc: gdb-patches <gdb-patches@sourceware.org>
Subject: Re: Should this be on the blocker list for the 7.10 release?
Date: Tue, 07 Jul 2015 19:04:00 -0000	[thread overview]
Message-ID: <559C22D1.7020501@redhat.com> (raw)
In-Reply-To: <559C1EA9.5090400@redhat.com>

On 07/07/2015 07:47 PM, Pedro Alves wrote:

> Hmm, indeed:
> 
> (gdb) info inferiors
>   Num  Description       Executable
>   4    process 8393      /home/pedro/bugs/src/test
>   2    process 8388      /home/pedro/bugs/src/test
> * 1    <null>            /home/pedro/bugs/src/test
> (gdb) info threads
> 
> Calling prune_inferiors() at this point (from a top gdb)
> does not remove them, because they still have inf->pid != 0.
> Sounds like we miss mourning inferiors 2 and 4 somehow?

I think I got it.

Enabling logs (master + previous patch) I see:

...
WL: waitpid Thread 0x7ffff7fc2740 (LWP 9513) received Trace/breakpoint trap (stopped)
WL: Handling extended status 0x03057f
LHEW: Got clone event from LWP 9513, new child is LWP 9579
[New Thread 0x7ffff37b8700 (LWP 9579)]
WL: waitpid Thread 0x7ffff7fc2740 (LWP 9508) received 0 (exited)
WL: Thread 0x7ffff7fc2740 (LWP 9508) exited.
                           ^^^^^^^^
[Thread 0x7ffff7fc2740 (LWP 9508) exited]
WL: waitpid Thread 0x7ffff7fc2740 (LWP 9499) received 0 (exited)
WL: Thread 0x7ffff7fc2740 (LWP 9499) exited.
[Thread 0x7ffff7fc2740 (LWP 9499) exited]
RSRL: resuming stopped-resumed LWP Thread 0x7ffff37b8700 (LWP 9579) at 0x3615ef4ce1: step=0
...
(gdb) info inferiors
  Num  Description       Executable
  5    process 9508      /home/pedro/bugs/src/test
               ^^^^
  4    process 9503      /home/pedro/bugs/src/test
  3    process 9500      /home/pedro/bugs/src/test
  2    process 9499      /home/pedro/bugs/src/test
* 1    <null>            /home/pedro/bugs/src/test
(gdb)
...

Note the "Thread 0x7ffff7fc2740 (LWP 9508) exited." line.
That's this in wait_lwp:

      /* Check if the thread has exited.  */
      if (WIFEXITED (status) || WIFSIGNALED (status))
	{
	  thread_dead = 1;
	  if (debug_linux_nat)
	    fprintf_unfiltered (gdb_stdlog, "WL: %s exited.\n",
				target_pid_to_str (lp->ptid));
	}
    }

This code doesn't understand that an WIFEXITED status
of the last lwp of the process should be reported as
process exit.  Haven't tried to fix it yet.

I haven't tried 7.9, but I'd think it possible to trigger
this issue in all-stop there, because all it takes
is a whole process exiting while gdb is iterating
over lwps, stopping them.

Thanks,
Pedro Alves


  reply	other threads:[~2015-07-07 19:04 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-06 20:26 Simon Marchi
2015-07-07 13:25 ` Joel Brobecker
2015-07-07 16:18   ` Pedro Alves
2015-07-07 18:04     ` Pedro Alves
2015-07-07 18:35       ` Simon Marchi
2015-07-07 18:47         ` Pedro Alves
2015-07-07 19:04           ` Pedro Alves [this message]
2015-07-07 19:20             ` Pedro Alves
2015-07-07 20:38               ` Simon Marchi
2015-07-07 22:04               ` Simon Marchi
2015-07-13 19:20                 ` Pedro Alves

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=559C22D1.7020501@redhat.com \
    --to=palves@redhat.com \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@ericsson.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