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: 5447 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