From patchwork Wed Mar 4 11:04:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Modra X-Patchwork-Id: 446193 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id E2AEE14016B for ; Wed, 4 Mar 2015 22:04:47 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass reason="1024-bit key; unprotected key" header.d=sourceware.org header.i=@sourceware.org header.b=bMdPyGq7; dkim-adsp=none (unprotected policy); dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:cc:subject:message-id:references :mime-version:content-type:in-reply-to; q=dns; s=default; b=tt6V RlO+cS/l88UQP3JPrVWRBQeSixEVDuVYKXEA+vRsGBG8NhOwHysCrAVK4hMXy0kb FeU4QGeJStsG1FOsskqZatS8/BQASm21cyrJDFCFCTSZ73/c8IhqEuoEbUsvDeYT t+7S8o/Wz4yJzGJkWTmTxljEw7tbNyi4b3sbf/0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:cc:subject:message-id:references :mime-version:content-type:in-reply-to; s=default; bh=IQKh8T0RkZ N0mBxCTtnFTEboQDk=; b=bMdPyGq7rQsgO1VhX471Z/lQJ21pCkkrxlmt9IZbbj /tnLd9qh/DyQPhjBvJ10nbq6OhPLxz9eDhFZu1gQ34j1iJaJ/QMfD7O1Whw9bTOx 8rZv6YYgakXZ+k8nSPhtB9E7wjmEwiF1eqsmjUiEdm0OqpgZH2WuTktcV3KvMZUb A= Received: (qmail 27606 invoked by alias); 4 Mar 2015 11:04:41 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 27581 invoked by uid 89); 4 Mar 2015 11:04:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.4 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, KAM_FROM_URIBL_PCCC, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=no version=3.3.2 X-HELO: mail-pa0-f49.google.com X-Received: by 10.70.118.234 with SMTP id kp10mr6011937pdb.20.1425467076895; Wed, 04 Mar 2015 03:04:36 -0800 (PST) Date: Wed, 4 Mar 2015 21:34:30 +1030 From: Alan Modra To: Alexandre Oliva Cc: Roland McGrath , codonell@redhat.com, libc-alpha@sourceware.org Subject: Re: [BZ#17090/17620/17621]: fix DTV race, assert, and DTV_SURPLUS Static TLS limit Message-ID: <20150304110430.GE26435@bubble.grove.modra.org> References: <20141118224048.600312C3B23@topped-with-meat.com> <20141120021703.86F032C3B18@topped-with-meat.com> <20150304050529.GD26435@bubble.grove.modra.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20150304050529.GD26435@bubble.grove.modra.org> User-Agent: Mutt/1.5.23 (2014-03-12) On Wed, Mar 04, 2015 at 03:35:29PM +1030, Alan Modra wrote: > As does nptl/tst-stack4 on x86_64 if tst-stack4mod.so is built with > -mtls-dialect=gnu2. This on top of your patch gets me past the segfault in free(). I now hit another segfault, tst-stack4mod.c:function somehow has var == NULL. diff --git a/elf/dl-tls.c b/elf/dl-tls.c index 311cc6d..44e2a2b 100644 --- a/elf/dl-tls.c +++ b/elf/dl-tls.c @@ -674,6 +674,9 @@ _dl_update_slotinfo (unsigned long int req_modid) struct link_map *map = listp->slotinfo[cnt].map; if (map == NULL) { + if (dtv[-1].counter < total + cnt) + continue; + /* If this modid was used at some point the memory might still be allocated. */ if (! dtv[total + cnt].pointer.is_static