Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Race condition in attach command
@ 2005-12-13 22:53 Andreas Schwab
  2005-12-13 22:58 ` Daniel Jacobowitz
  0 siblings, 1 reply; 3+ messages in thread
From: Andreas Schwab @ 2005-12-13 22:53 UTC (permalink / raw)
  To: gdb

It seems like the attach command a timing bug.  The problem is that when I
attach to a process I often see that gdb cannot read the vDSO image from
the process.  When enabling infrun debugging I see that gdb tries to read
the image before the process has actually stopped.  I'm observing that
both on ppc64-linux and ia64-linux, with gdb 6.4 and current trunk.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Race condition in attach command
  2005-12-13 22:53 Race condition in attach command Andreas Schwab
@ 2005-12-13 22:58 ` Daniel Jacobowitz
  2005-12-13 23:34   ` Andreas Schwab
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Jacobowitz @ 2005-12-13 22:58 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: gdb

On Tue, Dec 13, 2005 at 11:53:17PM +0100, Andreas Schwab wrote:
> It seems like the attach command a timing bug.  The problem is that when I
> attach to a process I often see that gdb cannot read the vDSO image from
> the process.  When enabling infrun debugging I see that gdb tries to read
> the image before the process has actually stopped.  I'm observing that
> both on ppc64-linux and ia64-linux, with gdb 6.4 and current trunk.

Yes, I know exactly what causes this - it was a recent (ish) reorganization
of the observers, I believe.  I have this queued up to submit; does it
help for you?

-- 
Daniel Jacobowitz
CodeSourcery, LLC

Index: gdb-6.4/gdb/inf-ptrace.c
===================================================================
--- gdb-6.4.orig/gdb/inf-ptrace.c	2005-11-21 04:16:07.000000000 -0500
+++ gdb-6.4/gdb/inf-ptrace.c	2005-12-11 13:08:51.000000000 -0500
@@ -228,10 +228,6 @@ inf_ptrace_attach (char *args, int from_
 
   inferior_ptid = pid_to_ptid (pid);
   push_target (ptrace_ops_hack);
-
-  /* Do this first, before anything has had a chance to query the
-     inferior's symbol table or similar.  */
-  observer_notify_inferior_created (&current_target, from_tty);
 }
 
 #ifdef PT_GET_PROCESS_STATE
Index: gdb-6.4/gdb/inf-ttrace.c
===================================================================
--- gdb-6.4.orig/gdb/inf-ttrace.c	2005-10-29 17:22:39.000000000 -0400
+++ gdb-6.4/gdb/inf-ttrace.c	2005-12-11 13:10:29.000000000 -0500
@@ -727,10 +727,6 @@ inf_ttrace_attach (char *args, int from_
 
   inferior_ptid = pid_to_ptid (pid);
   push_target (ttrace_ops_hack);
-
-  /* Do this first, before anything has had a chance to query the
-     inferior's symbol table or similar.  */
-  observer_notify_inferior_created (&current_target, from_tty);
 }
 
 static void
Index: gdb-6.4/gdb/infcmd.c
===================================================================
--- gdb-6.4.orig/gdb/infcmd.c	2005-12-07 20:37:42.000000000 -0500
+++ gdb-6.4/gdb/infcmd.c	2005-12-11 13:09:33.000000000 -0500
@@ -1878,6 +1878,10 @@ attach_command (char *args, int from_tty
       reread_symbols ();
     }
 
+  /* Do this first, before anything has had a chance to query the
+     inferior's symbol table or similar.  */
+  observer_notify_inferior_created (&current_target, from_tty);
+
 #ifdef SOLIB_ADD
   /* Add shared library symbols from the newly attached process, if any.  */
   SOLIB_ADD ((char *) 0, from_tty, &current_target, auto_solib_add);
Index: gdb-6.4/gdb/inftarg.c
===================================================================
--- gdb-6.4.orig/gdb/inftarg.c	2005-09-04 12:18:19.000000000 -0400
+++ gdb-6.4/gdb/inftarg.c	2005-12-11 13:10:37.000000000 -0500
@@ -211,10 +211,6 @@ child_attach (char *args, int from_tty)
   
   inferior_ptid = pid_to_ptid (pid);
   push_target (&deprecated_child_ops);
-
-  /* Do this first, before anything has had a chance to query the
-     inferior's symbol table or similar.  */
-  observer_notify_inferior_created (&current_target, from_tty);
 }
 
 #if !defined(CHILD_POST_ATTACH)


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Race condition in attach command
  2005-12-13 22:58 ` Daniel Jacobowitz
@ 2005-12-13 23:34   ` Andreas Schwab
  0 siblings, 0 replies; 3+ messages in thread
From: Andreas Schwab @ 2005-12-13 23:34 UTC (permalink / raw)
  To: gdb

Daniel Jacobowitz <drow@false.org> writes:

> Yes, I know exactly what causes this - it was a recent (ish) reorganization
> of the observers, I believe.  I have this queued up to submit; does it
> help for you?

Thanks, that helps (apart from the implicit declaration of
observer_notify_inferior_created).

But there is still some oddity: each time I detach and reattach I'm
getting the message "`system-supplied DSO at 0xa000000000000000' has
disappeared; keeping its symbols." (once more after each attach).

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-12-13 23:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-13 22:53 Race condition in attach command Andreas Schwab
2005-12-13 22:58 ` Daniel Jacobowitz
2005-12-13 23:34   ` Andreas Schwab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox