From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30345 invoked by alias); 3 Oct 2014 08:57:56 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 30332 invoked by uid 89); 3 Oct 2014 08:57:55 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 03 Oct 2014 08:57:54 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s938vqER011992 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 3 Oct 2014 04:57:52 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s938vo9w011106; Fri, 3 Oct 2014 04:57:51 -0400 Message-ID: <542E650E.4090609@redhat.com> Date: Fri, 03 Oct 2014 08:57:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 MIME-Version: 1.0 To: Doug Evans CC: gdb-patches Subject: Re: [PATCH] Don't run forever in gdb.base/structs.c References: <542C936A.60507@redhat.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2014-10/txt/msg00048.txt.bz2 On 10/02/2014 09:10 PM, Doug Evans wrote: > On Wed, Oct 1, 2014 at 4:51 PM, Pedro Alves 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. Thank you. Guess this could be material for: https://sourceware.org/gdb/wiki/GDBTestcaseCookbook ? >> 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. Expanding on that a bit: TBC, I see no problem with alarm() if the test is already using other posix-ish things, like pthread_create, or signal. I'd avoid iff the test otherwise could be mostly plain C/C++ and OS independent, like structs.c. Thanks, Pedro Alves