This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [BZ#17090/17620/17621]: fix DTV race, assert, and DTV_SURPLUS Static TLS limit
- From: Alan Modra <amodra at gmail dot com>
- To: Alexandre Oliva <aoliva at redhat dot com>
- Cc: Roland McGrath <roland at hack dot frob dot com>, codonell at redhat dot com, libc-alpha at sourceware dot org
- Date: Wed, 4 Mar 2015 21:34:30 +1030
- Subject: Re: [BZ#17090/17620/17621]: fix DTV race, assert, and DTV_SURPLUS Static TLS limit
- Authentication-results: sourceware.org; auth=none
- References: <ord28kkvpq dot fsf at free dot home> <20141118224048 dot 600312C3B23 at topped-with-meat dot com> <orppcjotfm dot fsf at free dot home> <20141120021703 dot 86F032C3B18 at topped-with-meat dot com> <or8uj6qse8 dot fsf at free dot home> <oroas0mzri dot fsf at free dot home> <orlhmgyall dot fsf at free dot home> <orlhlgdb8d dot fsf at livre dot home> <ormw411b25 dot fsf at livre dot home> <20150304050529 dot GD26435 at bubble dot grove dot modra dot org>
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().
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
I now hit another segfault, tst-stack4mod.c:function somehow has
var == NULL.
--
Alan Modra
Australia Development Lab, IBM