From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7318 invoked by alias); 2 Oct 2014 20:10:09 -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 7303 invoked by uid 89); 2 Oct 2014 20:10:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-vc0-f180.google.com Received: from mail-vc0-f180.google.com (HELO mail-vc0-f180.google.com) (209.85.220.180) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 02 Oct 2014 20:10:07 +0000 Received: by mail-vc0-f180.google.com with SMTP id le20so1905630vcb.11 for ; Thu, 02 Oct 2014 13:10:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=7hDUtVhX+FVmGN/Jxt12IxI8iZxos028Qz5A/TnVol0=; b=MVxzGLxfwv9alwVdQwKoPl/2GJ6J5ZDYXn3WdtAkkrmCcAxH2q7Y1bKsSyR0YJ+IGT 8THyi/fnKmoOWIm+an1AKFTrOfxxDT6Oimoe2YVVrloQc1NCF2a62g7EtUwQ0lJ9vVwl 54n7pukfRqPTR/upk5QD0fmKitlkzDitgUfWRpwZ4cNNZavavlMhwW70dy/2VxUocztb DWe6/MS0V7/dMdHg5n8ObZYxowOCf7lSeNVUcAgSeddtKbCjT9TqFBmyzNx/fbhaHs0T F2EWcOrmX7W97BrLYjZcZc31JVVoRMZvMuOpIb6MdYFMae5PP99suAqB8ahRNBJlGq31 yBJw== X-Gm-Message-State: ALoCoQmGwG/uMFs6ZQPne/V+I5F8JWRv8ti7deofm/wMXfMoPSppqwPuV/lECaXpdhZjA/D8r0Mn MIME-Version: 1.0 X-Received: by 10.52.35.209 with SMTP id k17mr16727vdj.68.1412280604777; Thu, 02 Oct 2014 13:10:04 -0700 (PDT) Received: by 10.52.181.65 with HTTP; Thu, 2 Oct 2014 13:10:04 -0700 (PDT) In-Reply-To: <542C936A.60507@redhat.com> References: <542C936A.60507@redhat.com> Date: Thu, 02 Oct 2014 20:10:00 -0000 Message-ID: Subject: Re: [PATCH] Don't run forever in gdb.base/structs.c From: Doug Evans To: Pedro Alves Cc: gdb-patches Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2014-10/txt/msg00043.txt.bz2 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. > 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.