public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Patrick Palka <patrick@parcs.ath.cx>
To: Pedro Alves <palves@redhat.com>
Cc: Sergio Durigan Junior <sergiodj@redhat.com>,
		"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: Racy failures on gdb.base/gdbinit-history.exp (native-extended-gdbserver/-m64)
Date: Mon, 17 Aug 2015 23:29:00 -0000	[thread overview]
Message-ID: <CA+C-WL9zL3i_j573K03GCTvE9EkJzh_HDx-Fx=3L5Pn=-NPwpw@mail.gmail.com> (raw)
In-Reply-To: <CA+C-WL_bXQgTiiTmPE6=JNGOvB=AcSqbkdBpaETL5eWAdcfLOw@mail.gmail.com>

On Mon, Aug 17, 2015 at 4:10 PM, Patrick Palka <patrick@parcs.ath.cx> wrote:
> On Mon, Aug 17, 2015 at 10:02 AM, Pedro Alves <palves@redhat.com> wrote:
>> On 08/17/2015 02:28 PM, Patrick Palka wrote:
>>
>>> Ah, you already addressed this: a warning is not emitted because
>>> stdout is closed..
>>
>> Yeah.
>>
>>> But because the problem only occurs under extended-gdbserver, I'm
>>> inclined to think the issue is with the testsuite driver, in
>>> particular with the gdb_exit implementation in
>>> lib/gdbserver-support.exp.  One potential issue I notice in this proc
>>> is that when we send "monitor exit" to GDB, we don't necessarily wait
>>> for the command to finish (i.e. for the gdb prompt to get printed).
>>> As soon as the server is observed to get killed, we continue with
>>> exiting.  Dunno if that's substantial..
>>
>> That's very plausible, at least.
>>
>> Maybe that prompt got stuck in the expect buffer, and it confused
>> something else later on?
>>
>> Another theory related to that could be that the new GDB started just
>> while the previous gdb is saving history and has just momentarily
>> renamed the history file to gdbinit-history.gdb_history-gdb-$PID~.
>> But AFAICS, that shouldn't happen because that gdb_exit calls
>> gdbserver_orig_gdb_exit at the end, which only returns after
>> the previous gdb exits...
>>
>> Did anyone ever manage to reproduce this?
>
> Yes, I can reproduce it on x86_64 Debian with dejagnu version 1.5.3.
> But it's pretty rare.  I just do
>
>   while make check RUNTESTFLAGS="gdbinit-history.exp
> --target_board=native-extended-gdbserver --verbose --verbose"; do :;
> done
>
> and wait for a while (20 minutes or so).
>
> But I just locally installed dejagnu from git, and have had the above
> command running for about 30 minutes (after confirming that my local
> copy, not system copy, of dejagnu is being used by the testsuite), and
> fortunately, I could no longer reproduce these FAILs.  So it seems
> that your changes to dejagnu fixed this spurious FAIL as well.  I'll
> let it keep spinning though, just in case.
>
>
>>
>> One thing I'd try is making dejagnu's local_exec (close_wait_program in master)
>> print the result of the "wait -i".  That will show whether gdb exited
>> due to a normal exit, or whether it was killed by SIGTERM or SIGKILL.
>> And then I'd try hacking gdb_safe_append_history to output debug logs
>> to a file instead of stdout (e.g., /tmp/gdb-log).
>>
>> Another would be to add a "show history filename" to the test, to make sure
>> that the gdb that fails to load the previous history actually tried to
>> read the file we expect it to be reading.
>
> Ok, I'll keep these approaches in mind but if I manage to trip over it
> even with dejagnu from git.

Sorry, botched that last sentence there...

Anyway, with dejagnu from git I could no longer reproduce these FAILs
after 3 straight hours of repeatedly running the test.

  reply	other threads:[~2015-08-17 23:29 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-09 19:28 [PATCH] Don't truncate the history file when history size is unlimited Patrick Palka
2015-06-15 15:25 ` Pedro Alves
2015-06-15 16:01   ` Patrick Palka
2015-06-15 16:18     ` Pedro Alves
2015-06-16 14:53 ` Patrick Palka
2015-06-16 15:00   ` Patrick Palka
2015-06-17 13:14     ` Pedro Alves
2015-06-17 12:46   ` Pedro Alves
2015-07-23 18:42   ` Racy failures on gdb.base/gdbinit-history.exp (native-extended-gdbserver/-m64) (was: Re: [PATCH] Don't truncate the history file when history size is unlimited) Sergio Durigan Junior
2015-07-23 19:33     ` Patrick Palka
2015-07-24 14:03       ` Patrick Palka
2015-07-24 14:16         ` Patrick Palka
2015-08-13 15:18     ` Patrick Palka
2015-08-13 22:28       ` Racy failures on gdb.base/gdbinit-history.exp (native-extended-gdbserver/-m64) Sergio Durigan Junior
2015-08-13 23:26         ` Pedro Alves
2015-08-14  0:46           ` Sergio Durigan Junior
2015-08-17 13:16           ` Patrick Palka
2015-08-17 13:28             ` Patrick Palka
2015-08-17 14:03               ` Pedro Alves
2015-08-17 20:10                 ` Patrick Palka
2015-08-17 23:29                   ` Patrick Palka [this message]
2015-09-10 13:44                     ` Pedro Alves
2015-09-10 15:30                       ` Sergio Durigan Junior

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='CA+C-WL9zL3i_j573K03GCTvE9EkJzh_HDx-Fx=3L5Pn=-NPwpw@mail.gmail.com' \
    --to=patrick@parcs.ath.cx \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    --cc=sergiodj@redhat.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).