Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: John David Anglin <dave@hiauly1.hia.nrc.ca>
To: Pedro Alves <pedro@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: ttrace: Protocal error
Date: Sat, 09 Aug 2008 15:34:00 -0000	[thread overview]
Message-ID: <20080809153343.GA29008@hiauly1.hia.nrc.ca> (raw)
In-Reply-To: <200808091551.17013.pedro@codesourcery.com>

[-- Attachment #1: Type: text/plain, Size: 2010 bytes --]

On Sat, 09 Aug 2008, Pedro Alves wrote:

> If I'm analising the race correctly, an alternative simpler solution
> to the above, would be to just ignore a failed resume on a
> dying thread, but still try to resume it.  Not resuming dying threads
> may be a problem.

It occured to me that my suggested change wasn't going to handle the
race associated with threads dying, although it improves the situation.

The ttrace documentation suggested that only stopped threads should
be resumed.  The thread info indicated the thread in question was
running.  I changed the code to only check for thread stopped.  However,
this didn't work.  My testcase hangs when run under gdb:

(gdb) r
The program being debugged has been started already.
Start it from the beginning? (y or n) y

Starting program: /mnt/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libgomp/testsuite/vla6.x3g 
warning: Private mapping of shared library text was not specified
by the executable; setting a breakpoint in a shared library which
is not privately mapped will not work.  See the HP-UX 11i v3 chatr
manpage for methods to privately map shared library text.
[New process 2316, lwp 7552188]
[process 2316, lwp 7552188 exited]
[New process 2316, lwp 7552189]
[process 2316, lwp 7552189 exited]
[New process 2316, lwp 7552190]
[process 2316, lwp 7552190 exited]
[New process 2316, lwp 7552191]
[process 2316, lwp 7552191 exited]
[New process 2316, lwp 7552192]
[New process 2316, lwp 7552193]
[New process 2316, lwp 7552194]
[New process 2316, lwp 7552195]
[New process 2316, lwp 7552196]

Program received signal SIGINT, Interrupt.
[Switching to process 2316, lwp 7552196]
0xc03bea58 in __lwp_sema_wait () from /usr/lib/librt.2

So, there's apparently a race in detection when a program is stopped.
It looks like we need to try your suggestion(s).

Attached same with debug infrun 1.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)

