From: "Paul Pluzhnikov" <ppluzhnikov@google.com>
To: "Pedro Alves" <pedro@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [new patch] Re: [RFC] Fix for gdb crash in "info thread" after exec().
Date: Wed, 28 May 2008 21:34:00 -0000 [thread overview]
Message-ID: <8ac60eac0805281009r29e394d2y2b285f31349b253f@mail.gmail.com> (raw)
In-Reply-To: <200805281626.50992.pedro@codesourcery.com>
On Wed, May 28, 2008 at 8:26 AM, Pedro Alves <pedro@codesourcery.com> wrote:
> A Wednesday 28 May 2008 00:23:25, Paul Pluzhnikov wrote:
>> The 'ecs->new_thread_event' is set to 0 while handling
>> TARGET_WAITKIND_EXECD, and add_thread() is not called for it.
>>
>
> Hmmmm, then, how is a thread getting to the thread list, with
> a ptid{pid,0,0} format? It should never happen in linux native.
>
> Hmmmm2, I just tried it, and it does happen to me:
Sorry about it being dense. Yes, the exact same thing happens to
me once I revert your patch:
- return pid_to_ptid (GET_PID (ptid));
+ return ptid;
> Hope you don't mind, but I've extended your test to test that case; the
> original bug is still covered, as I still get FAILures if
> linux-thread-db.c isn't fixed.
>
> What do you think?
Looks good to me, except the "second" parameter in the test is no
longer necessary, and there is an off-by-three bug in the allocation
of new_image:
--- gdb/testsuite/gdb.threads/execl.c.orig 2008-05-28
09:55:29.000000000 -0700
+++ gdb/testsuite/gdb.threads/execl.c 2008-05-28 10:03:04.000000000 -0700
@@ -27,11 +27,11 @@ main (int argc, char* argv[])
pthread_create (&thread1, NULL, thread_function, NULL);
pthread_create (&thread2, NULL, thread_function, NULL);
- new_image = malloc (strlen (argv[0] + 1));
+ new_image = malloc (strlen (argv[0]) + 2);
strcpy (new_image, argv[0]);
strcat (new_image, "1");
- if (execl (new_image, new_image, "second", NULL) == -1) /* set
breakpoint here */
+ if (execl (new_image, new_image, NULL) == -1) /* set breakpoint here */
return 1;
return 0;
Thanks,
--
Paul Pluzhnikov
next prev parent reply other threads:[~2008-05-28 17:10 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-20 22:12 Paul Pluzhnikov
2008-05-28 7:10 ` Paul Pluzhnikov
2008-05-28 15:27 ` Pedro Alves
2008-05-28 17:10 ` Paul Pluzhnikov
2008-05-28 21:25 ` [new patch] " Pedro Alves
2008-05-28 21:34 ` Paul Pluzhnikov [this message]
2008-05-28 22:24 ` Pedro Alves
2008-06-05 1:16 ` Paul Pluzhnikov
2008-06-05 17:23 ` Michael Snyder
2008-06-05 20:43 ` Daniel Jacobowitz
2008-06-05 21:07 ` Pedro Alves
2008-05-28 17:49 ` 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=8ac60eac0805281009r29e394d2y2b285f31349b253f@mail.gmail.com \
--to=ppluzhnikov@google.com \
--cc=gdb-patches@sourceware.org \
--cc=pedro@codesourcery.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