From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1255 invoked by alias); 19 Oct 2017 20:14:36 -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 1237 invoked by uid 89); 19 Oct 2017 20:14:36 -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= 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; Thu, 19 Oct 2017 20:14:35 +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 v9JKESGT009550 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 19 Oct 2017 16:14:33 -0400 Received: by simark.ca (Postfix, from userid 112) id 402871E56B; Thu, 19 Oct 2017 16:14:28 -0400 (EDT) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id E5B821E566; Thu, 19 Oct 2017 16:14:26 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 19 Oct 2017 20:14: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 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 Thu, 19 Oct 2017 20:14:28 +0000 X-IsSubscribed: yes X-SW-Source: 2017-10/txt/msg00646.txt.bz2 On 2017-10-18 09:35, Maciej W. Rozycki wrote: >> +int >> +main (void) >> +{ >> + pthread_t threads[NUMBER_OF_THREADS]; >> + int i; >> + for (i = 0; i < NUMBER_OF_THREADS; i++) >> + pthread_create (&threads[i], NULL, thread, &i); > > Missing `return' statement here. > > Also `while (1) sleep (10);' perhaps, so that you don't cause a race > with > the whole process terminating (I think `pthread_join (&threads[0], > NULL);' > would do too; I'm sure there are other ways as well to prevent from > running to exit(2)). Overall please don't assume any particular thread > scheduling characteristics of the underlying OS, and especially on SMP > systems effects may be sometimes surprising. Just make sure to avoid an infinite loop, in case the inferior is somehow left running after executing the test because of some bug somewhere. Simon