[-- Attachment #2: vla6.dbg --]
[-- Type: text/plain, Size: 4141 bytes --]

(gdb) set debug infrun 1
(gdb) r
Starting program: /mnt/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libgomp/testsuite/vla6.x3g 
infrun: wait_for_inferior (treat_exec_as_sigtrap=1)
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x91d0
infrun: quietly stopped
infrun: stop_stepping
infrun: resume (step=0, signal=0), stepping_over_breakpoint=0
infrun: wait_for_inferior (treat_exec_as_sigtrap=1)
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x19f8
infrun: quietly stopped
infrun: stop_stepping
warning: Private mapping of shared library text was not specified
by the executable; setting a breakpoint in a shared library which
is not privately mapped will not work.  See the HP-UX 11i v3 chatr
manpage for methods to privately map shared library text.
infrun: proceed (addr=0xffffffff, signal=0, step=0)
infrun: resume (step=0, signal=0), stepping_over_breakpoint=0
infrun: wait_for_inferior (treat_exec_as_sigtrap=0)
[New process 2557, lwp 7552464]
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_SPURIOUS
infrun: resume (step=0, signal=0), stepping_over_breakpoint=0
infrun: prepare_to_wait
[process 2557, lwp 7552464 exited]
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_SPURIOUS
infrun: resume (step=0, signal=0), stepping_over_breakpoint=0
infrun: prepare_to_wait
[New process 2557, lwp 7552465]
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_SPURIOUS
infrun: resume (step=0, signal=0), stepping_over_breakpoint=0
infrun: prepare_to_wait
[process 2557, lwp 7552465 exited]
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_SPURIOUS
infrun: resume (step=0, signal=0), stepping_over_breakpoint=0
infrun: prepare_to_wait
[New process 2557, lwp 7552466]
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_SPURIOUS
infrun: resume (step=0, signal=0), stepping_over_breakpoint=0
infrun: prepare_to_wait
[process 2557, lwp 7552466 exited]
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_SPURIOUS
infrun: resume (step=0, signal=0), stepping_over_breakpoint=0
infrun: prepare_to_wait
[New process 2557, lwp 7552467]
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_SPURIOUS
infrun: resume (step=0, signal=0), stepping_over_breakpoint=0
infrun: prepare_to_wait
[process 2557, lwp 7552467 exited]
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_SPURIOUS
infrun: resume (step=0, signal=0), stepping_over_breakpoint=0
infrun: prepare_to_wait
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x19e0
infrun: BPSTAT_WHAT_CHECK_SHLIBS
infrun: no stepping, continue
infrun: resume (step=1, signal=0), stepping_over_breakpoint=1
infrun: prepare_to_wait
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x19e4
infrun: no stepping, continue
infrun: resume (step=0, signal=0), stepping_over_breakpoint=0
infrun: prepare_to_wait
[New process 2557, lwp 7552468]
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_SPURIOUS
infrun: resume (step=0, signal=0), stepping_over_breakpoint=0
infrun: prepare_to_wait
[New process 2557, lwp 7552469]
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_SPURIOUS
infrun: resume (step=0, signal=0), stepping_over_breakpoint=0
infrun: prepare_to_wait
[New process 2557, lwp 7552470]
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_SPURIOUS
infrun: resume (step=0, signal=0), stepping_over_breakpoint=0
infrun: prepare_to_wait
[New process 2557, lwp 7552471]
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_SPURIOUS
infrun: resume (step=0, signal=0), stepping_over_breakpoint=0
infrun: prepare_to_wait
[New process 2557, lwp 7552472]
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_SPURIOUS
infrun: resume (step=0, signal=0), stepping_over_breakpoint=0
infrun: prepare_to_wait
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0xc020c878
infrun: context switch
infrun: Switching context from process 2557, lwp 7552460 to process 2557, lwp 7552472
infrun: random signal 2

Program received signal SIGINT, Interrupt.
infrun: stop_stepping
[Switching to process 2557, lwp 7552472]
0xc020c878 in __ksleep () from /usr/lib/libc.2


  reply	other threads:[~2008-08-09 15:34 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-10  0:30 [RFA] patch to add 'maint profile-gdb' command Jason Molenda
2001-09-10  8:48 ` Andrew Cagney
2001-09-10  8:58   ` Eli Zaretskii
2001-09-10  9:04     ` Andrew Cagney
2001-09-10 11:52   ` Jason Molenda
2001-09-10 13:43     ` Eli Zaretskii
2001-09-10 13:59       ` Jason Molenda
2001-09-11  0:38         ` Eli Zaretskii
     [not found]           ` <no.id>
1999-06-15 20:10             ` Missing routines: gdb/top.c John David Anglin
2001-09-11  1:37             ` [RFA] patch to add 'maint profile-gdb' command Jason Molenda
2001-09-11  1:57               ` Eli Zaretskii
2001-09-12  0:00             ` Jason Molenda
2001-09-12  6:00               ` Eli Zaretskii
2001-09-12  7:42                 ` Jason Molenda
2001-09-12  9:06                   ` Eli Zaretskii
2001-09-12 11:58                     ` Tom Tromey
2001-09-12 13:16                       ` Jason Molenda
2008-08-06 19:24             ` [patch] Don't set DT_HP_DEBUG_PRIVATE in solib-pa64.c John David Anglin
2008-08-06 19:49               ` Mark Kettenis
2008-08-06 20:09                 ` John David Anglin
2008-08-06 23:10                 ` John David Anglin
2008-08-07 21:39               ` [patch] Only force private mapping of shared libraries in solib-som.c on HP-UX 10 and earlier John David Anglin
2008-08-08 10:48                 ` Joel Brobecker
2008-08-08 15:34                   ` John David Anglin
2008-08-09 14:37                     ` Joel Brobecker
2008-08-09 18:59                       ` John David Anglin
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 [this message]
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
2008-08-10  0:46             ` [4/7] Adjust the ttrace target (HP-UX) to always register the John David Anglin
2008-09-15  2:08             ` [PATCH] Fix dwarf register column to gdb register mapping John David Anglin
2008-09-15  2:24             ` [PATCH] Fix hppa_linux_sigtramp_frame_unwind_cache John David Anglin
2001-09-12 11:28     ` [RFA] patch to add 'maint profile-gdb' command Andrew Cagney
2001-09-12 11:43     ` Andrew Cagney
2001-09-16 17:45       ` [RFA] Version 2 of " Jason Molenda
     [not found]         ` <200109170536.HAA21988@is.elta.co.il>
2001-09-17 15:08           ` Michael Snyder
2001-09-17 22:43           ` Andrew Cagney
2001-09-17 23:59             ` Eli Zaretskii
2001-09-24 13:33               ` Jason Molenda
2001-09-24 14:41                 ` Andrew Cagney
2001-09-24 14:58                   ` Eli Zaretskii
2001-09-24 15:13                     ` Andrew Cagney
2001-09-24 14:53                 ` Eli Zaretskii
2001-09-17 22:39         ` Andrew Cagney
2001-09-18 17:52           ` Fernando Nasser
2001-09-18 17:56             ` Andrew Cagney
2001-09-19  7:11               ` Fernando Nasser
2001-09-19  7:28                 ` Eli Zaretskii
2001-09-19  9:29                   ` Fernando Nasser
2001-09-19 11:30                     ` Eli Zaretskii
2001-09-19 11:41                     ` Andrew Cagney
2001-09-19 11:53                     ` Kevin Buettner
2008-08-08 17:24 [4/7] Adjust the ttrace target (HP-UX) to always register the main thread Pedro Alves
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

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=20080809153343.GA29008@hiauly1.hia.nrc.ca \
    --to=dave@hiauly1.hia.nrc.ca \
    --cc=dave.anglin@nrc-cnrc.gc.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