From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Pedro Alves <pedro@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [patch] Fix internal-error on dead LWPs with no associated thread
Date: Mon, 29 Jun 2009 21:35:00 -0000 [thread overview]
Message-ID: <20090629213333.GA3295@host0.dyn.jankratochvil.net> (raw)
In-Reply-To: <200906291941.52129.pedro@codesourcery.com>
On Mon, 29 Jun 2009 20:41:51 +0200, Pedro Alves wrote:
> 1 - I'm not convinced currently that adding threads immediately to the list in
> all-stop mode in linux_handle_extended_wait is a good idea. See here for
> thoughts around that:
>
> http://sourceware.org/ml/gdb/2009-05/msg00067.html
I do not share this opinion - not attaching short-lived threads should not be
allowed for performance reasons. When such short-lived thread crashes GDB
should catch such crash.
> 2 - If the target has let the thread escape this far without having added it to
> the list, *and* the target needs to book-keep extra thread info associated
> with the thread structure, than your patch looks like paparing over a bug.
> It's just a simple to handle it in the target's target_wait implementation,
> just before returning an event.
>
> 3 - I really just meant to just remove this whole block:
>
> - if (ecs->new_thread_event)
> - {
> - if (non_stop)
> - /* Non-stop assumes that the target handles adding new threads
> - to the thread list. */
> - internal_error (__FILE__, __LINE__, "\
> -targets should add new threads to the thread list themselves in non-stop mode.");
> -
> - /* We may want to consider not doing a resume here in order to
> - give the user a chance to play with the new thread. It might
> - be good to make that a user-settable option. */
> -
> - /* At this point, all threads are stopped (happens automatically
> - in either the OS or the native code). Therefore we need to
> - continue all threads in order to make progress. */
> -
> - if (!ptid_equal (ecs->ptid, inferior_ptid))
> - context_switch (ecs->ptid);
> - target_resume (RESUME_ALL, 0, TARGET_SIGNAL_0);
> - prepare_to_wait (ecs);
> - return;
> - }
Such a review for myself why:
On GNU/Linux if linux_test_for_tracefork() fails then the new LWP is left
unstopped - so it needs no target_resume.
On GNU/Linux if linux_test_for_tracefork() succeeds then the new LWP is left
unstopped immediately after catching its clone event by
linux_handle_extended_wait as it is called with STOPPING 0. So no
target_resume is needed.
For other OSes expectin no one stops the new LWP.
(I currently do not have an opinion on this removal, it is just a dead code.)
Thanks,
Jan
next prev parent reply other threads:[~2009-06-29 21:35 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-29 10:09 Jan Kratochvil
2009-06-29 10:35 ` Pedro Alves
2009-06-29 17:51 ` Jan Kratochvil
2009-06-29 18:30 ` Pedro Alves
2009-06-29 18:59 ` Jan Kratochvil
2009-06-29 18:31 ` Jan Kratochvil
2009-06-29 18:41 ` Pedro Alves
2009-06-29 21:35 ` Jan Kratochvil [this message]
2009-06-29 21:42 ` Pedro Alves
2009-06-29 21:48 ` Jan Kratochvil
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=20090629213333.GA3295@host0.dyn.jankratochvil.net \
--to=jan.kratochvil@redhat.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