From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6043 invoked by alias); 16 Feb 2009 10:26:53 -0000 Received: (qmail 6033 invoked by uid 22791); 16 Feb 2009 10:26:53 -0000 X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_43 X-Spam-Check-By: sourceware.org Received: from e28smtp03.in.ibm.com (HELO e28smtp03.in.ibm.com) (59.145.155.3) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 16 Feb 2009 10:26:39 +0000 Received: from d28relay02.in.ibm.com (d28relay02.in.ibm.com [9.184.220.59]) by e28smtp03.in.ibm.com (8.13.1/8.13.1) with ESMTP id n1GAQVBr015421 for ; Mon, 16 Feb 2009 15:56:31 +0530 Received: from d28av05.in.ibm.com (d28av05.in.ibm.com [9.184.220.67]) by d28relay02.in.ibm.com (8.13.8/8.13.8/NCO v9.1) with ESMTP id n1GANsB24432092 for ; Mon, 16 Feb 2009 15:53:54 +0530 Received: from d28av05.in.ibm.com (loopback [127.0.0.1]) by d28av05.in.ibm.com (8.13.1/8.13.3) with ESMTP id n1GAQUKK029955 for ; Mon, 16 Feb 2009 21:26:31 +1100 Received: from [9.124.215.141] ([9.124.215.141]) by d28av05.in.ibm.com (8.13.1/8.12.11) with ESMTP id n1GAQTwZ029942; Mon, 16 Feb 2009 21:26:30 +1100 Subject: Re: [RFC][Patch] Fix gdb failure to access tls data for parent thread From: Vinay Sridhar To: Daniel Jacobowitz Cc: gdb-patches@sourceware.org, luisgpm@linux.vnet.ibm.com In-Reply-To: <20090215182233.GA24660@caradoc.them.org> References: <200901091416.10563.vinay@linux.vnet.ibm.com> <20090204132851.GA9935@caradoc.them.org> <1234341068.13249.4.camel@localhost.localdomain> <20090211155300.GA22689@caradoc.them.org> <1234417406.6489.3.camel@localhost.localdomain> <20090215182233.GA24660@caradoc.them.org> Content-Type: text/plain Date: Mon, 16 Feb 2009 15:04:00 -0000 Message-Id: <1234779868.4861.7.camel@localhost.localdomain> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit 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 X-SW-Source: 2009-02/txt/msg00331.txt.bz2 On Sun, 2009-02-15 at 13:22 -0500, Daniel Jacobowitz wrote: > On Thu, Feb 12, 2009 at 11:13:26AM +0530, Vinay Sridhar wrote: > > On Wed, 2009-02-11 at 10:53 -0500, Daniel Jacobowitz wrote: > > > On Wed, Feb 11, 2009 at 02:01:08PM +0530, Vinay Sridhar wrote: > > > > Daniel, > > > > > > > > Sorry for the late response. I can confirm that attach_thread is not > > > > called on the parent thread. The test case I had listed in my earlier > > > > mail uses OMP for thread creation. Could that have something to do with > > > > this? > > > > > > Well, it shouldn't; libgomp uses the normal POSIX thread interfaces. > > > I assume you're using GCC -fopenmp, right? Or is this another OpenMP > > > implementation? > > > > > > > I used IBM's XLC compiler which has an inbuilt OpenMP implementation. > > Sorry for the delay, I missed your message. > > In that case, you need to determine whether it is using POSIX threads > or whether it is using clone directly and ignoring the thread library. > If it is not using the POSIX threads library, how is it handling TLS > inside the threads? If it is using pthread_create, why didn't we get > a notification about it? > I was able to recreate this against a gcc compiled binary, so I guess the omp implementation isnt an issue here. Just to recap what I've been trying: $ cat tlsdbg01.c #include #include #include #include __thread int thr; void initTlsData() { printf("Initialising thread %d\n",thread); } int main(int argc, char *argv[]) { #pragma omp parallel { thr = omp_get_thread_num(); initTlsData(); } return(0); } 1. gcc -g tlsdbg01.c -fopenmp -o tlsdbg 2. gdb ./tlsdbg 3. break initTlsData 4. thread 1 5. print thr *Cannot find thread-local storage for LWP 29455, executable *file /home/tmp/tlsdbg: *TLS not supported on this target Regards, Vinay -- Vinay Sridhar, IBM Linux Technology Center