From: Pedro Alves <palves@redhat.com>
To: Doug Evans <dje@google.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] Don't run forever in gdb.base/structs.c
Date: Wed, 01 Oct 2014 23:51:00 -0000 [thread overview]
Message-ID: <542C936A.60507@redhat.com> (raw)
In-Reply-To: <yjt2d2abqz9x.fsf@ruffy.mtv.corp.google.com>
On 10/01/2014 10:02 PM, Doug Evans wrote:
> If gdb crashes during testing tests may be left to free-run, eating cpu.
>
> This patch fixes one of the more egregious cases since several versions
> of the program are built.
>
> I've got patches to fix others.
> Just seeing if folks want to comment on this first.
>
> IWBN to have the harness itself cleanup, and I think there's something
> we can do there, but that's not always robust either, and I think
> multiple levels of robustness would be useful.
Agreed.
> Since this testcase is an egregious one, and since this patch simple,
> I'm starting with this.
Looks fine with me.
We already do something like this in many tests even. E.g., of the
top of my head:
$ grep -rn "Don't run forever. Run just short of it :)" *
gdb.base/watch_thread_num.c:55: /* Don't run forever. Run just short of it :) */
gdb.mi/nsintrall.c:55: /* Don't run forever. Run just short of it :) */
gdb.mi/nsmoribund.c:35: /* Don't run forever. Run just short of it :) */
gdb.threads/pending-step.c:54: /* Don't run forever. Run just short of it :) */
gdb.threads/watchthreads.c:71: /* Don't run forever. Run just short of it :) */
gdb.threads/threadapply.c:72: /* Don't run forever. Run just short of it :) */
gdb.threads/thread-specific.c:42: /* Don't run forever. Run just short of it :) */
gdb.threads/thread-specific.c:56: /* Don't run forever. Run just short of it :) */
gdb.threads/schedlock.c:55: /* Don't run forever. Run just short of it :) */
In a few other tests, we use "alarm()", though IMO it's best to avoid
that if possible, to expose the test on as much targets as possible.
E.g., alarm() IIRC isn't available on mingw unless you
specify __USE_MINGW_ALARM. Bare metal targets may have trouble
with it too, etc.
Thanks,
Pedro Alves
next prev parent reply other threads:[~2014-10-01 23:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-01 21:02 Doug Evans
2014-10-01 23:51 ` Pedro Alves [this message]
2014-10-02 20:10 ` Doug Evans
2014-10-03 8:57 ` Pedro Alves
2014-10-27 19:32 ` Doug Evans
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=542C936A.60507@redhat.com \
--to=palves@redhat.com \
--cc=dje@google.com \
--cc=gdb-patches@sourceware.org \
/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