From: "John David Anglin" <dave@hiauly1.hia.nrc.ca>
To: pedro@codesourcery.com (Pedro Alves)
Cc: gdb-patches@sourceware.org
Subject: Re: ttrace: Protocal error
Date: Fri, 08 Aug 2008 20:49:00 -0000 [thread overview]
Message-ID: <20080808204838.DD43A4DCB@hiauly1.hia.nrc.ca> (raw)
In-Reply-To: <200808082102.11828.pedro@codesourcery.com> from "Pedro Alves" at Aug 8, 2008 09:02:11 pm
> Note, I know nothing about ttrace and HP-UX.
That makes us equal.
> On Friday 08 August 2008 19:33:06, John David Anglin wrote:
> > While were on the subject of threads, it seems we are still not in
> > a position to debug the vla6.f90 failure:
>
> What's this test doing different?
It's not entirely clear. However, it is using emulated TLS support
and multiple lwp threads. This support may be initialized by a constructor
run directly by the dynamic loader. There's a timing or some other
random effect associated with the failure (could be some variable is
being randomly intialized).
> > #4 0x000a3390 in target_resume (ptid=3D
> > {pid =3D 1953788513, lwp =3D 1667563520, tid =3D 774778670}, step=3D0,
> > signal=3DTARGET_SIGNAL_0) at ../../src/gdb/target.c:1789
>
> ^^^^^^^^^^ ^^^^^^^^^^ ^^^^^^^^^
>
> I assume this ptid is GDB getting bogus info, right?
That's pretty common for optimized code.
> This should be setting the dying flag on the thread, but
> it is still listed in gdb's thread table.
Yes.
> case TTEVT_LWP_EXIT:
> if (print_thread_events)
> printf_unfiltered (_("[%s exited]\n"), target_pid_to_str (ptid));
> ti =3D find_thread_pid (ptid);
> gdb_assert (ti !=3D NULL);
> ((struct inf_ttrace_private_thread_info *)ti->private)->dying =3D 1;
> inf_ttrace_num_lwps--;
> ttrace (TT_LWP_CONTINUE, ptid_get_pid (ptid),
> ptid_get_lwp (ptid), TT_NOPC, 0, 0);
> /* If we don't return -1 here, core GDB will re-add the thread. */
> ptid =3D minus_one_ptid;
> break;
The dying flag is set when the resume is attempted.
> inf_ttrace_resume:
>
> if (ptid_equal (ptid, minus_one_ptid))
> {
> /* Let all the other threads run too. */
> iterate_over_threads (inf_ttrace_resume_callback, NULL);
> iterate_over_threads (inf_ttrace_delete_dying_threads_callback, NULL);
> }
>
> Is this the first resume after that "exit" notification?
> Any chance we're trying to resume a dead thread here then?
Yes. That's what I think is happening.
> What happens when you delete the dying threads before resuming?
>
> iterate_over_threads (inf_ttrace_delete_dying_threads_callback, NULL);
> iterate_over_threads (inf_ttrace_resume_callback, NULL);
> iterate_over_threads (inf_ttrace_delete_dying_threads_callback, NULL);
>
> Hmmm, I assume not, if my sources match yours, your the program is stopped
> at a syscall event:
>
> /* Be careful not to try to gather much state about a thread
> that's in a syscall. It's frequently a losing proposition. */
> case TARGET_WAITKIND_SYSCALL_ENTRY:
> if (debug_infrun)
> fprintf_unfiltered (gdb_stdlog, "infrun:=20
> TARGET_WAITKIND_SYSCALL_ENTRY\n");
> resume (0, TARGET_SIGNAL_0);
> prepare_to_wait (ecs);
> return;
>
> So, there should have already been a resume in between.
>
> Could you check which thread got the syscall event? Is it the same
> thread we fail to resume? Is it possibly to disable syscall events,
> just for checking if it is related?
I don't know how to disable syscall events.
Dave
--
J. David Anglin dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6602)
next prev parent reply other threads:[~2008-08-08 20:49 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-08 1:36 [4/7] Adjust the ttrace target (HP-UX) to always register the main thread Pedro Alves
2008-08-08 16:41 ` John David Anglin
2008-08-08 17:24 ` Pedro Alves
2008-08-08 17:49 ` John David Anglin
2008-08-08 18:34 ` ttrace: Protocal error John David Anglin
2008-08-08 20:02 ` Pedro Alves
2008-08-08 20:49 ` John David Anglin [this message]
2008-08-10 0:15 ` [4/7] Adjust the ttrace target (HP-UX) to always register the main thread Daniel Jacobowitz
2008-08-10 0:36 ` [4/7] Adjust the ttrace target (HP-UX) to always register the John David Anglin
2008-08-10 21:05 ` Pedro Alves
2008-08-10 21:16 ` John David Anglin
2008-08-10 21:04 ` John David Anglin
2008-08-14 17:55 ` Daniel Jacobowitz
[not found] <no.id>
2008-08-08 19:30 ` ttrace: Protocal error John David Anglin
2008-08-08 20:16 ` John David Anglin
2008-08-09 14:52 ` Pedro Alves
2008-08-09 15:34 ` John David Anglin
2008-08-09 18:49 ` John David Anglin
2008-08-09 22:45 ` Pedro Alves
2008-08-09 22:46 ` Pedro Alves
2008-08-09 22:51 ` Pedro Alves
2008-08-09 23:19 ` John David Anglin
2008-08-09 22:48 ` Pedro Alves
2008-08-09 14:53 ` Joel Brobecker
2008-08-09 23:40 ` John David Anglin
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=20080808204838.DD43A4DCB@hiauly1.hia.nrc.ca \
--to=dave@hiauly1.hia.nrc.ca \
--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