From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32776 invoked by alias); 24 Oct 2017 02:05:55 -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 32757 invoked by uid 89); 24 Oct 2017 02:05:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=completion, Hx-languages-length:1185, waited, HTo:U*macro X-Spam-User: qpsmtpd, 2 recipients X-HELO: smtp.polymtl.ca Received: from smtp.polymtl.ca (HELO smtp.polymtl.ca) (132.207.4.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 24 Oct 2017 02:05:53 +0000 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id v9O25kSU022793 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 23 Oct 2017 22:05:51 -0400 Received: by simark.ca (Postfix, from userid 112) id EB8AC1E523; Mon, 23 Oct 2017 21:56:21 -0400 (EDT) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id 9E48D1E493; Mon, 23 Oct 2017 21:56:19 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 24 Oct 2017 02:05:00 -0000 From: Simon Marchi To: "Maciej W. Rozycki" Cc: Djordje Todorovic , Pedro Alves , binutils@sourceware.org, gdb-patches@sourceware.org, asowda@cisco.com, petar.jovanovic@rt-rk.com, nemanja.popov@rt-rk.com, nikola.prica@rt-rk.com Subject: Re: [PATCH 3/3] Add test for fetching TLS from core file In-Reply-To: References: Message-ID: X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.3.0 X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Tue, 24 Oct 2017 02:05:46 +0000 X-IsSubscribed: yes X-SW-Source: 2017-10/txt/msg00735.txt.bz2 On 2017-10-23 19:42, Maciej W. Rozycki wrote: > You can't guarantee overall a test program won't hang, loop, etc. due > to > a bug somewhere. The issue of lingering processes should IMHO be > handled > by assigning software run on the target a new session and then killing > the > process group on completion. I believe this is actually done already, > as > this is how expect's `spawn' works and I think we also have it handled > for > the remote case in the `gdbserver' test harness (but I'd love to get a > confirmation here). > > How do you propose anyway, in the absence of an infinite wait/loop, to > ensure that the process does not terminate before the test harness has > done its processing? Ah sorry, I saw the while (1) loop in the thread function, and thought that the main function waited for the threads to complete. But it doesn't, it would exit right away after creating the threads. What I meant was to try to avoid infinite loops. Instead of while (1) sleep (1); you can generally do for (int i = 0; i < 100; i++) sleep (1); So that if the process runs free, it will eventually exit by itself. Simon