This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Don't run forever in gdb.base/structs.c
- From: Doug Evans <dje at google dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: gdb-patches <gdb-patches at sourceware dot org>
- Date: Thu, 2 Oct 2014 13:10:04 -0700
- Subject: Re: [PATCH] Don't run forever in gdb.base/structs.c
- Authentication-results: sourceware.org; auth=none
- References: <yjt2d2abqz9x dot fsf at ruffy dot mtv dot corp dot google dot com> <542C936A dot 60507 at redhat dot com>
On Wed, Oct 1, 2014 at 4:51 PM, Pedro Alves <palves@redhat.com> wrote:
> 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.
Committed, thanks.
> 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.
Agreed.